View previous topic :: View next topic
|
Author |
Message |
naveen kumar b
New User
Joined: 14 Mar 2007 Posts: 3 Location: Bangalore
|
|
|
|
Input to rexx code is current date i.e USA date format(mm/dd/yy)
out put of rexx code should be yesterday's date with the same format?
Example:
Input is 03/19/07
Out put should be : 02/18/07.
Thanks,
Naveen. |
|
Back to top |
|
|
naveen kumar b
New User
Joined: 14 Mar 2007 Posts: 3 Location: Bangalore
|
|
|
|
Correction to my example:
Input : 03/19/07
Out put: 03/18/07
Thanks,
Naveen. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Look at the DATE function in the REXX manuals. There are loads of things you can do with dates there. |
|
Back to top |
|
|
naveen kumar b
New User
Joined: 14 Mar 2007 Posts: 3 Location: Bangalore
|
|
|
|
i tried to get the code to manipulate the yesterdays USA date (format) but i didnt find in any of REXX manual. please let me know how to proceed?
Thanks,
Naveen. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Use the DATE function to convert the current date to B format
Subtract 1 from B format
USe the DATE function to convert B format date to format required. |
|
Back to top |
|
|
shinu
New User
Joined: 14 Aug 2006 Posts: 3
|
|
|
|
as i m new to REXX don know tis wha u were expecting..
/*REXX*/
NUMERIC DIGITS 2
SAY "INPUT DATE:" DATE(U)
PARSE VALUE DATE(U) WITH W1 '/' W2 '/' W3
W2 = W2 - 1
SAY "OUTPUT DATE:" W1"/"W2"/"W3
EXIT
SHINU.S |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Shinu, nice try - - - but - - - what happens on the first of each month ?
DAYLESS1 = DATE('format you want',DATE(B)-1,'B') |
|
Back to top |
|
|
|