SYSIN and in-stream data allow you to include input data directly within your JCL job stream. This is particularly useful for providing control statements, commands, or small amounts of data to programs without requiring separate external data sets.
123456//ddname DD * data line 1 data line 2 ... data line n /*
123456//ddname DD DATA data line 1 data line 2 ... data line n /*
123456//ddname DD *,DLM=XX data line 1 data line 2 ... data line n XX
Feature | DD * | DD DATA |
---|---|---|
JCL Statements | Treats //-prefixed lines as JCL statements (not data) | Treats all lines as data (including //-prefixed lines) |
Usage | Most common form - use when data doesn't contain JCL-like statements | Use when data might contain lines that start with // |
Example Use Case | General program input data | Script data or control statements that might contain JCL-like syntax |
While any DD name can be used for in-stream data, many IBM utilities and programs expect their primary input on a DD statement named SYSIN. This is a convention, not a requirement. Always check the program documentation for the expected DD name.
DD *,DLM=XX
uses XX as the delimiter instead of /*You can override the default DCB attributes for in-stream data if needed:
123//INDATA DD *,DCB=(RECFM=FB,LRECL=80,BLKSIZE=800) data records /*
123456789//STEP1 EXEC PGM=IDCAMS //SYSIN DD * DELETE USER.FILE1 SET MAXCC=0 DEFINE CLUSTER (NAME(USER.FILE2) - VOLUMES(DISK01) - RECORDSIZE(80 80) - TRACKS(10 5)) /*
Providing IDCAMS utility commands via in-stream data
123456//STEP1 EXEC PGM=MYPROG //SYSIN DD * 1001,JOHN,SMITH,ACCOUNTING,50000 1002,JANE,DOE,MARKETING,55000 1003,ROBERT,JONES,SALES,52000 /*
Providing simple data records to a program
123456789//STEP1 EXEC PGM=SORT //SORTIN DD DSN=INPUT.FILE,DISP=SHR //SORTOUT DD DSN=OUTPUT.FILE,DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(5,2)),UNIT=SYSDA //SYSIN DD * SORT FIELDS=(1,5,CH,A,20,10,CH,D) INCLUDE COND=(30,2,CH,EQ,C'NY') OUTFIL OUTREC=(1,20,30,15) /*
Providing sort control statements to DFSORT
12345678910111213//STEP1 EXEC PGM=IKJEFT01 //SYSTSIN DD * DSN SYSTEM(DB2P) RUN PROGRAM(DSNTEP2) PLAN(DSNTEP12) - LIB('DSN1210.RUNLIB.LOAD') END /* //SYSIN DD * SELECT EMPNO, FIRSTNAME, LASTNAME, JOB_TITLE FROM EMPLOYEE WHERE DEPT = 'MARKETING' ORDER BY LASTNAME; /*
Running SQL statements through the DB2 batch interface
123456789//STEP1 EXEC PGM=ADRDSSU //SYSPRINT DD SYSOUT=* //SYSIN DD *,DLM=## DUMP DATASET(INCLUDE(USER.DATA./*)) - OUTDDNAME(TAPE) - COMPRESS ## //TAPE DD DSN=BACKUP.DATA,DISP=(NEW,CATLG,DELETE), // UNIT=TAPE
Using a custom delimiter (##) because the data contains /* characters
1234567//STEP1 EXEC PGM=MYPROG //SYSIN DD * First set of data /* // DD * Second set of data /*
Concatenating multiple in-stream data sets - the program will see all data as a single stream
123456//STEP1 EXEC PGM=MYPROG //SYSIN DD DATA This data contains lines that look like JCL: //DUMMY JOB This would be treated as JCL with DD * But with DD DATA, it's treated as regular data /*