Posted: Wed Mar 15, 2006 2:15 am Post subject: Date Compare
hi all,
I have 5 input files. each file is having a header record which contains date. date is in (mm/dd/yyyy) format.
now i have to compare this date(of each file) with yesterday's date in JCL.
Only if all 5 dates are equal to yesterday's date, then continue to execute next steps. Else should skip all the subsequent steps.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Mar 15, 2006 8:43 am Post subject:
sha,
The following JCL will give you the desired results. I assumed that your files has the header record with date as the first record and the pos of the date is at 1 in the format (mm/dd/yyyy)
The first step copies just the header from all the files and reformats the date to (YYYYMMDD) format. In the next step we use that check if it is yesterday's date and set a return code of 4 if the all the 5 dates are equal to yesterday's date. If the Reurn code is 4 then skip the other steps using COND parameter.
I don't have SYNCSORT, but does &DATE1P-1 really always resolve to the previous day's date, i.e. if &DATE1P is 20060301, then it would resolve to be 20060228?
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Mar 15, 2006 3:43 pm Post subject:
Quote:
don't have SYNCSORT, but does &DATE1P-1 really always resolve to the previous day's date, i.e. if &DATE1P is 20060301, then it would resolve to be 20060228?
superk,
yes. It considers the leap years and performs the calculation. you can subtract/add upto 9999 days
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Mar 20, 2006 8:53 am Post subject:
js01,
Check this for a detailed explanation of the error WER400A.
Code:
WER400A ddname IS AN UNINITIALIZED SEQUENTIAL DISK DATA SET
EXPLANATION: The input data set was allocated but never opened for
output. Therefore, there is no valid data or end-of-file mark in the
data set. This condition usually occurs when a program abends and
the steps to create the data are bypassed.
ACTION: Write the appropriate data or end-of-file mark in the data
set.
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