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
 
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: 10375
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: 2504
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 Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Conversion of UTF-8 to EBCDIC muralikrishnan_new COBOL Programming 1 Tue Nov 21, 2017 5:33 pm
No new posts Mainframe Blocks to Tracks conversion upendrasri JCL & VSAM 1 Sat Nov 18, 2017 10:52 am
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

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