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=*                        
//*INDOC     DD DISP=SHR,DSN=SYS1.ST006868.DOCLIB,LABEL=(06,SL),
//*         VOL=SER=R6868A,UNIT=CTAPE                    
//INDOC     DD DISP=SHR,DSN=YOUR.INPUT.LIBRARY
//OUTDOC     DD DISP=(NEW,CATLG,DELETE),DSN=YOUR.OUTPUT.PDSLIB, 
//         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.

How to authenticate to the z/OSMF API with a certificate

  • Post category:z/OSMF
  • Reading time:2 mins read

This is a brief description of how to use the z/OSMF API with certificate authentication, from a PHP application.

Create a certificate.For example with openSSL:

openssl req -newkey rsa:2048 -nodes -keyout yourdomain.key
 -out yourdomain.csr

Send the certificate to a certificate authority to get it signed.

Add the signed certificate to RACF:

RACDCERT CHECKCERT(CERT)RACDCERT ADD(CERT) TRUST WITHLABEL('yourlabel-client-ssl') ID(your RACF userID) SETROPTS REFRESH RACLIST(DIGTCERT, DIGTRING)

When authentication, the userID in the ID field will be mapped to, and the z/OSMF tasks will run under this userID.

Save the signed certificate on the PHP server in a directory accessible for the PHP server.
The following PHP code will then issue a request with client certificate authentication: 

curl_setopt($curl, CURLOPT_SSLCERT, '/<server>/htdocs/<somesubdir>yourdomain.csr');
curl_setopt($curl, CURLOPT_SSLCERTTYPE, 'PEM');
curl_setopt($curl, CURLOPT_VERBOSE, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
// this is the basic auth commented out: 'authorization: Basic ' . base64_encode($this->userid . ":" . $this->password),
etc for the reast of the header

Compile and run a COBOL program on z/OS – A mini-tutorial

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

With this mini-tutorial you may get a quick start with COBOL on z/OS. It gives you a handson overview of the process to get a COBOL program running on z/OS.

The tutorial will show you how to create a Hello World COBOL program on z/OS, compile it and then run in. You can find the program itseld and the JCL scripts for the compilation and run attached below to this post.

The following video describes the process

The following assets are used in this mini-tutorial.

The Hello World COBOL program

COBPROG

The JCL to compile the program

COBCOMP

The JCL to run the program

COBPROGJ

/* Niek de Greef