REXX- How to get tomorrow's date



IBM's Command List programming language & Restructured Extended Executor

REXX- How to get tomorrow's date

Postby sarathmohan » Sat Aug 22, 2015 4:52 pm

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
sarathmohan
 
Posts: 3
Joined: Fri Aug 21, 2015 9:23 pm
Has thanked: 0 time
Been thanked: 0 time

Re: REXX- How to get tomorrow's date

Postby Akatsukami » Sat Aug 22, 2015 5:09 pm

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.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: REXX- How to get tomorrow's date

Postby sarathmohan » Sat Aug 22, 2015 5:25 pm

I am getting this:

C = DATE() + 1
SAY C

6 +++ C = DATE() + 1
IRX0041I Error running SARREX, line 6: Bad arithmetic conversion
***
sarathmohan
 
Posts: 3
Joined: Fri Aug 21, 2015 9:23 pm
Has thanked: 0 time
Been thanked: 0 time

Re: REXX- How to get tomorrow's date

Postby NicC » Sat Aug 22, 2015 5:31 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: REXX- How to get tomorrow's date

Postby Blackthorn » Tue Aug 25, 2015 1:44 pm

Date() defaults to the "normal" date, i.e.; dd mon yyyy, not the base date.
Blackthorn
 
Posts: 130
Joined: Tue Feb 01, 2011 7:12 pm
Has thanked: 1 time
Been thanked: 9 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post