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
 
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 COB2 file processing rizwanaccy COBOL Programming 8 Tue Jan 02, 2018 1:00 pm
No new posts Skip records depends on count lakshmiibmmainframes DFSORT/ICETOOL 5 Sun Dec 24, 2017 9:51 pm
No new posts Compare two PS files using ICE TOOL f... SENTHIL MURUGAAN DFSORT/ICETOOL 5 Sun Dec 24, 2017 1:26 pm
No new posts KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am
No new posts Preserve order in Input File pshongal DFSORT/ICETOOL 13 Thu Dec 21, 2017 4:20 pm

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