In this example, two blocks (three logical records per block) are
inserted into an existing member, and the member is placed in the
existing partitioned data set. A portion of the output member is also
renumbered.
//UPDATE JOB ...
//STEP1 EXEC PGM=IEBUPDTE,PARM=MOD
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD DSNAME=PDS,UNIT=disk,DISP=(OLD,KEEP),
// VOLUME=SER=111112
//SYSUT2 DD DSNAME=PDS,UNIT=disk,DISP=(OLD,KEEP),
// VOLUME=SER=111112
//SYSIN DD *
./ CHANGE NAME=RENUM,LIST=ALL,LEVEL=01,SOURCE=0,SEQFLD=(765,783)
./ NUMBER SEQ1=AA015,NEW1=AA020,INCR=5,INSERT=YES
(Data statement 1)
(Data statement 2)
(Data statement 3)
./ NUMBER SEQ1=AA030,INSERT=YES
(Data statement 4)
(Data statement 5)
(Data statement 6)
(Data statement 7, sequence number AA035)
/*
The control statements are as follows:
- SYSUT1 and SYSUT2 DD define the partitioned data set PDS.
- SYSIN DD defines the control data set, which follows in the input
stream.
- The CHANGE function statement identifies the input member RENUM.
The entire member is listed in the message data set.
- The NUMBER detail statements specify the insert operations (INSERT=YES)
and control the renumbering operation.
- Data statements 1, 2, 3, and 4, 5, 6 are the blocks of logical
records to be inserted. Because they contain blank sequence numbers,
sequence numbers are assigned when the data statements are inserted.
- Data statement 7, because it contains a sequence number, stops
the insert operation. The sequence number is identical to the number
on the next record in the old master data set; consequently, data
statement 7 will replace the equally numbered old master record in
the output data set.
The existing logical records in this example have sequence numbers
AA010, AA015, AA020, AA025, AA030, AA035, AA040, AA045, AA050, BB010,
and BB015. The insertion and renumbering operations are performed
as follows:
- Data statement 1 is assigned sequence number AA020 (NEW1=AA020)
and inserted after existing logical record AA015 (SEQ1=AA015).
- Data statements 2 and 3 are assigned sequence numbers AA025 and
AA030 (INCR=5) and are inserted after data statement 1.
- Existing logical records AA020, AA025, and AA030 are assigned
sequence numbers AA035, AA040, and AA045, respectively.
- Data statement 4 is assigned sequence number AA050 and inserted.
(The SEQ1=AA030 specification in the second NUMBER statement places
this data statement after existing logical record AA030, which has
become logical record AA045.)
- Data statements 5 and 6 are assigned sequence numbers AA055 and
AA060 and are inserted after data statement 4.
- Existing logical record AA035 is replaced by data statement 7,
which is assigned sequence number AA065.
- The remaining logical records in the member are renumbered until
logical record BB010 is encountered. Because this record has a sequence
number higher than the next number to be assigned, the renumbering
operation is ended.
Table 1 shows existing sequence numbers, data statements
inserted, and the new sequence numbers.
Table 1. Reordered sequence
numbersSequence Numbers and Data Statements Inserted |
New Sequence Numbers |
---|
AA010 |
AA010 |
AA015 |
AA015 |
Data statement 1 |
AA020 |
Data statement 2 |
AA025 |
Data statement 3 |
AA030 |
AA020 |
AA035 |
AA025 |
AA040 |
AA030 |
AA045 |
Data statement 4 |
AA050 |
Data statement 5 |
AA055 |
Data statement 6 |
AA060 |
AA035 (Data statement 7) |
AA065 |
AA040 |
AA070 |
AA045 |
AA070 |
AA050 |
AA075 |
BB010 |
BB010 |
BB015 |
BB015 |