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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


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