In this example, output records are created entirely from utility
control statements. Three fields are created and used in the construction
of the output records. In two of the fields, alphabetic data is truncated;
the other field is a numeric field that is incremented (indexed) by
one after each output record is written. Figure 1 shows
the contents of the output records at the end of the job step.
Figure 1. Output Records at Job
Step Completion
72
//UTLYONLY JOB ...
//STEP1 EXEC PGM=IEBDG
//SYSPRINT DD SYSOUT=A
//SEQOUT DD DSNAME=OUTSET,UNIT=disk,DISP=(,KEEP),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),
// SPACE=(TRK,(10,10)),VOLUME=SER=111111
//SYSIN DD DATA
DSD OUTPUT=(SEQOUT)
FD NAME=FIELD1,LENGTH=30,STARTLOC=1,FORMAT=AL,ACTION=TL
FD NAME=FIELD2,LENGTH=30,STARTLOC=31,FORMAT=AL,ACTION=TR
FD NAME=FIELD3,LENGTH=10,STARTLOC=71,PICTURE=10, X
P'1234567890',INDEX=1
CREATE QUANTITY=100,NAME=(FIELD1,FIELD2,FIELD3),FILL=X'FF'
END
/*
The control statements are as follows:
- SEQOUT DD defines the test output data set. Ten tracks of primary
space and ten tracks of secondary space are allocated for the sequential
data set on a disk volume.
- SYSIN DD defines the control data set, which follows in the input
stream.
- DSD marks the beginning of a set of utility control statements
and refers to the DD statement defining the output data set.
- FD defines the contents of three fields to be used in the construction
of output records. The first field contains 30 bytes of alphabetic
data to be truncated left after each output record is written. The
second field contains 30 bytes of alphabetic data to be truncated
right after each output record is written. The third field is a 10-byte
field containing a packed decimal number (1234567890) to be increased
by one after each record is written.
- CREATE constructs 100 output records in which the contents of
previously defined fields (FIELD1, FIELD2, and FIELD3) are included.
Note that after each record is written, FIELD1 and FIELD2 are restored
to full width.
- END signals the end of a set of utility control statements.