Page 1 of 1

Change system date

PostPosted: Sun Sep 20, 2009 4:39 pm
by gracemanoj
Hi
How to change/override system date in my JCL ? I should override the date such that the programs invoked in my job should consider my overriden date as the system date

Your help is greatly appreciated

Regards
Grace

Re: Change system date

PostPosted: Mon Sep 21, 2009 2:40 am
by dick scherrer
Hello,

Suggest you talk with your system support people to see if anything is available to do this on your system. There are several products that provide this capability, but each is licensed by a different vendor. Some systems have one or more of these, and many have none.

They were quite popular when y2k testing was a crisis, but not so much lately.

One thing you might do (if there is no such tool available) is to change the code to accept a parm. If the parm is provided, use this as the data, otherwise use the system date. This would not necessarily work for various database processing that uses the timestamp data type (db2 or otherwise). If there is any database activity in these processes, suggest you talk with the appropriate dba(s).

Re: Change system date

PostPosted: Tue Sep 22, 2009 5:34 pm
by Anuj Dhawan
I believe a rephrase of question is needed. Changing system date for an application (every pplication) is too risky. What kind of date manipulation does your "application" expect? What "next" decision do you take once you get the "system date"? May be, SORT date techniques can help you better but unless you rephrase your question.

Re: Change system date

PostPosted: Mon Dec 28, 2009 3:48 pm
by upendra_water
Please check if the HOURGLAS utility is available in your shop.
Your requirement can be fulfilled with HOURGLAS utiliy.
If it is available, Go to your job.
Type HGDD on command line and type A (After) or B (Before) line command in the step where you want to alter system date and time.
It will take you to a panel wherein you can fill required details regarding date and time.
The system date and/or time will be overriden for that particular step.

For example in below JCL system date/time will get overriden for step02 only and for step03 it will not get overriden.

Contents of file XJNDSP.UPEN.STEP02.OUT are 2008-12-03-03.56.29 (You can set it to whatever valid date/time you wish)
Contents of file XJNDSP.UPEN.STEP03.OUT are 2009-12-28-02.56.29

Hope this helps!

//MYJOB001 JOB (@),'SAMPLE-JOB',                   
//         CLASS=0,MSGCLASS=X,TIME=1,NOTIFY=&SYSUID
//*
//STEP01 EXEC UCC11RMS
//*                                               
//STEP02 EXEC PGM=SORT                             
//*                                               
//HGP0100  DD DUMMY    HOURGLASS TIME             
//HG108338 DD DUMMY    HOURGLASS DATE OF 2008-12-03
//*
//SORTIN DD DSN=XJNDSP.UPEN.TESTFILE.IN,DISP=SHR   
//*                                               
//SORTOUT  DD DSN=XJNDSP.UPEN.STEP02.OUT,         
//         DISP=(NEW,CATLG,DELETE),               
//         UNIT=SYSDA                             
//*                                               
//SYSIN DD *                                       
  SORT FIELDS=COPY,STOPAFT=1                       
  OUTREC FIELDS=(1:DATE4)                         
/*                                                 
//SYSPRINT DD SYSOUT=*                         
//SYSOUT DD SYSOUT=*                           
//SYSABEND DD SYSOUT=*                         
//SYSUDUMP DD SYSOUT=*                         
//*                                             
//STEP03 EXEC PGM=SORT                         
//*                                             
//SORTIN DD DSN=XJNDSP.UPEN.TESTFILE.IN,DISP=SHR
//*                                             
//SORTOUT  DD DSN=XJNDSP.UPEN.STEP03.OUT,       
//         DISP=(NEW,CATLG,DELETE),             
//         UNIT=SYSDA                           
//*                                             
//SYSIN DD *                                   
  SORT FIELDS=COPY,STOPAFT=1                   
  OUTREC FIELDS=(1:DATE4)                       
/*                                             
//SYSPRINT DD SYSOUT=*                         
//SYSOUT DD SYSOUT=*                           
//SYSABEND DD SYSOUT=*                         
//SYSUDUMP DD SYSOUT=*
//*                   

Re: Change system date

PostPosted: Mon Dec 28, 2009 5:05 pm
by enrico-sorichetti
did anybody in Your organization meditate on the auditing issues
running an application with the date and time changed under the covers
in a strictly audited environment ( financial mostly ) as a law infringment
with legal issues for all the management up to the highest levels

- having the date passed as a parameter is documented in the application requirements
- changing the date outside the application control is ... not

Re: Change system date

PostPosted: Tue Dec 29, 2009 10:52 am
by upendra_water
Of course we do focus on auditing and security issues.
The above utility is available in Test region only so that you can test your job/program behaviour for a particular day.
This utility is not allowed or even not available in Production region.
Hope this clears your doubts.

Re: Change system date

PostPosted: Tue Dec 29, 2009 11:54 am
by enrico-sorichetti
my reply was addressed to the TS ( topic starter )
too often people focus only on the technical issue, losing the organizational perspective
and the original question was just following that road ;)