PURPOSE: The SF COMMAND INPUT option allows commands to be taken from a System File (SF) while a Command Module (CM) is executing. This command is valid in a CM, PM, SF and as a direct command.
{ENABLE; DISABLE} SF COMMAND INPUT [{IF; UNLESS} clause]
ENABLE |
sets a condition such that when a USE SF command occurs in a CM, control is passed to the SF as the source of the next command. The SF runs to completion, then returns control to the next line of the CM. If ENABLE SF DATA INPUT is in effect, the SF can contain both commands and data. |
DISABLE |
is the default state. When this condition exists, any SF open while a CM is running supplies only data lines to the CM, not commands or subcommands. |
{IF; UNLESS} clause |
specifies certain criteria that must be met for the ENABLE or DISABLE command to take effect. |
The following CM uses an SF to create a set of standard Data Sets (DS) with the user’s initials as part of the name. DS FILES_NAM contains names of the standard DS’s, without extensions, and their corresponding Schema Definition (SD) names. Line 40 uses the fields DATA_SET_NAME and SCHEMA_NAME from DS FILES_NAM to create a series of CREATE commands, which are stored in the file TEMP.CMD. Line 50 queues SF TEMP.CMD, then line 60 executes it as a command file. It creates all the DS’s, then returns control to the CM. Line 70 normalizes the environment. If the CM is called by an SF, or if other SF’s are queued, the DISABLE statement must be in SF TEMP.CMD. Otherwise, control will not return to this CM.
*LIST CM CREATE_OPERATOR_DATA_SETS
00010 TYPE "ENTER YOUR INITIALS: ",NOCR
00020 ACCEPT @STRING
00030 USE DS FILES_NAM
00040 EXTRACT SHOWING "CREATE DS ", DATA_SET_NAME, &
"." , @STRING , " SD IS " , SCHEMA_NAME SAVE ON TEMP.CMD
00050 ENABLE SF COMMAND INPUT
00060 USE SF TEMP.CMD
00070 DISABLE SF COMMAND INPUT
00080 TYPE "ALL DONE""
SEE ALSO: SF DATA INPUT, System File - Command Input