CHAIN


 

The CHAIN utility links various functions or utilities together for execution. CHAIN replaces the necessity of the operator manually executing each function or program within the CHAIN. This CHAIN utility is a simplified version designed to provide temporary support for the CHAIN functions. The command line format for the CHAIN utility is:

 

 

CHAIN {cmdfile} -[{OPTION={opt},}[{flags}]

Parameters:
cmdfile
The required name of the file that contains the commands.
opt
Options described below that control the action of the CHAIN program.
flags
Optional flags that are used in the compilation of the CHAIN program.

Note the following:

  1. If OPTION={opt} or {flags} is specified, it must be separated from the {cmdfile} by an option separator character. If both are specified, they must be separated by a comma.

  2. If a {cmdfile} extension is not given, CHN is assumed.

  3. If a path specification for {cmdfile} is not given, the current path is first searched followed by all search paths.

  4. OPTION={opt} provides the CHAIN utility with specific instructions as to what to do with the {cmdfile} after processing. OPTION may be specified as OPTION, OPN, or OP but must be followed by an equal sign (=) and a valid option.

  5. The valid OPTIONs are:

  6. C

    Compile the CHAIN only. Do not execute any of the commands but check every line as if it were to be executed. The resulting CHAIN, after all conditions have been met, is written out to the file 'CHAINP??.SYS' where '??' is the port number as retrieved from the CLOCK PORT instruction.

    I

    List the input file. This option lists {cmdfile} on the screen prior to its execution.

    R

    List the output file. This option lists on the screen only those lines that meet the necessary conditions to be executed.

     

    User defined check points are available for conditional compilation of the actual procedure file before execution. These Tags are specified in the {flags} portion of the command line and are merely labels that may be checked during the CHAIN procedure.

     

  7. Execution time commands to the CHAIN utility must begin with two slashes (//) as follows:

  8. //.

    Display this line on the CRT during execution of the CHAIN procedure.

    //*

    Display this line on the CRT during execution of the CHAIN procedure, pause and wait for the operator to depress the F1 key (function key 1) before continuing with the remainder of the CHAIN. Depressing the F2 key (function key 2) at this time terminates the CHAIN. Any other key has no effect on the pause.

    //STAMP

    Display the current date and time on the screen prior to executing the next command.

     

  9. Compilation time commands to the CHAIN utility must begin with two slashes (//). They are used for checking the Tags explained above. The allowable parameters are:

  10. //IF

    If the specified {label} is set or clear, execute the next line(s) in the CHAIN file. If the condition(s) are not satisfied, all trailing lines are ignored until an XIF or an ELSE command line is located.

    //IF {label}

    True IF condition checking

    //IF ~{label}

    False IF conditions are indicated with a tilde (~) preceding the label

    //IF FFILE

    If the specified {file} is found, execute the next line(s) in the CHAIN file. If the condition(s) are not satisfied, all trailing lines are ignored until an XIF or an ELSE command line is located.

    //IF FFILE({file})

    True if file exists condition checking

    //IF ~FFILE({file})

    False if file exists conditions are indicated with a tilde (~) preceding the label.

    //ELSE

    If the previous condition was not true, force the true indicator on and execute the next line(s) in the CHAIN file. All trailing lines are executed until an XIF command line is located or another condition is tested and is false.

    //XIF

    Clear the indicator for the previous conditional check. The next line in the CHAIN file is executed.

    &

    Chain file comment. Ignored by the CHAIN program.

    .

    Compile time comment that is displayed on the screen but otherwise ignored.

     

  11. Tags are limited to eight (8) characters. If longer than eight characters, the first seven characters and the last character are used internally for the actual Tag name.

  12. Duplicate Tag names are not allowed.

  13. Nested CHAINing, up to 32 levels, is supported. Nested conditions are valid as follows:

  14. //IF A

    Execute the commands in this location

    //IF B

    Execute the commands in this location

    //XIF

    Clears the second IF condition

    //XIF

    Clears the first IF condition

     

    The second IF condition would be checked only if the first had been true. If it was not true, all lines are ignored until its matching XIF is found.

     

  15. KEYIN data cannot be incorporated into a CHAIN file. The only manner in which KEYIN data may be directed into a program loaded through the CHAIN utility is by using the keyboard redirection technique. The KEYIN data is placed into an ASCII text file and then that file would be the redirected source. Keyboard redirection may be accomplished by placing a less than sign and the filename after the program name (i.e., TESTPROG <KEYDATA.TXT ). The program TESTPROG retrieves the requested KEYIN data from the file KEYDATA.TXT until the end of file is reached or the program terminates, whichever occurs first.

  16. Chain files may not be nested. If a CHAIN command is contained in a CHAIN procedure, the new CHAIN command terminates the currently executing CHAIN procedure when it begins execution.

 

 

See Also: CHAIN Examples, Utilities

 



System Utilities BUILD FREE