IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to get yesterdays date by writing a rexx code?


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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
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: 8797
Location: Welsh Wales

PostPosted: Mon Mar 19, 2007 3:56 pm
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
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: 8797
Location: Welsh Wales

PostPosted: Fri Mar 23, 2007 1:54 pm
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
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: 8797
Location: Welsh Wales

PostPosted: Mon Mar 26, 2007 5:32 pm
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 All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts REXX to get all Dataset names from a ... CLIST & REXX 5
No new posts Sorting date into YYYYMMDD, and creat... DFSORT/ICETOOL 13
No new posts IBM IMU Utility for Easytrieve Code t... IBM Tools 0
No new posts Instream REXX? JCL & VSAM 13
No new posts CEMT using Rexx? Help please CLIST & REXX 3
Search our Forums:


Back to Top