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 

How to include DATE while creating new GDG version ?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
sateesh_gontla
Beginner


Joined: 23 Jan 2004
Posts: 40
Topics: 16
Location: Bangalore

PostPosted: Tue Sep 28, 2004 4:15 pm    Post subject: How to include DATE while creating new GDG version ? Reply with quote

I would like to create GDG new version like this :


HLQ.TEST.JAN2004.G00V100
HLQ.TEST.JAN2004.G00V200


Here JAN2004 is the dynamic value, that means current month & year.

Anyone know how to do this ?
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Sep 28, 2004 5:06 pm    Post subject: Reply with quote

sateesh,

Do not post the same topic in more than 1 forum. I have deleted your duplicate post in tso forum. You have a weird way of creating the GDG versions. I am not going to ask you the reasons for creating a GDG version like that, but the following DFSORT JCl will give you the desired results.

A brief description of the job. we generate a dynamic jcl and submit it as a new job via intrdr.

We get the system date in ccyymmdd format using DATE1 on inrec parm. once we get the date we change the month to spell out the month using a change command on outrec. Now we use another outrec on outfil to generate a dynamic JCL.

Change your Sortout to the following , once you verified the job being created.
Code:

//SORTOUT   DD SYSOUT=(*,INTRDR)                                       



Code:

//STEP0100 EXEC PGM=SORT                                               
//SYSOUT    DD SYSOUT=*                                               
//SORTIN    DD *                                                       
DUMMY RECORD                                                           
//SORTOUT   DD SYSOUT=*                                       
//SYSIN     DD *                                                       
  SORT FIELDS=COPY                             
  INREC FIELDS=(DATE1)                         
  OUTREC FIELDS=(1,4,5,2,CHANGE=(3,C'01',C'JAN',
                               C'02',C'FEB',   
                               C'03',C'MAR',   
                               C'04',C'APR',   
                               C'05',C'MAY',   
                               C'06',C'JUN',   
                               C'07',C'JUL',   
                               C'08',C'AUG',   
                               C'09',C'SEP',   
                               C'10',C'OCT',   
                               C'11',C'NOV',   
                               C'12',C'DEC'),   
                               NOMATCH=(C'MON'))
  OUTFIL OUTREC=(C'//USERIDZ JOB ',X'7D',C'CREATE DSN',X'7D',         
                 C',CLASS=A,',/,                                       
                 C'//',13X,C'MSGCLASS=Y,MSGLEVEL=(1,1),',/,           
                 C'//',13X,C'NOTIFY=&SYSUID',/,                       
                 C'//*',/,                                             
                 C'//STEP0100 EXEC PGM=IEFBR14',/,                     
                 C'//*',/,                                             
                 C'//FILE1    DD DSN=HLQ.TEST.',                       
                 5,3,1,4,                                             
                 C'.G00V100,',/,                                       
                 C'//            DISP=(NEW,CATLG,DELETE),',/,         
                 C'//            SPACE=(CYL,(X,Y),RLSE),',/,         
                 C'//            DCB=(LRECL=ZZZ,RECFM=FB,BLKSIZE=0)',/,
                 C'//*',/,                                             
                 C'//FILE2    DD DSN=HLQ.TEST.',                       
                 5,3,1,4,                                             
                 C'.G00V200,',/,                                       
                 C'//            DISP=(NEW,CATLG,DELETE),',/,         
                 C'//            SPACE=(CYL,(X,Y),RLSE),',/,         
                 C'//            DCB=(LRECL=ZZZ,RECFM=FB,BLKSIZE=0)',/,
                 C'//*',80:X)                                         
                                                                       
/*                                                 


The output from this job is as follows:

Code:

//USERIDZ JOB 'CREATE DSN',CLASS=A,                         
//             MSGCLASS=Y,MSGLEVEL=(1,1),                   
//             NOTIFY=&SYSUID                               
//*                                                         
//STEP0100 EXEC PGM=IEFBR14                                 
//*                                                         
//FILE1    DD DSN=HLQ.TEST.SEP2004.G00V100,                 
//            DISP=(NEW,CATLG,DELETE),                       
//            SPACE=(CYL,(X,Y),RLSE),                     
//            DCB=(LRECL=ZZZ,RECFM=FB,BLKSIZE=0)             
//*                                                         
//FILE2    DD DSN=HLQ.TEST.SEP2004.G00V200,                 
//            DISP=(NEW,CATLG,DELETE),                       
//            SPACE=(CYL,(X,Y),RLSE),                     
//            DCB=(LRECL=ZZZ,RECFM=FB,BLKSIZE=0)             
//*                                                         


change the space and lrecl parms to your requirements.



Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) 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