MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Copy GDG generations (if generations present else ignore)

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
chandra
Beginner


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Tue Jul 07, 2009 11:02 am    Post subject: Copy GDG generations (if generations present else ignore) Reply with quote

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
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Tue Jul 07, 2009 11:56 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Jul 07, 2009 12:25 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
chandra
Beginner


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Tue Jul 07, 2009 2:47 pm    Post subject: Reply with quote

Hi Kolusu and Superk thank you very much for your help..

Kolusu, It is working fine.
_________________
Regards,
Chandra
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group