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: 7931
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 How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am


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