MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
chandra Beginner Joined: 26 Sep 2003 Posts: 130 Topics: 36
Posted: Tue Jul 07, 2009 11:02 am Post subject: Copy GDG generations (if generations present else ignore)
Hi All,
I have a following step to copy all GDG generations. It is working fine when GDG generations are present but it is failing with JCL Error when there is no generation.
Can you please let me know how to handle this.
Code: //STEP010 EXEC PGM=IEBGENER
//SYSUT1 DD DSN=GDG.RXX.LIST,DISP=SHR
//SYSUT2 DD DSN=TEST.DELETE,
// DISP=(NEW,CATLG,DELETE),SPACE=(TRK,(1,1)),
// DCB=(LRECL=121,RECFM=FB),
// UNIT=SYSDA
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD DUMMY
_________________ Regards,
Chandra
Back to top
superk Advanced Joined: 19 Dec 2002 Posts: 684 Topics: 5
Posted: Tue Jul 07, 2009 11:56 am Post subject:
Run IDCAMS LISTCAT for the base first. Then check the output for the existing generations (yes or no) and take the appropriate action.
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Tue Jul 07, 2009 12:25 pm Post subject:
chandra ,
Try this . If there is atleast 1 gdg version the job will copy it to output or else it will skip with a return code of 12.
Code:
//STEP0100 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//OUT DD DSN=TEST.DELETE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(1,1),RLSE),
// DCB=(LRECL=121,RECFM=FB,BLKSIZE=0)
//SYSIN DD *
PRINT IDS('GDG.RXX.LIST') COUNT(0)
IF LASTCC = 0 THEN DO
REPRO IDS('GDG.RXX.LIST') OUTFILE(OUT)
END
/*
_________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
chandra Beginner Joined: 26 Sep 2003 Posts: 130 Topics: 36
Posted: Tue Jul 07, 2009 2:47 pm Post subject:
Hi Kolusu and Superk thank you very much for your help..
Kolusu, It is working fine. _________________ Regards,
Chandra
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum