Turning a PDS into a PS with standard tools (for email)

  • Post category:Utilities
  • Reading time:2 mins read

I recently got a question from a collegue. He wanted to transfer an entire PDS in an email to someone else. You can download all the member of the PDS with FTP, zip up all the files and transfer that. But it might be easier to use this trick.

Create a PS from in PDS by using the XMIT command. XMIT is a TSO command that you can use to transfer a dataset to another user, or system, or both.

The trick now to “zip” a PDS with XMIT is to XMIT the PDS to yourself on the same system:

xmit userid.node dsn(dataset) outdsn(outdsn)

This creates the “zipped” PS dataset, that you can send through email. If you download the file to your Mac or PC, makes sure you download it in binary mode.

The receiver can “unzip” the file into a PDS with the accompanying receive command:

RECEIVE INDSN(dataset) DSN(outdataset)

Copy members from one PDS(E) to another using the IEBCOPY utility

  • Post category:Utilities
  • Reading time:3 mins read

This JCL script shows how to copy members from one PDS library to another. 

I have retained the input file being tape in the original JCL script for nostalgic reasons only; you will unlike ever use this nowadays. As unlikely, you will be allocating the output dataset on a specific volume, so normally you could omit the VOL=SER= clause as well.

If you omit the S M= (SELECT MEMBER=) clauses, the entire content of the INDD input PDS will be copied to the OuTDD output PDS.

//STEP01   EXEC PGM=IEBCOPY                  
//SYSPRINT DD SYSOUT=*                        
//*         VOL=SER=R6868A,UNIT=CTAPE                    
//         VOL=SER=DASD1A,UNIT=SYSDA,SPACE=(9600,(240,30,20))
//SYSIN    DD *                                    
COPY INDD=INDOC,OUTDD=OUTDOC                       
S M=MEMBER1                                         
S M=MEMBER2                                        
S M=OTHERMEM                                       
S M=MEM4          

THe IEBCOPY is a simple copy utility but it has many many options, of which you will only practically use a fraction. The application above I think is the one you will use in 99% of occasions. The DFDMDdfp Utilities manual sums all the options up.