View previous topic :: View next topic
|
Author |
Message |
Mahua Mitra
New User
Joined: 26 Apr 2007 Posts: 49 Location: Delhi
|
|
|
|
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 |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Mahua,
Refer the manuals to see whether the DATE intrinsic functions can be used for your requirement. |
|
Back to top |
|
|
roopannamdhari Warnings : 1 New User
Joined: 14 Sep 2006 Posts: 71 Location: Bangalore
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|