On Mon, 27 Oct 2008 12:55:14 -0500, Ron Thomas <[EMAIL PROTECTED]> wrote:
>Hi,
>
> I have a input file and Based on the current date(mm/dd/yy), could some
>please let me know how to get the last 7 days of data for weekly processing.
>
>Thanks,
>Ron
Very vague. What language? REXX? COBOL? DB/2 select?. With REXX, it is easy.
Suppose the date that you have is in a variable called TODAY and is of the
format: MM/DD/YY as you stated. You want to know the date 7 days ago in the
same format.
DATE7=DATE('B',TODAY,'U')-7
DATE7=DATE('U',DATE7,'B')
The first line converts the value in TODAY from MM/DD/YY to a number (base
date) and subtracts 7 from it. The second line then converts that number
(based date) to USA format.
As my Russian teacher always said: "Easy, Easy!"
Similar in COBOL. Convert from MM/DD/YY to Lilian format, which is a number,
then subtract 7 and convert back to MM/DD/YY.
--
John
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html