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
 
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: 8154
Location: East Dubuque, Illinois, USA

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 Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm

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