Page 1 of 1

REXX- How to get tomorrow's date

PostPosted: Sat Aug 22, 2015 4:52 pm
by sarathmohan
Hello all,

I want to compare today's date in mm/dd/yyyy with tomorrow's date.
In IBM supplied Z/os RExx syntax,only these are available,

DATE() -> '20 Nov 2001'
DATE(,'20020609','S') -> '9 Jun 2002'
DATE('B') -> '730808'
DATE('B','25 Sep 2001') -> '730752'
DATE('C') -> '690'
DATE('E') -> '20/11/01'
DATE('J') -> '01324'
DATE('M') -> 'November'
DATE('N') -> '20 Nov 2001'
DATE('N','1438','C') -> '8 Dec 2003'
DATE('O') -> '01/11/20'
DATE('S') -> '20011120'
DATE('U') -> '11/20/01'
DATE('U','25 May 2001') -> '05/25/01'
DATE('U','25 MAY 2001') -> ERROR,month not in mixed case
DATE('W') -> 'Tuesday'

Can anyone tell me how to get tomorrow's date

Re: REXX- How to get tomorrow's date

PostPosted: Sat Aug 22, 2015 5:09 pm
by Akatsukami
As the material you quote shows, the Rexx DATE function can be used to convert dates from one format to another. Therefore, get today as a base date, add one, and convert to whatever format you desire.

Re: REXX- How to get tomorrow's date

PostPosted: Sat Aug 22, 2015 5:25 pm
by sarathmohan
I am getting this:

C = DATE() + 1
SAY C

6 +++ C = DATE() + 1
IRX0041I Error running SARREX, line 6: Bad arithmetic conversion
***

Re: REXX- How to get tomorrow's date

PostPosted: Sat Aug 22, 2015 5:31 pm
by NicC
Why do you not read Akatsumi's reply and understand it?
Step 1: Get the base date
Step 2: Add 1 to that value
Step 3: Call date again providing the updated base date and the date format that will get all the values you require. If you are in luck that will be one of the standard conversions, if not...
Step 4: Use one of the Rexx BIFs to transform the returned value into the foramt that you require.

Re: REXX- How to get tomorrow's date

PostPosted: Tue Aug 25, 2015 1:44 pm
by Blackthorn
Date() defaults to the "normal" date, i.e.; dd mon yyyy, not the base date.