On the Change Variable (CHGVAR) command, you can specify %SWITCH to change the value of a logical variable.
The value of the logical variable is determined by the results of comparing your %SWITCH settings with the job switch settings. If the result of the comparison is true, the logical variable is set to '1'. If the result is false, the variable is set to '0'. For instance, if the job switch is set to 10000001 and this procedure is processed, then the variable &A has a value of '1'.:
PGM DCL &A *LGL CHGVAR VAR(&A) VALUE(%SWITCH(10000001)) . . . ENDPGM