I found this on the web and it appears to work but you can bypass the first job 
by running as a Started Task:

//ABAB77V1 JOB (0400,PT,PES),'KIRAN',CLASS=C,MSGCLASS=X,              
//         MSGLEVEL=(1,1),NOTIFY=ABAB77,REGION=0008192K              
//STEP0100 EXEC PGM=EZACFSM1                                          
//SYSOUT    DD SYSOUT=(*,INTRDR)                                      
//SYSIN     DD DATA,DLM=@@                                            
//ABAB77V2 JOB (0400,PT,PES),                                        
//             'VIJAY',                                              
//             CLASS=C,                                              
//             MSGCLASS=X,                                            
//             NOTIFY=&SYSUID                                        
//STEPK1   EXEC PGM=IEBGENER                                          
//SYSPRINT DD SYSOUT=*                                                
//SYSUT1   DD DSN=ABAB.TX.SND.SQUS0001.SI,DISP=SHR                    
//SYSUT2   DD DSN=ABAB.TX.SND.SQUS0001.SI.D&LYYMMDD..T&LHHMMSS,      
//            DISP=(NEW,CATLG,DELETE),                                
//            SPACE=(CYL,(2,2),RLSE),                  
//            DCB=(LRECL=890,RECFM=FB)                  
//SYSIN   DD  DUMMY                                    
@@  

For the Started Task all you need is:

//STEPK1   EXEC PGM=IEBGENER                                          
//SYSPRINT DD SYSOUT=*                                                
//SYSUT1   DD DSN=ABAB.TX.SND.SQUS0001.SI,DISP=SHR                    
//SYSUT2   DD DSN=ABAB.TX.SND.SQUS0001.SI.D&LYYMMDD..T&LHHMMSS,      
//            DISP=(NEW,CATLG,DELETE),                                
//            SPACE=(CYL,(2,2),RLSE),                  
//            DCB=(LRECL=890,RECFM=FB)                  
//SYSIN   DD  DUMMY                                    

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of 
Mosley, George
Sent: Tuesday, July 12, 2011 1:28 PM
To: [email protected]
Subject: JCL Question

Hello All.

We're trying to set up a batch job that will append a datestamp to a dataset 
name.
For example:

//S0     EXEC PGM=EMCSRDF
//SYSPRINT DD DSN=STRG.SRDF.INVTRKS.JUL09.@1408,
//            STORCLAS=BASE,MGMTCLAS=MEDIUM,
//            DISP=(,CATLG),
//            SPACE=(TRK,(15,15),RLSE),
//            DCB=(RECFM=FBA,LRECL=133,BLKSIZE=0)
//SYSIN    DD *
EMC-SQ VOL,44FA,INV_TRKS
/*  

When we run this job, we hard code JUL09.@1408 to the end of the SYSPRINT 
dataset name.
Is there a way to have the JCL automatically add the datestamp?

George (ICBC)
------------------------------------------------------------
This email and any attachments are intended only for the named recipient and 
may contain confidential and/or privileged material.
Any unauthorized copying, dissemination or other use by a person other than the 
named recipient of this communication is prohibited.
 If you received this in error or are not named as a recipient, please notify 
the sender and destroy all copies of this email immediately.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
[email protected] with the message: GET IBM-MAIN INFO Search the archives at 
http://bama.ua.edu/archives/ibm-main.html
This e-mail may contain confidential or privileged information. If
you think you have received this e-mail in error, please advise the
sender by reply e-mail and then delete this e-mail immediately.
Thank you. Aetna   

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to