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
 

 

i want to subtract 45 days from the input date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: i want to subtract 45 days from the input date EZT
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: 8593
Location: Back in jolly old England

PostPosted: Wed May 28, 2008 4:22 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: Easytrieve - how to get julian date from system th
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    Post subject: Re: Reply to: Easytrieve - how to get julian date from syste
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


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