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
 
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 Compare yesterday's date to the one o... migusd SYNCSORT 11 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 Profile changed to NUMBER ON STD (fro... Martylin TSO/ISPF 1 Thu Aug 03, 2017 9:14 am

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