IEBPTPCH print PDS members to a file in alphabetical order

3 posts / 0 new
Last post
Anonymous
IEBPTPCH print PDS members to a file in alphabetical order

I am using IEBPTPCH to "print" all members of a PDS to a file. I got this to work but the problem is that the members seem to be in a random order and not in alphabetical order. My cards are: PUNCH TYPORG=PO Are there any other parameters to get the data sorted by member name? Thanks, Dave

Offline
Joined: 08/12/2014 - 17:20
IEBPTPCH - Print all members

I have recently had to "punch" all members of a PDS to a dataset using IEBPTPCH. The members were output in a random order. When I copied the PDS to a new dataset and ran IEBPTPCH again, the members were output in member order. I did first level problem determination and then consulted with IBM level 2 regarding this anomaly. Here are my notes from this experience:

IEBPTPCH only appears to produce output of an all-member run in random order. There is an order, it’s just not documented. IEBPTPCH reads the directory of a PDS and sorts the members of the dataset by TTRC order, not in ALPHA order. To determine the output order of an all member run you need to produce an IEHLIST of the PDS directory:

DATE: 2014.224 TIME: 15.20.1
DIRECTORY INFO FOR SPECIFIED
ASYS.CSYDAM.REXX.NETVIEW.OLD
MEMBERS TTRC
CKCTTEST 0000100F
COMPLEX 0000040F ? <--First member IEBPTPCH will process
CPCDATA 00003C0F ? <--Last member IEBPTPCH will process
DM1 00000A0F
DM2 00000B0F
DM21 00000C0F
DM3 00000D0F
DM4 00000E0F
DONCOLL 0000060F ? <--Second member IEBPTPCH will process

This method is probably a holdover from the OS/360 days when PDS’s were first introduced. It significantly reduces the time it once took to process the entire dataset and sent the output to the physical printer or card punch. But it’s an anachronistic method since hardly anyone uses physical punched cards anymore. But that’s the way IBM designed IEBPTPCH so it is “working as designed”. And that’s a hard mind-set to change.

Thanks to an IBM LVL 2 person with common sense, empathy and determination, IBM has agreed to take a DOC APAR of this anomaly (OA45799). The Request For Enhancement and/or Marketing Request to change/upgrade IEBPTPCH is in the process of being conceptualized.

I have found an alternative to the IEBPTPCH unload of PDS members. This method will unload all members of a PDS in ALPHA order:
//S1 EXEC SAS,REGION=5000K,
// OPTIONS='MACRO'
//PDSIN DD DISP=SHR,DSN=input-dataset
//PSDOUT DD DSN=output-dataset,
// DISP=OLD,
// UNIT=3390,SPACE=(CYL,(50,10),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 ALPAH order separated by the IEBUPDTE control statement:
./ ADD NAME=member-name

The addition of special SAS control statements FIRST/LAST BEFORE/AFTER will signal SAS to eliminate the IEBUPDTE control statement:

//S1 EXEC SAS,REGION=5000K,
// OPTIONS='MACRO'
//PDSIN DD DISP=SHR,DSN=input-dataset
//PSDOUT DD DSN=output-dataset,
// DISP=OLD,
// UNIT=3390,SPACE=(CYL,(50,10),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

You can use all four statements or any combination of statements that works for you. There are more SAS statements to control and format printed output. My examples are for data transfer of a PDS to a sequential file.

Link for PROC SOURCE usage: http://support.sas.com/documentation/cdl/en/hosto390/61886/HTML/default/viewer.htm#a000217440.htm

Offline
Joined: 08/12/2014 - 17:20
IEBPTPCH Mystery

IEBPTPCH only appears to produce output of an all-member run in random order. There is an order, it’s just not documented. IEBPTPCH reads the directory of a PDS and sorts the members of the dataset by TTRC order, not in ALPHA order. To determine the output order of an all member run you need to produce an IEHLIST of the PDS directory:
DATE: 2014.224 TIME: 15.20.1
DIRECTORY INFO FOR SPECIFIED
ASYS.CSYDAM.REXX.NETVIEW.OLD
MEMBERS TTRC
CKCTTEST 0000100F
COMPLEX 0000040F <-- First member IEBPTPCH will process
CPCDATA 00003C0F <-- Last member IEBPTPCH will process
DM1 00000A0F
DM2 00000B0F
DM21 00000C0F
DM3 00000D0F
DM4 00000E0F
DONCOLL 0000060F <-- Second member IEBPTPCH will process

This method is probably a holdover from the OS/360 days when PDS’s were first introduced. It significantly reduces the time it once took to process the entire dataset and sent the output to the physical printer or card punch. But it’s an anachronistic method since hardly anyone uses punched cards anymore. But that’s the way IBM designed IEBPTPCH so it is “working as designed”. And that’s a hard mind-set to change.
Thanks to an IBM LVL 2 person with common sense, empathy and determination, IBM has agreed to take a DOC APAR of this anomaly (OA45799). The Request For Enhancement and/or Marketing Request to change/upgrade IEBPTPCH is in the process of being conceptualized.
I have found an alternative to the IEBPTPCH unload of PDS members. This method will unload all members of a PDS in ALPHA order:
//S1 EXEC SAS,REGION=5000K,
// OPTIONS='MACRO'
//PDSIN DD DISP=SHR,DSN=input-dataset
//PSDOUT DD DSN=output-dataset,
// DISP=OLD,
// UNIT=3390,SPACE=(CYL,(50,10),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 ALPAH order separated by the IEBUPDTE control statement:
./ ADD NAME=member-name

The addition of special SAS control statements FIRST/LAST BEFORE/AFTER will signal SAS to eliminate the IEBUPDTE control statement:

//S1 EXEC SAS,REGION=5000K,
// OPTIONS='MACRO'
//PDSIN DD DISP=SHR,DSN=input-dataset
//PSDOUT DD DSN=output-dataset,
// DISP=OLD,
// UNIT=3390,SPACE=(CYL,(50,10),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

You can use all four statements or any combination that works for you.
Link for PROC SOURCE usage: http://support.sas.com/documentation/cdl/en/hosto390/61886/HTML/default/viewer.htm#a000217440.htm

Log in or register to post comments
Sponsored Listing