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: 10211
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 File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts Conversion of a VB file to FB. isssal DFSORT/ICETOOL 1 Mon Oct 31, 2016 10:23 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm


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