Change system date



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Change system date

Postby gracemanoj » Sun Sep 20, 2009 4:39 pm

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
gracemanoj
 
Posts: 7
Joined: Mon Aug 31, 2009 11:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Change system date

Postby dick scherrer » Mon Sep 21, 2009 2:40 am

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).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Change system date

Postby Anuj Dhawan » Tue Sep 22, 2009 5:34 pm

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.
Anuj
Anuj Dhawan
 
Posts: 273
Joined: Mon Feb 25, 2008 3:53 am
Location: Mumbai, India
Has thanked: 6 times
Been thanked: 4 times

Re: Change system date

Postby upendra_water » Mon Dec 28, 2009 3:48 pm

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=*
//*                   
upendra_water
 
Posts: 33
Joined: Wed Nov 25, 2009 10:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Change system date

Postby enrico-sorichetti » Mon Dec 28, 2009 5:05 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Change system date

Postby upendra_water » Tue Dec 29, 2009 10:52 am

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.
upendra_water
 
Posts: 33
Joined: Wed Nov 25, 2009 10:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Change system date

Postby enrico-sorichetti » Tue Dec 29, 2009 11:54 am

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 ;)
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post