z/OS DFSMSdfp Utilities
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Example 7: Insert Records into a Library Member

z/OS DFSMSdfp Utilities
SC23-6864-00

In this example, a block of three logical records is inserted into an existing member, and the updated member is placed in the existing partitioned data set.
  //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
  ./     NUMBER   SEQ1=15,NEW1=20,INCR=5,INSERT=YES
 
  (Data statement 1)
  (Data statement 2)
  (Data statement 3)
 
  /*
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 statement specifies the insert operation and controls the renumbering operation.
  • The data statements are the logical records to be inserted. (Sequence numbers are assigned when the data statements are inserted.)

In this example, the existing logical records have sequence numbers 10, 15, 20, 25, and 30. Sequence numbers are assigned by the NUMBER detail statement, as follows:

  1. Data statement 1 is assigned sequence number 20 (NEW1=20) and inserted after existing logical record 15 (SEQ1=15).
  2. Data statements 2 and 3 are assigned sequence numbers 25 and 30 (INCR=5) and are inserted after data statement 1.
  3. Existing logical records 20, 25, and 30 are assigned sequence numbers 35, 40, and 45, respectively.

Table 1 shows existing sequence numbers, data statements inserted, and the resultant new sequence numbers.

Table 1. Example of reordered sequence numbers
Sequence Numbers and Data Statements Inserted New Sequence Numbers
10 10
15 15
Data statement 1 20
Data statement 2 25
Data statement 3 30
20 35
25 40
30 45

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014