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
 

 

adding 5 more days to dates(records) in file

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

New User


Joined: 29 Jul 2005
Posts: 23

PostPosted: Thu Mar 16, 2006 12:00 pm    Post subject: adding 5 more days to dates(records) in file
Reply with quote

hi


i have a file ,in that some records having DATES(eg:28-02-2006).so here my requirement is to add 5 more days to the all date records.
plz provide some solution for this..

solution IN COBOL i need.
bye
Back to top
View user's profile Send private message

parul

New User


Joined: 08 Apr 2005
Posts: 11
Location: mumbai

PostPosted: Thu Mar 16, 2006 3:10 pm    Post subject: Re: adding 5 more days to dates(records) in file
Reply with quote

Hi...
There are some date functions in cobol like: DATE-OF-INTEGER....INTEGER -OF-DATE..u can always try out that. Just do a QW in mainframe and try out. hopefully you get the answer.


Thanks, Parul
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Mar 17, 2006 11:41 am    Post subject:
Reply with quote

HI ,

You have to use first INTEGER-OF-DATE function to convert that Gregorian dates to INTEGER then add 5 to that integer & then use DATE-Of-INTEGER to Returns Gregorian date for the integer passed.

Hope it will be helpful
Back to top
View user's profile Send private message
akepatis

New User


Joined: 30 Jun 2005
Posts: 2

PostPosted: Fri Mar 17, 2006 12:02 pm    Post subject:
Reply with quote

hi ravi

try like this (this is example)

since December 31, 1600. Then 30 is added to this number and it is
converted back to the year-month-day form.

01 INT-DATE PIC 9(8) VALUE ZERO.
01 DATE-TODAY PIC 9(8) VALUE ZERO.
01 DUE-DATE PIC 9(8) VALUE ZERO.
:
MOVE 19910220 TO DATE-TODAY.
COMPUTE INT-DATE = FUNCTION INTEGER-OF-DATE (DATE-TODAY).
DISPLAY DATE-TODAY.
DISPLAY INT-DATE.

ADD 30 TO INT-DATE.
COMPUTE DUE-DATE = FUNCTION DATE-OF-INTEGER (INT-DATE).
DISPLAY INT-DATE.
DISPLAY DUE-DATE.

The above example displays the following values. The first two lines
represent the date February 20, 1991 and the last two lines represent
March 22, 1991, 30 days later:

19910220
00142484
00142514
19910322
Back to top
View user's profile Send private message
ravikumarreddy
Warnings : 1

New User


Joined: 29 Jul 2005
Posts: 23

PostPosted: Fri Mar 17, 2006 3:06 pm    Post subject: thanks for good answer
Reply with quote

hi ,

thanks for quick reply.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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