Search code examples
mainframejcl

How to know what does the variable in SYSTSIN contains?


While going through a JCL job, i found the following code snippet. What does this mean? How do we know what %var2fix contains?

//JS0005 EXEC PGM=IKJEFT01  
//SYSEXEC DD DSN=ISPFGRP.ICEC.ISPFEXEC,DISP=SHR  
//INPUT DD DSN=PSMC.CMDS.N001(0),DISP=SHR  
//SYSPRINT DD SYSOUT=*  
//SYSUDUMP DD SYSOUT=*  
//SYSTSPRT DD SYSOUT=*  
//SYSTSIN DD *  
%VAR2FIX  
/*

Solution

  • The first thing of importance is the program that is invoked by the JCL, which is IKJEFT01, which is basically TSO (TIME SHARING OPTION) via batch. If for argument's sake the program were IEFBR14 (do nothing based upon BR 14 which is Branch to Register 14, Register 14 holding the return address). The SYSTSIN is not even opened and thus %VAR2FIX wouldn't even be looked.

    Back to IKJEFT01 the ddname SYSTSIN is read as Terminal Input i.e. it's basically the command line for native TSO. As such %VAR2FIX is a command, which you could replicate by typing TSO %VAR2FIX where a command can be typed (note the vast majority of people don't directly use native TSO nowadays, rather they use a "friendlier environment" such as ISPF/PDF or Roscoe).

    Now if instead of %VAR2FIX there was IEFBR14 then I could say what that meant as IEFBR14 is a well known common program that can be invoked as a command. e.g. you could do TSO IEFBR14 (remember it does nothing). Now %VAR2FIX is not a common command, in fact it is virtually definitely an in-house command.

    Back to the JCL, there is a DD statement with a dd name of SYSEXEC, which, if I recall correctly, allows Rexx programs, in the respective dataset, to be run as commands. I think if you look at the dataset allocated to SYSEXEC you will find a member called VAR2FIX and it is this program/command that will be invoked. If I recall correctly the % is ignored as regards to the command name.