Hi,
I need to copy a load module member from one pds to another thru Rexx Pgm.
But this doesn't work.
Can U PLease Help out?
Note:I am able to do the below task manually (i.e) copy loadmodule from one PDS to another mentioned below )
Below is the code which i tried..........
/* rexx */
"Alloc Fi(SYSUT1) Da('ENDH1.B0YCL007.SBATLOAD(ABEND1)') Shr Reu"
"Alloc Fi(SYSUT2) Da('N408f0.GULF.LOADLIB(ABEND1)') Shr Reu"
"Alloc Fi(SYSPRINT) Sysout Reu"
"Alloc Fi(SYSIN) Dummy Reu"
"IEBGENER"
say 'Copy return code = 'rc
"Free Fi(SYSUT1 SYSUT2 SYSIN SYSPRINT)"
To copy a load module mem from one pds to another thru rexx
Moderators: Veera, Moderator Group
Hi Meena,
Copying Load Modules is bit tricky because of its RECFM = U, it took some time to figure out a way do it....Find below the code for what u have asked in JCL, i guess u can transalte into REXX..
We can achieve that by using 2 steps as below
//TESTLOAD JOB (AAAA,04,T,0000),'LOAD M',CLASS=K,MSGCLASS=T,
// NOTIFY=&USERID/USER..ID
//*
//*
/*JOBPARM L=9999
//*
//JOBLIB DD DSN=AAAA.PPROD.LOAD,DISP=SHR
//*
//STEP01 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=0
//INPDS DD DSN=AAAA.TEST.LOAD(ABCDEFGH), ---> Load Lib PDS Member. // DISP=SHR
//BACKUP DD DSN=AAAA.VEER.LOAD.BKUP, ---> Output File // DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(50,100),RLSE),
// DCB=(MLDSCB,BLKSIZE=0)
//SYSUT3 DD DSN=AAAA.VEER2.BKUP.TEMP,
// DISP=(,DELETE,DELETE),
// UNIT=SYSDA,
// SPACE=(50,(50,125))
//SYSIN DD *
COPY OUTDD=BACKUP,INDD=INPDS
/*
//*
//STEP02 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=0
//SYSUT1 DD DSN=AAAA.VEER.LOAD.BKUP,
// DISP=SHR,DCB=(RECFM=U,LRECL=0) -> HERE TREAT THE I/P FILE AS RECFM = U //SYSUT2 DD DSN=AAAA.VEER.LOAD.BKUP.NEW,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(100,100),RLSE)
//SYSIN DD DUMMY
/*
Where ever applicable you can change the PS TO PDS.
Meena please let us know in case you need any more info on this.
Thanks,
Veera
Copying Load Modules is bit tricky because of its RECFM = U, it took some time to figure out a way do it....Find below the code for what u have asked in JCL, i guess u can transalte into REXX..
We can achieve that by using 2 steps as below
//TESTLOAD JOB (AAAA,04,T,0000),'LOAD M',CLASS=K,MSGCLASS=T,
// NOTIFY=&USERID/USER..ID
//*
//*
/*JOBPARM L=9999
//*
//JOBLIB DD DSN=AAAA.PPROD.LOAD,DISP=SHR
//*
//STEP01 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=0
//INPDS DD DSN=AAAA.TEST.LOAD(ABCDEFGH), ---> Load Lib PDS Member. // DISP=SHR
//BACKUP DD DSN=AAAA.VEER.LOAD.BKUP, ---> Output File // DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(50,100),RLSE),
// DCB=(MLDSCB,BLKSIZE=0)
//SYSUT3 DD DSN=AAAA.VEER2.BKUP.TEMP,
// DISP=(,DELETE,DELETE),
// UNIT=SYSDA,
// SPACE=(50,(50,125))
//SYSIN DD *
COPY OUTDD=BACKUP,INDD=INPDS
/*
//*
//STEP02 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=0
//SYSUT1 DD DSN=AAAA.VEER.LOAD.BKUP,
// DISP=SHR,DCB=(RECFM=U,LRECL=0) -> HERE TREAT THE I/P FILE AS RECFM = U //SYSUT2 DD DSN=AAAA.VEER.LOAD.BKUP.NEW,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(100,100),RLSE)
//SYSIN DD DUMMY
/*
Where ever applicable you can change the PS TO PDS.
Meena please let us know in case you need any more info on this.
Thanks,
Veera
Hi,
Thanks for the Info.
Thru Jcl, I am able to do it.
Below is the Jcl code
//Jobcard
//STEP1 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SOURCEI DD DSN=ENDH1.B0YCL007.SBATLOAD,DISP=SHR
//SOURCEO DD DSN=N408F0.GULF.LOADLIB,DISP=SHR
//SYSIN DD *
COPY I=((SOURCEI,R)),O=SOURCEO
S M=ABEND1
/*
The same thing in Rexx,I am not able to make it out.
Find below the Rexx code which I tried
/* rexx */
"Alloc Fi(SYSUT1) Da('ENDH1.B0YCL007.SBATLOAD(ABEND1)') Shr Reu"
"Alloc Fi(SYSUT2) Da('N408F0.GULF.LOADLIB(ABEND1)') Shr Reu"
"Alloc Fi(SYSPRINT) Sysout Reu"
"Alloc Fi(SYSIN) DUMMY Reu"
"IEBCOPY"
/*"COPY INDD=SYSUT1,OUTDD=SYSUT2"
"S M=ABEND1" */
/*"copy OUTDD(out1) INDD(in1)"*/
say 'Copy return code = ' rc
"Free Fi(SYSUT1 SYSUT2 SYSIN SYSPRINT)"
Thanks for the Info.
Thru Jcl, I am able to do it.
Below is the Jcl code
//Jobcard
//STEP1 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SOURCEI DD DSN=ENDH1.B0YCL007.SBATLOAD,DISP=SHR
//SOURCEO DD DSN=N408F0.GULF.LOADLIB,DISP=SHR
//SYSIN DD *
COPY I=((SOURCEI,R)),O=SOURCEO
S M=ABEND1
/*
The same thing in Rexx,I am not able to make it out.
Find below the Rexx code which I tried
/* rexx */
"Alloc Fi(SYSUT1) Da('ENDH1.B0YCL007.SBATLOAD(ABEND1)') Shr Reu"
"Alloc Fi(SYSUT2) Da('N408F0.GULF.LOADLIB(ABEND1)') Shr Reu"
"Alloc Fi(SYSPRINT) Sysout Reu"
"Alloc Fi(SYSIN) DUMMY Reu"
"IEBCOPY"
/*"COPY INDD=SYSUT1,OUTDD=SYSUT2"
"S M=ABEND1" */
/*"copy OUTDD(out1) INDD(in1)"*/
say 'Copy return code = ' rc
"Free Fi(SYSUT1 SYSUT2 SYSIN SYSPRINT)"
Hi Meena,
Using IEBCOPY copy into a PS file not PDS, a PS will be created with format VS, and then use IEBGENER which wud convert the PS file
format of VS , which u need to treat it as RECFM = U, into outfile
try the out file using PS/PDS both.
I am not sure whether using only one step IEBCOPY u will be able to
achieve it. We need to use both the steps as i have given in my
sample JCL, few utilites doesnot support RECFM = U thats the
issue when we are trying to copy the LOAD modules.
Well try usign 2 utilites/steps and if this doesn work let us know wil try the same in REXX and get back to you.
Just as Info :
When u ran IEBCOPY using JCL the out pds is already preallocated
and did u check if the member got copied correctly even though the
return code is 0.
Thanks
Veera.
Using IEBCOPY copy into a PS file not PDS, a PS will be created with format VS, and then use IEBGENER which wud convert the PS file
format of VS , which u need to treat it as RECFM = U, into outfile
try the out file using PS/PDS both.
I am not sure whether using only one step IEBCOPY u will be able to
achieve it. We need to use both the steps as i have given in my
sample JCL, few utilites doesnot support RECFM = U thats the
issue when we are trying to copy the LOAD modules.
Well try usign 2 utilites/steps and if this doesn work let us know wil try the same in REXX and get back to you.
Just as Info :
When u ran IEBCOPY using JCL the out pds is already preallocated
and did u check if the member got copied correctly even though the
return code is 0.
Thanks
Veera.
Meena
I have tried some code check this...
The below are 2 seperate REXX routines
Step 1: IEBCOPY
Info : Copying the Load modules into PS file.
(Dont worry abt this file , unless u copy using the IEBGENR we may not be
able to view the file)
/**************************REXX***************************************/
"ALLOC FI(SYSUT1) DA('ABCD.TEST.LOAD') SHR REU"
ADDRESS "TSO" "ALLOC DD(SYSUT2) DS('ABCD.TEST.PSFILE') NEW" ,
"DSORG(PS) LRECL(28014) SPACE(100,200) CYLINDERS"
"ALLOC FI(SYSPRINT) SYSOUT REU"
"ALLOC FI(SYSIN) DA('ABCD.TEST.SYSIN(CARD)') SHR REU"
"IEBCOPY"
SAY 'COPY RETURN CODE = 'RC
"FREE FI(SYSUT1 SYSUT2 SYSPRINT SYSIN)"
Step 2: IEBGENER
Info : Here when i read the I/P file i enforce and read the file with RECFM = U
and finally the file gets copied into another file which we will be
able to browse, this is the final load module copied.
/**************************REXX***************************************/
"ALLOC FI(SYSUT1) DA('ABCD.TEST.PSFILE') SHR REU RECFM(U)"
ADDRESS "TSO" "ALLOC DD(SYSUT2) DS('ABCD.TEST.FINALOUT') NEW",
"DSORG(PS) SPACE(100,200) CYLINDERS"
"ALLOC FI(SYSPRINT) SYSOUT REU"
"ALLOC FI(SYSIN) DUMMY REU"
"IEBGENER"
SAY 'COPY RETURN CODE = 'RC
"FREE FI(SYSUT1 SYSUT2 SYSPRINT SYSIN)"
NOTE : I do not have knowledge on REXX i just changed it from your code
so we have to change the code here and there to use PDS and its
members instead of files..any manual shd help u do that.
When u try the code try with only one LOAD module member in
a PDS. I executed the above two REXX routines as 2 diff
routines ...so if u wish u can combine..
Thanks
Veera.
I have tried some code check this...
The below are 2 seperate REXX routines
Step 1: IEBCOPY
Info : Copying the Load modules into PS file.
(Dont worry abt this file , unless u copy using the IEBGENR we may not be
able to view the file)
/**************************REXX***************************************/
"ALLOC FI(SYSUT1) DA('ABCD.TEST.LOAD') SHR REU"
ADDRESS "TSO" "ALLOC DD(SYSUT2) DS('ABCD.TEST.PSFILE') NEW" ,
"DSORG(PS) LRECL(28014) SPACE(100,200) CYLINDERS"
"ALLOC FI(SYSPRINT) SYSOUT REU"
"ALLOC FI(SYSIN) DA('ABCD.TEST.SYSIN(CARD)') SHR REU"
"IEBCOPY"
SAY 'COPY RETURN CODE = 'RC
"FREE FI(SYSUT1 SYSUT2 SYSPRINT SYSIN)"
Step 2: IEBGENER
Info : Here when i read the I/P file i enforce and read the file with RECFM = U
and finally the file gets copied into another file which we will be
able to browse, this is the final load module copied.
/**************************REXX***************************************/
"ALLOC FI(SYSUT1) DA('ABCD.TEST.PSFILE') SHR REU RECFM(U)"
ADDRESS "TSO" "ALLOC DD(SYSUT2) DS('ABCD.TEST.FINALOUT') NEW",
"DSORG(PS) SPACE(100,200) CYLINDERS"
"ALLOC FI(SYSPRINT) SYSOUT REU"
"ALLOC FI(SYSIN) DUMMY REU"
"IEBGENER"
SAY 'COPY RETURN CODE = 'RC
"FREE FI(SYSUT1 SYSUT2 SYSPRINT SYSIN)"
NOTE : I do not have knowledge on REXX i just changed it from your code
so we have to change the code here and there to use PDS and its
members instead of files..any manual shd help u do that.
When u try the code try with only one LOAD module member in
a PDS. I executed the above two REXX routines as 2 diff
routines ...so if u wish u can combine..
Thanks
Veera.
-
- Member
- Posts: 1
- Joined: Tue Mar 13, 2018 8:50 pm
Hi Guys,
Learn about how to submit a JCL using REXX from the below mentioned website.
http://tutorialdaddy.com/rexx-tutorial/
Also learn how to do a bunch of other cool things with REXX.
Cheers!!!!!!!!!!!!!
Learn about how to submit a JCL using REXX from the below mentioned website.
http://tutorialdaddy.com/rexx-tutorial/
Also learn how to do a bunch of other cool things with REXX.
Cheers!!!!!!!!!!!!!
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page