Getting the previous date.



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

Getting the previous date.

Postby harpy_125 » Sat Jul 06, 2013 3:16 pm

Hi,

i have a back up job that uses a symbolic. and this symbolic is for the julian date of the dataset also the system when running the jobs does not use any job scheduler.

below is the code.
// SET DATE=13123                                     
//STEP10  EXEC PGM=SORT,REGION=1024K                   
//SYSOUT    DD SYSOUT=*                               
//SORTIN    DD DSN=AKCF21.SAMPLE.FILE.D&DATE,DISP=SHR 
//SORTOUT   DD DSN=AKCF21.SAMPLE.FILE.D&DATE..BKUP,   
//            DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,     
//            SPACE=(CYL,(1,4),RLSE),                 
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)       
//SYSIN     DD *                                       
   SORT FIELDS=COPY                                   
/*                                                     


would there be a way on how to get the previous date and set it as a value of the symbolic DATE? I think the proper word for it is, would there be a way on creating an automated job wherein i don't need to change the DATE value on everytime i executed my job?
harpy_125
 
Posts: 3
Joined: Sat Jul 06, 2013 3:06 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Getting the previous date.

 

Re: Getting the previous date.

Postby NicC » Sat Jul 06, 2013 3:37 pm

previous date to which date? If today is monday do you want sunday's date for example? Any programming language can do what you want but JCL is not a programming language and cannot do what you want.
It may be a bore to do the updat manually but it would take less time over a year than it would to write and test the code.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Getting the previous date.

Postby BillyBoyo » Sat Jul 06, 2013 6:01 pm

Talk to your scheduler people.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Getting the previous date.

Postby harpy_125 » Sat Jul 06, 2013 7:06 pm

NicC wrote:previous date to which date? If today is monday do you want sunday's date for example? Any programming language can do what you want but JCL is not a programming language and cannot do what you want.
It may be a bore to do the updat manually but it would take less time over a year than it would to write and test the code.


Thanks NicC that is also what i think, that JCL can't do to get the previous date without Manually changing the Variable before executing the job. anyway i am not familiar with REXX but can REXX possibly help me with getting the previous Date and then inside that REXX it could do a backup process?

Previous Date is like a business day before. like if today is Monday, then the previous day i am looking is the Date of Friday.
harpy_125
 
Posts: 3
Joined: Sat Jul 06, 2013 3:06 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Getting the previous date.

Postby harpy_125 » Sat Jul 06, 2013 7:10 pm

BillyBoyo wrote:Talk to your scheduler people.



The scheduler people are too lazy enough to Manually change the value of variable DATE. that's why i am thinking if there is a possible way to get the previous date without Manually changing the date and without telling the scheduler people to adjust the DATE.
harpy_125
 
Posts: 3
Joined: Sat Jul 06, 2013 3:06 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Getting the previous date.

Postby dick scherrer » Sat Jul 06, 2013 11:51 pm

Hello and welcome o the forum,

The scheduler people are too lazy enough to Manually change the value of variable DATE.
One of the biggest causes of errors is manually changing things for every execution. . . .

Many systems have implemented some sort of "calendar" service routine. This can be used to determine last business day. Find out if your environment has something to accomplish this.It is fairly easy to figure out which day it is. It is not as easy to detemine holidays which iw why many systems have a calendar function.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post