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
 

 

convert date (YYMMDD) to number of days

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

New User


Joined: 26 Apr 2007
Posts: 49
Location: Delhi

PostPosted: Tue Dec 11, 2007 12:56 pm    Post subject: convert date (YYMMDD) to number of days
Reply with quote

Hi
How can I convert Date (YYMMDD) to number of days.
One way is to change it to Julian and get the number of days.
I want to know if there is a direct way of doing it.

Thanks
Back to top
View user's profile Send private message

Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Tue Dec 11, 2007 1:20 pm    Post subject: Reply to: convert date (YYMMDD) to number of days
Reply with quote

Mahua,

Refer the manuals to see whether the DATE intrinsic functions can be used for your requirement.
Back to top
View user's profile Send private message
roopannamdhari
Warnings : 1

New User


Joined: 14 Sep 2006
Posts: 71
Location: Bangalore

PostPosted: Wed Dec 19, 2007 4:55 pm    Post subject: Reply to: convert date (YYMMDD) to number of days
Reply with quote

Hi Mitra,

Here i am posting code to generate number of days for given date, but here date should be in the formate YYYYMMDD . it may help you i think

Code:
DATA DIVISION.                                         
WORKING-STORAGE SECTION.                               
                                                       
01  NUMBER-OF-DAYS            PIC 9(10).               
01  INPUT-DATE                PIC 9(8).               
                                                       
                                                       
PROCEDURE DIVISION.                                   
                                                       
PROGRAM-START.                                         
                                                       
    MOVE  "19990222"  TO INPUT-DATE.                   
    DISPLAY "INPUT-DATE==>" INPUT-DATE.               
    COMPUTE NUMBER-OF-DAYS                             
            = FUNCTION INTEGER-OF-DATE (INPUT-DATE).   
    DISPLAY "NUMBER-OF-DAYS==>" NUMBER-OF-DAYS.       
    STOP RUN.                                         
[img][/img]

Thanks,
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Dec 19, 2007 9:17 pm    Post subject:
Reply with quote

Hello,

Maybe i misunderstand the question. . .

Is the requirement to calculate the Julian date?

When a "number of days" is mentioned, it usually refers to the number of days between 2 dates. . .
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