The output of IEBPTPCH, for an all-member run, might appear in random order. Though there is an order. IEBPTPCH will read the directory of a PDS and sorts the members of it by TTRC order (Relative Track Number) and not in alphabetical order. To determine the output order of an all member run you need to produce an IEHLIST of the PDS directory:
Code: Select all
//IEHLIST JOB ACCT,'LIST PDS',MSGCLASS=A,CLASS=B
Code: Select all
//STEP0001 EXEC PGM=IEHLIST
//SYSPRINT DD SYSOUT=*
//PDS1 DD DSN=your.pds.name,DISP=OLD
//SYSIN DD *
LISTPDS DSNAME=your.pds.name,FORMAT
/*
A sample of partail output is shown below:
Code: Select all
MEMBERS TTRC
TESTMEM1 0000100F
TESTMEM2 0000040F <-- First member IEBPTPCH will process
TESTMEM3 00003C0F <-- Last member IEBPTPCH will process
TESTMEM4 00000A0F
TESTMEM5 00000B0F
TESTMEM6 00000C0F
TESTMEM7 00000D0F
TESTMEM8 00000E0F
TESTMEM1 0000060F <-- Second member IEBPTPCH will process
Some search over the internet and it looks like that this method is probably a holdover from the OS/360 days when PDS’s
were first introduced. This actually reduces the time, to a great extent, to process the entire dataset and send the output
to the physical printer or card punch. But it’s a non-practical method in today's world when no one uses punched cards anymore.
Look at this APAR,
OA45799, which addresses the follwoing problem:
IEBPTPCH currently does not specify the order in which it will print or punch members of a PDS or PDSE. When MEMBER control statements are not used (the entire PDS/PDSE is printed/punched), the members are processed in TTR order. When MEMBER control statements are used, the members are processed in the order in which the members are specified.
There is another method apart from what Enrico has suggested:
Code: Select all
// OPTIONS='MACRO'
//PDSIN DD DISP=SHR,DSN=your.pds.name
//PSDOUT DD DSN=output-dataset,
// DISP=OLD,
// UNIT=SYSDA,SPACE=(CYL,(10,20),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSIN DD *,DLM=ZZ
PROC SOURCE
INDD=PDSIN
OUTDD=PSDOUT
NOPRINT
NULL;
RUN;
ZZ
The members are unloaded in alphabetical order separated by the IEBUPDTE control statement:
You can use the follwoing SAS control statements to eliminate the IEBUPDTE control statement:
Code: Select all
//S1 EXEC SAS
// OPTIONS='MACRO'
//PDSIN DD DISP=SHR,DSN=your.pds.name
//PSDOUT DD DSN=output-dataset,
// DISP=OLD,
// UNIT=SYSDA,SPACE=(CYL,(10,20),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSIN DD *,DLM=ZZ
PROC SOURCE
INDD=PDSIN
OUTDD=PSDOUT
NOPRINT
NULL;
FIRST '%%%%%% START of entire dataset %%%%%%';
BEFORE'%%%%%% START OF NEW MEMBER %%%%%%';
AFTER '%%%%%% END OF MEMBER %%%%%%';
LAST '%%%%%% END entire dataset %%%%%%';
RUN;
ZZ