SCHEDULE

Syntax

             ┌◄────────────────────────────────────────────────┐
── SCHEDULE ─┴─┬─────────────────────────────────────────────┬─┴───────┤
               │ ┌◄─────────────────────────────────┐        │
               ├─┴─┬─/1\─<input file title>───────┬─┴────────┤
               │   └─/1\─ TO ──<output file name>─┘          │
               │     ┌◄───────────────── , ────────────────┐ │
               └─ : ─┴─┬─ AFTER ──<time>─────────────────┬─┴─┘
                       ├─ ON ──<date>────────────────────┤
                       ├─ CHARGE ──<chargecode>──────────┤
                       ├─ EOL ─┬─<special character>─────┤
                       │       └─<control char mnemonic>─┤
                       └─ LINE ──<line width>────────────┘

<input file title>

──<file title>─────────────────────────────────────────────────────────┤

<output file name>

──<file name>──────────────────────────────────────────────────────────┤

<date>

──<month>── / ──<day>── / ──<year>─────────────────────────────────────┤

<line width>

──<integer>────────────────────────────────────────────────────────────┤

Explanation

The SCHEDULE command invokes a file of CANDE commands (including program input) in a separate schedule session that is independent of the user's station. The schedule session can begin immediately, or after a specified time and date. The schedule input is merged with any session output to generate a schedule output file, which is an image of the information that would have appeared on a terminal had the session been interactive. The user can inquire about schedule sessions with a STATUS command and can end a session with a STOP command.

<input file title>

The input file title, if specified, indicates the title of the file that contains the schedule-session input; it can specify any file accessible to the user. If no file title is specified, the work file is used. CANDE copies the input into a special schedule file, so the named file or work file can be changed or removed as soon as the SCHEDULE command is completed with no effect on the schedule session. The input file can be of any type (FILEKIND) recognized by CANDE. Only the text portion of each line is processed by CANDE or user programs as input; the text field cannot exceed 84 characters in width.

<output file name>

The output file name, if specified, indicates the name of the file that is to receive the session terminal image; it cannot have a usercode or asterisk (*) prefix. If the output file name is omitted, a name is generated by prefacing SCHOUT/ to the input file title or work file name, respectively. Any usercode prefix or family suffix in the input file title is ignored. The output file name, whether explicit or default, must be unique from any file name already in the user's library. An unnamed work file, such as one accessed from another usercode that has not yet been given a name in the new usercode, can be designated as a schedule file. However, an output file name must be given to the output schedule file; the default file name node SCHOUT/ is not sufficient in this case. The following error message is given if an output file name is not specified for this case:

#UNNAMED WORKFILE REQUIRES AN EXPLICIT SCHEDULE OUTPUT FILE

The output file is created with the security set to PRIVATE when the SCHEDULE command is processed. Initially, the output file contains a single line, #SCHEDULE #<schednum> IS SCHEDULED, followed by a blank line. These lines are overwritten when the scheduled session begins. The output file is of type SCHED (FILEKIND=SCHEDULEFILE); because it contains no sequence numbers, CANDE lists it with none. Any other CANDE command (such as GET, FIND, INSERT, WRITE) treats a SCHED file as type CDATA.

AFTER <time>

By default, a schedule session is immediately considered for processing, subject only to availability of resources. The AFTER <time> command option can be used to defer processing until after a specified time of the day. The time is specified as an integer in 24-hour notation; thus, 0000 represents midnight, 0001 represents 12:01 a.m., and 2359 represents 11:59 p.m. Any value less than the current time of day refers to that time the next day.

ON <date>

The ON <date> option can defer the schedule session to a particular date. This option must be used if processing is to be delayed for more than 24 hours. The date format is <month>/<day>/<year>. Each month and day value can be either a 1-digit or 2-digit number, and the year can be either a 2-digit or 4-digit number. For example, the following form of the SCHEDULE command processes a file named SCH/GENLEDGER/OCT, on October 31, 1991 after 6:00 pm:

SCHEDULE SCH/GENLEDGER/OCT :AFTER 1800, ON 10/31/91

LINE <line width>

The LINE <line width> command option specifies an integer in the range 72 through 255 to set the maximum terminal width (the MAXRECSIZE of the session output file). The default is the input file text length or 72 characters, whichever is larger.

CHARGE <chargecode>

The scheduled session runs under the usercode that scheduled the session. The chargecode can be either explicitly set or set by default.

The chargecode is the chargecode in effect at the time the SCHEDULE command was processed. The user's default family and language (obtained from the USERDATAFILE) are used to begin the scheduled session; the family and language in effect when the SCHEDULE command was processed are not used. The FAMILY command can be used as part of the schedule input to change the family during the scheduled session. The LANGUAGE command can be used as part of the schedule input to change the language during the scheduled session.

EOL <special character>

By default, each input line ends after the last nonblank character. If EOL <special character> or EOL <control char mnemonic> is specified, the special character or control character can be used to mark the end of an input line by placing it after the last column of valid input on the line. Any further information is ignored because the character effectively ends the line. For example, the specification EOL \ permits the following input lines:

FIX 1230/e./e. \
1460 \

The above EOL specification allows a FIX insertion to end in a blank and allows input of a blank line, respectively. To avoid retaining graphic characters on terminals that allow control characters to be entered, choose control characters that do not interfere with the data comm usage of that station. For example, SUB is a suitable control character mnemonic that is entered as control-Z on most ASCII keyboards and can be entered through EBCDIC cards as a 7-8-9 multipunch.

The EOL construct can also be useful for entering comments. For example, the specification EOL % would allow the following input line:

RUN GENLEDGER/3QTR % THIS PROGRAM PROCESSES THE GENERAL LEDGER FOR
      THE THIRD QUARTER

SCHEDULE Input File

In essence, the schedule input file is a script for a session. The schedule input file must contain every input line that the user would type at the terminal (after logging on) if the session were interactive. The schedule input file can contain any CANDE command except HELLO, PASSWORD, or TAPE. Any TERM command must be empty (containing no change to terminal specifications). A BYE command is optional and terminates the session wherever it appears. CANDE infers a ?END or BYE, if appropriate, at the end of the schedule input file. A line beginning with a question mark (?) is treated as a control command; the control commands acceptable in a schedule session are defined in subsequent text in this section.

A line entered in single-line sequencing mode that begins with two question marks (??) is treated as valid data beginning with a question mark (?), as in interactive CANDE sessions. Also, a program reading a line beginning with two question marks (??) discards the first question mark (?); the line is then given as data to the program. This feature is not available to an interactive session.

REMOTE Files

A schedule session is run with a dummy data comm station to provide for REMOTE files. For most purposes, the schedule station behaves programmatically like a real station. Specifically, the REMOTE files of any tasks processed from the schedule session are associated by default with the schedule station. As with any session, this linkage is accomplished through the STATION task attribute and may be overridden by explicit user action. By setting STATION to a valid logical station number (LSN) or by setting it to zero and equating the file TITLE appropriately, a task of a schedule session may attempt to open a file on a genuine data comm station (subject to the same constraints as any other foreign user of a station). On the other hand, only tasks of the particular schedule session can open REMOTE files to a schedule station.

Schedule Control Commands

The following control commands are available for schedule as well as interactive sessions:

Control Command

Effect

?DENY

Closes all input and output remote files for a program.

?END

Denotes the end of input for a program.

?TIME

Shows current time and date.

?%

Enters comments.

The following special control commands are available only for schedule sessions:

Control Command

Effect

?REPORT

Sends a message to an interactive user.

?NUMBERED

Lists sequence numbers of the input file in the output file.

?UNNUMBERED

Does not list sequence numbers of the input file in the output file.

?RESTART

Restarts aborted sessions.

?NORESTART

Does not restart aborted sessions.

?RESUME

Resumes input after schedule session errors are detected.

?EOL

Changes the end-of-line character.

For a description of these commands, refer to CANDE Control Commands. No control commands other than those listed above are permitted in a schedule input file.

Each schedule session is assigned a unique integer for identification and operator interaction, called schednum. Schednum is always displayed as a 5-digit number (with leading zeros) to distinguish it from a session number. The schednum is assigned when the schedule input file is created and is included in the schedule input file title. The schednum appears in the output file and in messages about the schedule session. A session number is assigned when the schedule session processing begins; if the session is restarted or SPLIT, a new session number is assigned. All session numbers used by a schedule session appear in the second line of the output file, as well as in the separate log-on or session-split messages.

SCHEDULE File

For each schedule session, CANDE creates an output file and a schedule file on the same family as that of CANDE.

If an output file title is not specified, then the following default output file name is used:

SCHOUT/<input file title>

And the following schedule file is created:

*SCHEDULE/SYSTEM/CANDE/<schednum>

At the end of the schedule session, CANDE removes the schedule file (*SCHEDULE/SYSTEM/CANDE/<schednum>). The output file remains on the system for your use.

When the task scheduled through the SCHEDULE command is started, CANDE verifies that the corresponding schedule output file exists. If the output file that corresponds to the schedule input file does not exist because the output file was deleted, then the schedule session is terminated and the name of the schedule file is changed to the following:

*SCHEDULE/SYSTEM/CANDE/<schednum>/BAD

The *SCHEDULE/SYSTEM/CANDE/<schednum>/BAD file is not removed but is kept as evidence for the terminated session. A privileged user can remove this file if it is not needed.

To avoid creating the *SCHEDULE/SYSTEM/CANDE/<schednum>/BAD file, you should terminate a previously scheduled session only with the STOP command.

Examples

SCH SCH/WFL
#SCHEDULE OUTPUT FILE NAME IS IN USE
#FILE:(UZER)SCHOUT/SCH/WFL ON USERPACK
#

REMOVE SCHOUT/SCH/WFL
#(UZER)SCHOUT/SCH/WFL ON USERPACK REMOVED

SCH SCH/WFL
#SCHEDULE #00009 RUNNING
 OUTPUT FILE IS (UZER)SCHOUT/SCH/WFL ON USERPACK
 LINE WIDTH IS 72
#

REMOVE SCHOUT/SCH/WFL
#(UZER)SCHOUT/SCH/WFL ON USERPACK REMOVED

SCH SCH/WFL:AFTER 1430, ON 10/31/91
#SCHEDULE #00010 IS SCHEDULED AFTER 14:30 ON 10/31/91
 OUTPUT FILE IS (UZER)SCHOUT/SCH/WFL ON USERPACK
 LINEWIDTH IS 72
#