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

i want to subtract 45 days from the input date


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Shanmugavel

New User


Joined: 15 Dec 2006
Posts: 7
Location: CHENNAI

PostPosted: Wed May 28, 2008 3:04 pm
Reply with quote

i want to subtract 45 days from the input date(which is present in the input PS) using easytrieve
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8798
Location: Welsh Wales

PostPosted: Wed May 28, 2008 4:22 pm
Reply with quote

Well, here's the REXX code
Code:

DAYS = 7
DATEOUT = DATE('S',DATE('B',DATE('J'),'J')-DAYS,'B')     
TDAT = DATE('D',DATEOUT,'S')                               
JDAT = RIGHT(SUBSTR(DATEOUT,1,4),4,'0')!!RIGHT(TDAT,3,'0')

Which returns yyyyddd using either the system date as shown above, or can be easily modified to accept any date or format.

Works for leap years too .............. icon_biggrin.gif
Back to top
View user's profile Send private message
lcmontanez

New User


Joined: 19 Jun 2007
Posts: 50
Location: Chicago

PostPosted: Thu May 29, 2008 2:53 am
Reply with quote

Do you have access to DATECONV?
Back to top
View user's profile Send private message
anandinmainframe

Active User


Joined: 31 May 2007
Posts: 171
Location: India

PostPosted: Thu May 29, 2008 4:11 pm
Reply with quote

Hi,
First seperate the input date as WS-MM WS-DD WS-YYYY in the input record.
now declare a new variable as WS-Date and compute that as
WS-Date = WS-DD - 45.
I hope this will work.
Back to top
View user's profile Send private message
lcmontanez

New User


Joined: 19 Jun 2007
Posts: 50
Location: Chicago

PostPosted: Thu May 29, 2008 7:36 pm
Reply with quote

anandinmainframe wrote:

now declare a new variable as WS-Date and compute that as
WS-Date = WS-DD - 45.


Did you account for the month/year changing?
Back to top
View user's profile Send private message
Shanmugavel

New User


Joined: 15 Dec 2006
Posts: 7
Location: CHENNAI

PostPosted: Thu May 29, 2008 9:23 pm
Reply with quote

date CONV and papl date function are not working
and also the month and year are taken in to account

But i tried using DATE2000 it works fine.
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 -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Sorting date into YYYYMMDD, and creat... DFSORT/ICETOOL 13
No new posts Structured Data and Nested Loops via ... COBOL Programming 0
No new posts Setting RC using NULLOFL/NOTMTOFL for... SYNCSORT 6
No new posts Sort card to know that creation date ... DFSORT/ICETOOL 10
No new posts Help with SORT - I need to validate d... DFSORT/ICETOOL 11
Search our Forums:


Back to Top