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 convert no of days since 1900 to date in mm/dd/yyyy.

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

New User


Joined: 06 Nov 2007
Posts: 36
Location: Bengaluru

PostPosted: Tue Jul 22, 2008 8:40 pm    Post subject: How to convert no of days since 1900 to date in mm/dd/yyyy.
Reply with quote

In input file i have no of days like 39624 which is equal to 06/26/2008.
I am in search of the code which can convert it in COBOL.
Ex: 39625 is = 06/27/2008.
Back to top
View user's profile Send private message

ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Tue Jul 22, 2008 9:03 pm    Post subject:
Reply with quote

How do you conclude that 39624 is equal to 06/26/2008 ?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Jul 22, 2008 9:12 pm    Post subject:
Reply with quote

Code:
01  WS-DATA-FIELDS.
    05  WS-1899                PIC 9(07) VALUE 0.
    05  WS-CURRENT             PIC 9(07) VALUE 39625.
    05  WS-CURRDATE            PIC 9(07) VALUE 0.
    05  WS-CURR-FULL           PIC 9(08) VALUE 0.

PROCEDURE DIVISION.

     COMPUTE WS-1899 =  FUNCTION INTEGER-OF-DATE (18991231).
     COMPUTE WS-CURRDATE = WS-1899 + WS-CURRENT.
     COMPUTE WS-CURR-FULL =
         FUNCTION DATE-OF-INTEGER (WS-CURRDATE) .
     DISPLAY WS-CURR-FULL .
displays 20080627 as output.
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 Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
No new posts Checking Current date vickey_dw DFSORT/ICETOOL 1 Wed Feb 08, 2017 11:14 pm


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