Inline data in JCL refers to the practice of including input data directly within the JCL source code, rather than referencing an external dataset. This approach eliminates the need for maintaining separate input files for simple processing tasks, making your JCL more self-contained and easier to maintain.
Inline data is particularly useful for testing, small processing tasks, or when you need to ensure that specific input data is always available with the JCL regardless of the environment in which it runs.
The most common way to include inline data is using the DD *
syntax:
12345678//jobname JOB parameters //stepname EXEC PGM=program //SYSIN DD * data line 1 data line 2 data line 3 /* //
The data is included directly after the DD * statement and terminated by a /* delimiter.
An alternative approach is using DD DATA
, which allows JCL symbols to be resolved within the data stream:
12345678//jobname JOB parameters //stepname EXEC PGM=program //SYSIN DD DATA data line 1 with &SYMBOL data line 2 data line 3 /* //
With DD DATA, JCL symbols (like &SYMBOL) are resolved before the data is passed to the program. With DD *, symbols are passed unresolved.
You can specify a custom delimiter using the DLM parameter:
12345678//jobname JOB parameters //stepname EXEC PGM=program //SYSIN DD *,DLM=AA data line 1 data line 2 data line 3 AA //
Here, "AA" is used as the delimiter instead of the default "/*".
Inline data is treated as a sequential dataset. You can specify record format parameters using the DCB parameter on the DD statement.
1234//SYSIN DD *,DCB=(RECFM=FB,LRECL=80,BLKSIZE=800) data line 1 data line 2 /*
This specifies fixed-length, blocked records with a logical record length of 80 bytes.
If DCB parameters are not specified, the following defaults are typically used:
Using inline data to provide sort control statements:
12345678910//SORT JOB (ACCT),'SORT JOB',CLASS=A //STEP1 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD DSN=INPUT.DATA,DISP=SHR //SORTOUT DD DSN=OUTPUT.DATA,DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(5,2)),DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920) //SYSIN DD * SORT FIELDS=(1,10,CH,A,11,5,PD,D) INCLUDE COND=(21,2,CH,EQ,C'NY') /*
Using inline data for DB2 utility control statements:
1234567//DB2UTIL JOB (ACCT),'DB2 UTILITY',CLASS=A //STEP1 EXEC PGM=DSNUTILB,PARM='DB2P,UNLOAD' //SYSOUT DD SYSOUT=* //SYSIN DD * UNLOAD TABLESPACE DB2P.TSNAME FROM TABLE SCHEMA.TABLENAME /*
Using IEBGENER to create a test file from inline data:
1234567891011//TESTDATA JOB (ACCT),'CREATE TEST DATA',CLASS=A //STEP1 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSIN DD DUMMY //SYSUT1 DD * Record 1 - Customer Information Record 2 - Order #12345 Record 3 - Ship Date: 2023-05-15 /* //SYSUT2 DD DSN=TEST.DATA,DISP=(NEW,CATLG,DELETE), // SPACE=(TRK,(1,1)),DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
Using inline data for IDCAMS control statements:
1234567891011121314//IDCAMS JOB (ACCT),'IDCAMS JOB',CLASS=A //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DELETE MY.VSAM.FILE CLUSTER PURGE IF LASTCC <= 8 THEN DO DEFINE CLUSTER (NAME(MY.VSAM.FILE) - CYLINDERS(10 5) - KEYS(15 0) - RECORDSIZE(100 100) - INDEXED - SHAREOPTIONS(2 3)) END /*
To include special JCL characters in your inline data, you need to double them:
12345//STEP1 EXEC PGM=PROGRAM //SYSIN DD * This line contains a single quote '' within the data This line contains an ampersand && symbol /*
Single quotes are doubled (''), and ampersands are doubled (&&) to ensure they're treated as literal characters.
You can include multiple inline data sections in a single job:
12345678910//STEP1 EXEC PGM=PROGRAM //INPUT1 DD * data for input 1 /* //INPUT2 DD * data for input 2 /* //INPUT3 DD * data for input 3 /*
You can concatenate inline data with existing data sets:
12345//STEP1 EXEC PGM=PROGRAM //INPUT DD DSN=EXISTING.DATA.SET,DISP=SHR // DD * additional inline data /*
This concatenates the inline data after the contents of EXISTING.DATA.SET.
For extremely large inline data, you can use a parameter with the INCLUDE statement:
1234//STEP1 EXEC PGM=PROGRAM //SYSIN DD *,INCLUDE=MEMBER /* //MEMBER DD DSN=MY.PDS(INDATA),DISP=SHR
This technique allows you to include data from a partitioned dataset member as if it were inline data.
Write JCL that uses IEBGENER to copy inline data to a new dataset called YOUR.NAME.DATA. Include at least 5 lines of text data.
Create JCL that uses a custom delimiter (XX) for inline data. Include data that contains the /* characters to demonstrate why a custom delimiter might be necessary.
Write JCL that uses IDCAMS with inline control statements to list the catalog entries for datasets that start with YOUR.NAME.
Parameters that control data set characteristics
How sequential files are structured and processed
Different ways to format and organize data records
Symbolic variables used in JCL procedures
Built-in programs for data manipulation
1. Which DD statement parameter indicates the start of inline data?
2. What indicates the end of inline data in JCL?
3. Which of the following is NOT a valid way to include inline data in JCL?
4. When using DD DATA instead of DD *, what is the main difference?
5. What is the advantage of using DLM parameter with inline data?