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
 

 

conversion of julian date

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

New User


Joined: 15 Jul 2009
Posts: 19
Location: Chennai

PostPosted: Sat Sep 12, 2009 7:20 pm    Post subject: conversion of julian date
Reply with quote

Hi,
Can i covert a date from yyyyddd format which is in s9(9) to yyyymmdd format which is in x(8) format.
Thanks
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Sat Sep 12, 2009 7:42 pm    Post subject: Reply to: conversion of julian date
Reply with quote

if You search the forums with COBOL JULIAN DATE You will find lots of useful posts
remember to click on search for all terms
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Sat Sep 12, 2009 7:50 pm    Post subject: Reply to: conversion of julian date
Reply with quote

What version/release of COBOL are you using?

If it's OS/VS COBOL or VS/COBOL II, check with your system folks and enquire whether Language Environment (LE) has been installed in the target LPAR. You would then need to use the LE equivilent Callable Date routines of the following DATE INTRINSIC FUNCTIONS.

If it's COBOL/370 (the successor to VS COBOL II) and greater, review the following (feeling generous today) -

Code:

03  WS-JULIAN-DATE PIC S9(09).
03  WS-GREG-DATE PIC 9(08).
03  WS-GREG-DATE-X REDEFINES WS-GREG-DATE PIC X(08).

MOVE 2009227 TO WS-JULIAN-DATE.
COMPUTE WS-GREG-DATE = (FUNCTION DATE-OF-INTEGER (FUNCTION INTEGER-OF-DAY (WS-JULIAN-DATE))).

After the calculation, the value of WS-GREG-DATE-X will equal '20090912'.

Bill
Back to top
View user's profile Send private message
saji123

New User


Joined: 15 Jul 2009
Posts: 19
Location: Chennai

PostPosted: Sat Sep 12, 2009 7:55 pm    Post subject:
Reply with quote

Thank you Bill,
This function is working fine
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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm


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