Example: Using JCL to copy from a PDS to the file system
To copy a load module out of a partitioned data set and into the
file system, you have to use the binder to flatten the load module.
Here is an example of JCL our friend TURBO wrote for copying a z/OS XL C/C++ load module into
the file system:
//TURBO JOB (XX,YY,ZZ),MSGCLASS=H,CLASS=A,
// MSGLEVEL=(1,1)
//*
//LKED EXEC PGM=IEWBLINK,REGION=500K,
// PARM='LIST,REUS,RENT,NCAL,LET,MAP,CASE=MIXED'
//SYSPRINT DD SYSOUT=*
//INLIB DD DSN=TURBO.POSIX.LOADLIB,DISP=SHR
//*
//SYSLMOD DD PATH='/u/turbo/llib/payrll'
//*
//SYSLIN DD *
INCLUDE INLIB(PAYRLL)
ENTRY CEESTART
/*
This
job relinks, or rebinds, the load module PAYRLL from TURBO.POSIX.LOADLIB(PAYRLL),
and puts the output into the file system as /u/turbo/llib/payrll.
Be sure you specify the correct entry point—in this case, CEESTART—for
a z/OS XL C/C++ program. If you
do not specify the entry point, the entry point is assumed to be at
the beginning of the load module.If the file does not exist you must specify the PATHOPTS and PATHMODE parameters on the DD statement in order to create the file with the appropriate permissions. If the file already exists but you do not have the appropriate file permissions, either the permissions or your access privileges will have to be changed.