IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

conversion of julian date


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Sep 12, 2009 7:42 pm
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Sat Sep 12, 2009 7:50 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top