Go to branch destination (depending on switches or JVs)
Component: | BS2000 |
Functional area: | Job processing |
Domain: | JOB |
Privileges: | STD-PROCESSING |
Function
Using the SKIP-COMMANDS command, conditional or unconditional branching can be performed in a procedure. The following conditions are possible:
Branch depending on the setting of a job switch (operand IF=*JOB-SWITCHES). Job switches can be set using the MODIFY-JOB-SWITCHES command (see section "Job switches").
Branch depending on the setting of a user switch (IF=*USER-SWITCHES operand). User switches can be set using the MODIFY-USER-SWITCHES command.
Branch depending on the contents of a job variable (IF=*JV operand). This function is only available in conjunction with the JV subsystem.
In the case of an unconditional branch, processing branches to the specified branch destination.
In the case of a conditional branch, processing branches to the specified branch destination if the condition is met. If the condition is not met, processing continues with the next command.
This command may only be used in cataloged command sequences. It is rejected in a dialog and therefore not offered in the menu.
In S procedures, SKIP-COMMANDS is subject to restrictions as non-S labels are supported at the top block level only. The GOTO command should be used for unconditional branches, and a corresponding IF command block for conditional branches. This will also enable branches within command blocks or into a superordinate command block.
Format
SKIP-COMMANDS | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Operands
TO-LABEL = <name 1..8>
Branch destination. Name of non-S label identifying the command with which processing is to continue if the specified condition is satisfied.
The name of the branch destination can be defined as a job variable.
If no condition is defined, an unconditional branch occurs. If the specified branch destination does not exist, the branch cannot be executed if the condition is satisfied, and the procedure is aborted.
IF =
Type of condition.
IF = *NO-CONDITION
An unconditional branch is made to the specified branch destination (TO-LABEL).
IF = *JOB-SWITCHES(...)
Branch depending on settings of specified job switches.
ON = *NONE / list-poss(32): <integer 0..31>
Job switches. The condition is satisfied when the specified switches are set to ON and the switches specified in the OFF operand are set to OFF. The default value is *NONE, i.e. the job switches are not checked to see whether they are set to ON.
OFF = *NONE / list-poss(32): <integer 0..31>
Job switches. The condition is satisfied when the specified switches are set to OFF and the switches specified in the ON operand are set to ON. The default value is *NONE, i.e. the job switches are not checked to see whether they are set to OFF.
IF = *USER-SWITCHES(...)
Branch depending on user switch settings.
USER-IDENTIFICATION = *OWN / <name 1..8>
User ID whose user switches are to be interrogated. The default value is *OWN, i.e. the user switches of the user ID under which the current job is running are interrogated.
ON = *NONE / list-poss(32): <integer 0..31>
User switches. The condition is satisfied when the specified switches are set to ON and the switches specified in the OFF operand are set to OFF.
The default value is *NONE, i.e. the user switches are not checked to see whether they are set to ON.
OFF = *NONE / list-poss(32): <integer 0..31>
User switches. The condition is satisfied when the specified switches are set to OFF and the switches specified in the ON operand are set to ON.
The default value is *NONE, i.e. the user switches are not checked to see whether they are set to OFF.
IF = *JV(...)
Branch depending on the contents of a JV.
CONDITION = <text 0..1800 with-low cond-expr>
Conditional expression (enclosed in parentheses).
Permissible specifications are described in section "Conditional expressions (job variables)". Special job variables are permitted.
Return codes
(SC2) | SC1 | Maincode | Meaning |
---|---|---|---|
0 | CMD0001 | Command executed | |
1 | CMD0202 | Syntax error, error in the condition, branch label not found, or branch to the SKIP-COMMANDS command | |
32 | CMD0221 | Internal error | |
32 | EXC0041 | System error | |
64 | EXC0868 | User ID not found | |
64 | EXC0878 | Label not found | |
130 | CJC0002 | JV cannot be accessed | |
130 | CJC0003 | Memory saturation | |
130 | CMD2382 | User ID locked |
Notes
In a procedure file, both forward and backward branching is possible, i.e. a previous set of commands can be processed. The system first searches for the branch destination from the SKIP-COMMANDS command to the end and then continues the search from the beginning of the file.
The period preceding the branch destination must not be inserted by expression replacement, because then the branch destination as such will no longer be found.