In this example, binary zeros are placed in two fields of 100 records
copied from a sequential data set. After the operation, each record
in the copied data set (OUTSET) contains binary zeros in locations
20 through 29 and 50 through 59.
//CLEAROUT JOB ...
//STEP1 EXEC PGM=IEBDG
//SYSPRINT DD SYSOUT=A
//SEQIN DD DSNAME=INSET,UNIT=tape,DISP=(OLD,KEEP),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),
// LABEL=(,NL),VOLUME=SER=222222
//SEQOUT DD DSNAME=OUTSET,UNIT=tape,DISP=(,KEEP),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),
// VOLUME=SER=222333,LABEL=(,NL)
//SYSIN DD *
DSD OUTPUT=(SEQOUT),INPUT=(SEQIN)
FD NAME=FIELD1,LENGTH=10,STARTLOC=20
FD NAME=FIELD2,LENGTH=10,STARTLOC=50
CREATE QUANTITY=100,INPUT=SEQIN,NAME=(FIELD1,FIELD2)
END
/*
The control statements are as follows:
- SEQIN DD defines a sequential input data set (INSET). The data
set was originally written on a unlabeled tape volume.
- SEQOUT DD defines the test data set (OUTSET). The output records
are identical to the input records, except for locations 20 through
29 and 50 through 59, which contain binary zeros at the completion
of the operation.
- 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 statements defining the input and output data
sets.
- The first and second FD statements create two 10-byte fields (FIELD1
and FIELD2). Because no pattern is specified for these fields, each
field contains the default fill of binary zeros. The fields are to
begin in the 20th and 50th bytes of each output record.
- CREATE constructs 100 output records in which the contents of
previously defined fields (FIELD1, FIELD2) are placed in their respective
starting locations in each of the output records. Input records from
data set INSET are used as the basis of the output records.
- END signals the end of a set of utility control statements.