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 add 90 days to a Timestamp field coming from I/P file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sandeep.tikoo

New User


Joined: 07 Oct 2006
Posts: 6
Location: Bangalore

PostPosted: Fri Nov 13, 2009 12:44 am    Post subject: How to add 90 days to a Timestamp field coming from I/P file
Reply with quote

I have a requirement in Cobol Pgm

How to add 90 days to a Timestamp field coming from I/P file
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8002
Location: Bellevue, IA

PostPosted: Fri Nov 13, 2009 12:50 am    Post subject:
Reply with quote

I just searched the COBOL Language Reference manual (link at the top of the page), and there were NO hits for "timestamp". Since the field type has to be a COBOL format, why don't you give us more details -- such as the precise PICTURE clause for the data field since we know it will not be "PIC TIMESTAMP" -- and we can provide some help.

DB2 has a format for "timestamp". SMF has a different format for "timestamp". I'm sure there are others -- so "timestamp" does not even have a standard format.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Fri Nov 13, 2009 12:50 am    Post subject: Reply to: How to add 90 days to a Timestamp field coming fro
Reply with quote

extract the date part from the timestamp and ..
perform the proper computations
rebuild the timestamp!


look at the CEEDAYS and CEEDATE LE callable functions
CEEDAYS will convert a date to an absolute number
CEEDATE will convert back to a date
the logic... ( only the logic )
new_date = CEEDATE(CEEDAYS(old_date)+90)
look at the manuals for the exact syntax

here is a link to a sample
http://www-01.ibm.com/support/docview.wss?uid=nas1b5974feb06cc159a862565c2007d14f9
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Nov 13, 2009 1:56 am    Post subject: Reply to: How to add 90 days to a Timestamp field coming fro
Reply with quote

After you post your timestamp format, review COBOL INTRINSIC FUNCTIONS. The minimum version/release must be COBOL/370. If you really mean a datestamp, the format can be YYYYMMDD (Gregorian) or YYYYDDD (Julian).

If you are running COBOL2 or even OS/VS COBOL ( icon_eek.gif ), then Language Environment must have been installed in your LPAR. If this is true, then follow Enrico's advice.

The LE Callable Service routines will return you a "Feedback Code", which indicates success/failure of the CALL.

Unfortunately, INTRINSIC DATE FUNCTIONS expect the passed-date to be valid. Otherwise, for invalid passed-dates, you'll crash and burn....

Bill
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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