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 

Setting Dates in JCL

 
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
MFBaba
Beginner


Joined: 24 Nov 2004
Posts: 8
Topics: 4

PostPosted: Tue Jun 02, 2009 3:17 pm    Post subject: Setting Dates in JCL Reply with quote

Hi,

I have a job with multiple programs. These programs ACCEPT the System Date and execute based on that date.

Is there a way I can manipulate the System Date in the JCL so that all programs triggered by that JCL use the manipulated System Date.

eg. If I want to test the job today (2nd June 2009) and check what the output of the job would have looked like on 31st May 2009, then is it possible to achieve this by setting the Date to 31 May 2009 in the JCL.

Currently I modify all programs invoked by the job and hardcode the Date to whatever date I require and run the job, which is taking a lot of manual effort.

Thanks!
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Jun 02, 2009 4:07 pm    Post subject: Reply with quote

MFBaba,

You can create the date file using sort which would let you add/sub days from the current date. Here are a couple of ways of doing it

Code:

//STEP0100 EXEC PGM=SORT   
//SYSOUT   DD SYSOUT=*     
//SORTIN   DD *             
A                           
//SORTOUT  DD SYSOUT=*     
//SYSIN    DD *             
  SORT FIELDS=COPY         
  INREC BUILD=(DATE1-2,80:X)
/*


will give you current date - 2 days which is 20090531. If you want to always pick the last sunday date irrespective of the day of the week then use this

Code:

//STEP0100 EXEC PGM=SORT                                     
//SYMNAMES DD *                                               
WKDAY,S'&LWDAY'                                               
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD *                                               
A                                                             
//SORTOUT  DD SYSOUT=*                                       
//SYSIN    DD *                                               
  SORT FIELDS=COPY                                           
  INREC IFTHEN=(WHEN=INIT,BUILD=(1:WKDAY,80:X)),             
        IFTHEN=(WHEN=(1,3,CH,EQ,C'SUN'),OVERLAY=(1:DATE1-0)),
        IFTHEN=(WHEN=(1,3,CH,EQ,C'MON'),OVERLAY=(1:DATE1-1)),
        IFTHEN=(WHEN=(1,3,CH,EQ,C'TUE'),OVERLAY=(1:DATE1-2)),
        IFTHEN=(WHEN=(1,3,CH,EQ,C'WED'),OVERLAY=(1:DATE1-3)),
        IFTHEN=(WHEN=(1,3,CH,EQ,C'THU'),OVERLAY=(1:DATE1-4)),
        IFTHEN=(WHEN=(1,3,CH,EQ,C'FRI'),OVERLAY=(1:DATE1-5)),
        IFTHEN=(WHEN=(1,3,CH,EQ,C'SAT'),OVERLAY=(1:DATE1-6)) 
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Tue Jun 02, 2009 4:15 pm    Post subject: Reply with quote

Of course that doesn't remove the requirement to change the pgms to read an external date rather than ACCEPT the system date.

There are products you can purchase (TICTOC, etc) to intercept date calls and return a given date without pgm modification. Widely used to prepare for Y2K.
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Tue Jun 02, 2009 7:26 pm    Post subject: Reply with quote

For only a few programs, you could modify the code to get the date from a PARM on the EXEC statement. The PARM can be a symbolic parameter easily changed for each run. What you would have liked is the //DATE JCL statement in VSE. Smile
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
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