• Aucun résultat trouvé

OAKLAND AV, SUDBURY 285-9009

Dans le document TRAX Support Environment User's (Page 65-69)

CHAPTERS PROGRAM DEVELOPMENT

CHAPTER 6 BATCH PROCESSING

13 OAKLAND AV, SUDBURY 285-9009

20,00

CURRY, JANET

140 LINDENWOOD DR, SUDBURY 287-8123

15.00

TOWNE, DAVID NO PERM ABODE·

581-3345 0.00

$RUN MEMLIST

Notice that the data does not include dollar sign characters at the beginning of any line.

Data entered in the form shown above must not include dollar signs as the first nonblank character of the line, because the system would interpret a dollar sign as the beginning of a batch command.

To enter program input that contains dollar sign characters as the first nonblank character on the line, you must precede the input data with the following command:

$ItATA/[lOl.LARS

This alerts the system that the lines· of data to follow may possibly begin with dollar signs.

All information that follows this command is treated as data until the following command is encountered:

$EOD

This command has no qualifiers or parameters; it simply marks the end of the data block.

You can include this command at the end of any· batch data block, but it is only required when you must terminate data that includes dollar sign characters. ($EOD is also used to terminate data following a $CREATE/DOLLARS command.)

Normally, all data blocks are included in the log file for the batch job. If you wish to suppress this copying, you must include a $DATA command that includes the /NOCOPY qualifier:

$ItATA/NOCOPY

The log file does not receive the data that follows.

In general, you need only include the $DA T A command when you wish to use the

/DOLLARS qualifer, the /NOCOPY qualifier, or both. $EOD is required only when a prior

$CREATE/DOLLARS or $DATA/DOLLARS command is present.

6.7 ERROR STATUS AND SEQUENCE CONTROL

Commands and tasks return a status on exit, indicating whether an error occurred. In batch processing you can specify alternative action to be taken in the event of an error.

Batch Processing

6.7.1 Status Levels

Any of four exit status levels can occur:

SUCCESS WARNING ERROR

SEVERE_ERROR

If exit with status is not implemented in the task or command, no status level is returned to the batch processor and execution continues as if the status had been SUCCESS.

SUCCESS indicates that results should be as expected.

WARNING indicates that the task has succeeded, but with possible irregularities, and that results may not be as expected.

ERROR is stronger than WARNING; results are unlikely to be as expected.

SEVERE_ERROR indicates one or more fatal errors and that the command or task may have been terminated prior to completion.

6.7.2 Conditional Processing

Four batch commands are designed to control the processing sequence in a batch procedure. They specify alternative action to be taken by the batch processor should an error occur in a command or task.

6.7.3 The SON Command

The SON command specifies action to be taken in the event that any subsequent command returns an exit status with a severity as great or greater than that specified in the command. Its format is:

SON status-level THEN action

The status-level must be one of the following:

WARNING ERROR

SEVERE_ERROR

Then the action must be one of the following:

CONTINUE STOP GOTO label

The arguments of the $ON command are stored in local memory, and referenced whenever a command or task that returns a status level is executed. $ON is a global command. These argu-ments remain in force until superseded by another $ON command, until end-of-job, or until the

$ON command actually takes effect. Any individual $ON command can be executed only once.

If no $ON command is in effect, and execution produces an exit status of ERROR or SEVERE-ERROR, the processing of the batch job stops. That is to say, the initial (or default) setting is

$ON ERROR THEN STOP. The STOP action causes the batch processor to skip all remaining commands in the batch file. If an $ON command is found, on attempted execution, to be faulty, the batch processor reverts to the default setting.

Example:

$ON ERROR THEN STOP

$COBOL MYPROG flINt< MYPROG

$RUN MYPROG

If the assembly is completed with a status of success or warning, the job continues with the linking.

If the linking produces no status worse than a warning, the task is run. If however, a status level of ERROR or SEVERE-ERROR is produced by the $MACRO, $LINK, or $RUN command, the batch job is stopped.

6.7.4 The $SET [NO] ON Command

The $SET NOON command suspends the influence of the $ON command currently in effect. Its fonnat is:

$SET NOON

The $SET ON command reinstates the $ON command that was previously negated by a $SET NOON command. Its fonnat is:

$SET ON

6.7.5 The $IF Command

The $IF command is similar to the $ON command, except that it operates locally, pertaining only to the last preceding command (excluding other sequence-control commands). Also, it tests only for status-level actually specified; the THEN action is executed only if the status-level returned by the preceding command matches exactly the status-level specified in the $IF command. Its format is:

$IF status-level THEN action

Status-level must be one of the following:

Batch Processing

SUCCESS WARNING ERROR

SEVERE-ERROR

The action parameter is the same as for the SON command.

6.7.6 The SGOTO Command

The $GOTO command instructs the batch processor to unconditionally skip all commands up to a specified label. Execution continues at the command bearing that label. Only forward branching is allowed. The fonnat is:

$GOTO label

The $GOTO command must appear with a label. The label must appear, followed by a colon, in front of a later command, or the job is tenninated. For example:

Dans le document TRAX Support Environment User's (Page 65-69)