Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Is there is any inbuilt date functions in REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
purushoth_jp

New User


Joined: 12 Dec 2004
Posts: 22

PostPosted: Wed Feb 21, 2007 5:21 pm    Post subject: Is there is any inbuilt date functions in REXX
Reply with quote

Hi all,
I'm new to REXX, I want to know is there is any inbuilt date functions for date manipulations. If it is please let me know.
My requirement is to subtract 3 months from the current date and to display the result

ex.. if current date is 21-02-2007. then the result should be 21-12-2006.
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Feb 21, 2007 5:23 pm    Post subject:
Reply with quote

There is a DATE built in finction, with some options. You can manipulate dates. Please refer to the fine manual.

O.
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Wed Feb 21, 2007 7:10 pm    Post subject: Re: Is there is any inbuilt date functions in REXX
Reply with quote

You can display date functions in REXX by doing:

Code:

DATE1 = DATE('B')
SAY DATE1
DATE2 = DATE('D')
SAY DATE2
DATE3 = DATE('E')
SAY DATE3


Other date options are M, N, O, S, U, and W. Doing this will allow you to see the various formats of the dates. For example, DATE('E') is the european date and will look like 31/12/06.

The BASE date shown as DATE('B') is the numeric base date. You can convert any of the other dates to the base date (subtract 90 for 3 months) and convert the base date back to the original date.

This is done by:

Code:

CURRDT = DATE('E')                                   
/* CONVERT EUROPEAN DATE DD/MM/YY TO BASE (NUMERIC DATE) */
CURRBDTE = DATE('BASE',CURRDT,'EUROPEAN')
CURRBDTE = CURRBDTE - 90
/* CONVERT BASE DATE BACK TO EUROPEAN DATE */
NWCURRDT = DATE('EUROPEAN',CURRBDTE,'BASE')


You can also build your own date variables from your input. Just ensure they look exactly like the date function expects them to look (i.e. DD/MM/YY for european, 31 DEC 2006 for normal). They can then be converted to the base (numeric date), manipulated (like subtracting 90), and then converted back.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Wed Feb 21, 2007 7:43 pm    Post subject: Re: Is there is any inbuilt date functions in REXX
Reply with quote

I've also found, through the years, that any existing in-house written date calculation routines, when properly written, typically work as well in a REXX program as they do in a COBOL or other language program.
Back to top
View user's profile Send private message
purushoth_jp

New User


Joined: 12 Dec 2004
Posts: 22

PostPosted: Sat Feb 24, 2007 5:35 pm    Post subject: Re: Is there is any inbuilt date functions in REXX
Reply with quote

Thanks for your reply. i tried its working.. thanks icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us