Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 4648
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 Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us