Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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 -> Mainframe COBOL
Author Message
VinayCM

New User


Joined: 06 Nov 2007
Posts: 35
Location: Chennai

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
References
ashimer

Senior Member


Joined: 13 Feb 2004
Posts: 360
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

Senior Member


Joined: 06 Jun 2008
Posts: 936
Location: Atlanta, GA

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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1