I would like to know what the difference between these two lines of code :-
//STEP1.SYSIN DD *
and
//STEP1.SYSIN and STEP1.SYSIN DD &SYSUID..COBOL(CBL0001),DISP=SHR
and if there are any differences.
I would like to know what the difference between these two lines of code :-
//STEP1.SYSIN DD *
and
//STEP1.SYSIN and STEP1.SYSIN DD &SYSUID..COBOL(CBL0001),DISP=SHR
and if there are any differences.
//STEP1.SYSIN DD *
Will pass the data in the lines following the statement as instream-data to the SYSIN DD e.g.
//SYSIN DD *
fred
bert
harry
Would result in the three lines being read when SYSIN is opened and read for input.
//STEP1.SYSIN DD DSN=&SYSUID..COBOL(CBL0001),DISP=SHR
Will allocate the PDS/PDSE member CBL0001 of the dataset user.COBOL (where user will be the userid (i.e. &SYSUID. resolves to the submitter's userid) of the user who submitted the job) to DD name SYSIN.
//STEP1.SYSIN
As used by both, is saying to override or add the SYSIN DD statement for the procedure step name STEP1 (the procedure itself would be defined in the preceding JCL).
The difference will be that the data read by SYSIN will be different (i.e. from a different source, it could be the same underlying data), the first will be the data that follows the JCL statement, the second will be the data held in member CBL001 (both would likely be a COBOL program).
With instream-data, the data will end if /* is coded or if a DD statement is coded or if nothing else follows(as shown above) e.g.
//STEP1.SYSIN DD *
fred
bert
harry
/*
...... more JCL here
or
//STEP1.SYSIN DD *
fred
bert
harry
//STEP1.OTHER DD .........
Instead of * DATA can be used e.g. (same result as above i.e. three lines)
//STEP1.SYSIN DD DATA
fred
bert
harry
/*
In both cases * or DATA you can specify the delimiter using DLM e.g.
//STEP1.SYSIN DD *,DLM="%%"
fred
bert
//harry
%%
( in which case the third line will be //harry)