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
 

 

How to get yesterdays date by writing a rexx code?

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

New User


Joined: 14 Mar 2007
Posts: 3
Location: Bangalore

PostPosted: Mon Mar 19, 2007 3:52 pm    Post subject: How to get yesterdays date by writing a rexx code?
Reply with quote

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
View user's profile Send private message

naveen kumar b

New User


Joined: 14 Mar 2007
Posts: 3
Location: Bangalore

PostPosted: Mon Mar 19, 2007 3:55 pm    Post subject: Re: How to get yesterdays date by writing a rexx code?
Reply with quote

Correction to my example:
Input : 03/19/07
Out put: 03/18/07

Thanks,
Naveen.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Mar 19, 2007 3:56 pm    Post subject:
Reply with quote

Look at the DATE function in the REXX manuals. There are loads of things you can do with dates there.
Back to top
View user's profile Send private message
naveen kumar b

New User


Joined: 14 Mar 2007
Posts: 3
Location: Bangalore

PostPosted: Fri Mar 23, 2007 11:31 am    Post subject: Re: How to get yesterdays date by writing a rexx code?
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Mar 23, 2007 1:54 pm    Post subject:
Reply with quote

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
View user's profile Send private message
shinu

New User


Joined: 14 Aug 2006
Posts: 3

PostPosted: Mon Mar 26, 2007 5:22 pm    Post subject: I think tis can be done by this way..
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Mar 26, 2007 5:32 pm    Post subject:
Reply with quote

Shinu, nice try - - - but - - - what happens on the first of each month ?

DAYLESS1 = DATE('format you want',DATE(B)-1,'B')
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 JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 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 IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm


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