Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Getting Mutiple input from Panels vidyaa CLIST & REXX 12 Mon Aug 14, 2017 1:28 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us