REFERBACK


The referback (backward reference) is used to get the information from the previous steps to the current step. This process reduces redundant coding and syntax errors. "*" is used as a referback operator.

Syntax -

*.ddname
*.stepname.ddname
*.proc-name.ddname
*.proc-name.stepname.ddname
*.ddname Refers the ddname from previous step.
*.stepname.ddname Refers the ddname from step stepname.
*.proc-name.ddname Refers the ddname from PROC proc-name.
*.proc-name.stepname.ddname Refers the ddname from step stepname in PROC proc-name.

Examples -


Scenario1 - Using the DCB of INPUT ddname in the same step.

//STEP02   EXEC PGM=PROG
//INPUT    DD DSN=MTH.INPUT.FILE2,DISP=SHR
//OUTPUT   DD DSN=MTH.OUTPUT.FILE,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,(10,10),RLSE),
//            DCB=*.INPUT

In the above example, MTH.OUTPUT.FILE created with the same DCB as the MTH.INPUT.FILE2.

Scenario2 - Using the DCB of INPUT ddname of other step.

//STEP01   EXEC PGM=PROG1
//INPUT    DD DSN=MTH.INPUT.FILE,DISP=SHR
//OUTPUT   DD DSN=......
//STEP02   EXEC PGM=PROG2
//INPUT    DD DSN=......     
//OUTPUT   DD DSN=MTH.OUTPUT.FILE,
//         DISP=(NEW,CATLG,DELETE),
//         SPACE=(CYL,(10,10),RLSE),
//         DCB=*.STEP01.INPUT

In the above example, MTH.OUTPUT.FILE created with the same DCB as the MTH.INPUT.FILE from STEP01.

Scenario3 - Using DCB of INPUT ddname from MTHPROC.

//MTHPROC
//STEP02   EXEC PGM=PROG2
//INPUT    DD DSN=MTH.INPUT.FILE,DISP=SHR
//*
//STEP01   EXEC MTHPROC
//STEP03   EXEC PGM=PROG3
//STEP04   EXEC PGM=PROG4
//INPUT    DD DSN=......
//OUTPUT   DD DSN=MTH.OUTPUT.FILE, 
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,(10,10),RLSE),
//            DCB=*.MTHPROC.INPUT

In the above example, MTH.OUTPUT.FILE created with the same DCB as the MTH.INPUT.FILE from STEP02 of MTHPROC.

Scenario4 - Using DCB of INPUT ddname of STEP03 from MTHPROC.

//MTHPROC
//STEP02   EXEC PGM=PROG2
//INPUT    DD DSN=......
//OUTPUT   DD DSN=......     
//STEP03   EXEC PGM=PROG3
//INPUT    DD DSN= MTH.INPUT.FILE,DISP=SHR
//OUTPUT   DD DSN=......
//*
//STEP01   EXEC MTHPROC
//STEP03   EXEC PGM=PROG3
//STEP04   EXEC PGM=PROG4
//INPUT    DD DSN=......
//OUTPUT   DD DSN=MTH.OUTPUT.FILE,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,(10,10),RLSE),
//            DCB=*.MTHPROC.STEP03.INPUT