Page 1 of 1

Getting the previous date.

PostPosted: Sat Jul 06, 2013 3:16 pm
by harpy_125
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?

Re: Getting the previous date.

PostPosted: Sat Jul 06, 2013 3:37 pm
by NicC
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.

Re: Getting the previous date.

PostPosted: Sat Jul 06, 2013 6:01 pm
by BillyBoyo
Talk to your scheduler people.

Re: Getting the previous date.

PostPosted: Sat Jul 06, 2013 7:06 pm
by harpy_125
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.

Re: Getting the previous date.

PostPosted: Sat Jul 06, 2013 7:10 pm
by harpy_125
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.

Re: Getting the previous date.

PostPosted: Sat Jul 06, 2013 11:51 pm
by dick scherrer
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.