I need to extract records having the date as today's date or yesterday's date. I can't use system date since its a requirement to use the date from a current date file. Presently am only taking records based on current date.
In the current date file, the date will be as yyyymmdd and its packed
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
prasnya wrote:
I need to extract records having the date as today's date or yesterday's date. I can't use system date since its a requirement to use the date from a current date file. Presently am only taking records based on current date. In the current date file, the date will be as yyyymmdd and its packed
I am not clear as to what you are trying to do . In your example you show a current date file. what date does it contain? i.e Does it DEC-11-2008 (which is current date here today) in YYYMMDD comp-3 format? or can it contain any date like 4-march-2007 which is a very old date.
if it contains an old date do you still need to subtract a day from it and extract the contents in second file?
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
prasanya,
change your step10 to the following. This will validate the date in the file with the current date and pick up yesterday's date.
A brief exaplanation the job.
The first IFTHEN WHEN=INIT will expand the packed decimal date to YYYYMMDD format and also pad the current date in YYYYMMDD and current date-1 and current date-2 dates in YYYYMMDD format.
Now I check the date in the file and see if it is equal to current date then I create the symbol with yesterday's date
if the date in the file is equal to yesterday's date then I create the symbol with current date-2 days.