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

Command to convert date from julian to greg


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
poobalen

New User


Joined: 17 May 2006
Posts: 18
Location: malaysia

PostPosted: Tue Jan 16, 2007 7:37 am
Reply with quote

hi,

Is there any command to convert date from julian to greg and
form greg to julian.

Thank you for the help
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Jan 16, 2007 8:11 am
Reply with quote

poobalen wrote:
Is there any command to convert date from julian to greg and
form greg to julian.
By gerg i assume you mean Gregorian?
Yes, but name the language you are expecting to get the answer in??????
Back to top
View user's profile Send private message
poobalen

New User


Joined: 17 May 2006
Posts: 18
Location: malaysia

PostPosted: Tue Jan 16, 2007 9:10 am
Reply with quote

yes it is gregorian date,,,
but i dun understand what you mean by the language

for example
if i key in 2007030
i want the system to return me in gregorian date
ddmmyyyy

is there any command for this ...or
do i need to use utility for this

Thanks for the help.....
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jan 16, 2007 9:53 am
Reply with quote

Hello,

I believe Bill's question refers to what programming language are you coding with (COBOL, REXX, CLIST, Assembler, etc).
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jan 16, 2007 10:03 am
Reply with quote

I found the following example in Google Groups:
Code:
/* REXX */                                       
                                                 
ARG JULDATE                                       
                                                 
SAY GREGORIAN(JULDATE)                           
                                                 
EXIT                                             
                                                 
GREGORIAN: PROCEDURE                             
YYYY=LEFT(ARG(1),LENGTH(ARG(1))-3)               
DDD=RIGHT(ARG(1),3)                               
T=(YYYY//4=0)                                     
DD=DDD; IF DD>(59+T) THEN DD=DD+2-T               
MM=((DD+91)*100)%3055                             
DD=DD+91-(MM*3055)%100                           
RETURN YYYY'/'RIGHT(MM-2,2,'0')'/'RIGHT(DD,2,'0')


You can put this REXX in your SYSEXEC library, and it will act as any TSO command.

O.
Back to top
View user's profile Send private message
poobalen

New User


Joined: 17 May 2006
Posts: 18
Location: malaysia

PostPosted: Tue Jan 16, 2007 11:18 am
Reply with quote

hi, im coding in cobol language..

thanks
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Tue Jan 16, 2007 11:22 am
Reply with quote

Quote:
hi, im coding in cobol language..

Then what prompted you to post the question in TSO/ISPF section... icon_mad.gif

look at these intrinsic function to accomplish the same... and get back if any problem...
DATE-OF-INTEGER
INTEGER-OF-DAY
Back to top
View user's profile Send private message
poobalen

New User


Joined: 17 May 2006
Posts: 18
Location: malaysia

PostPosted: Tue Jan 16, 2007 11:52 am
Reply with quote

hi

i'm sorry to confuse everyone
actually i'm not writing a program to get
this done.

In my previous place if i type command
'tso julian ' or 'tso date'.
I will get screen to key in the dates and
when i enter i will get the answer.

But at my current place they dont have this
function, thats why i want to know other
command to do this.

Sorry once again for the mistake.

Thanks
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Jan 16, 2007 3:39 pm
Reply with quote

Isn't julian yyddd?
Haven't downloaded the LE manual yet, isn't there an LE function for this?
Code:
j2g: yyddd > mmddyy = date of integer (integer of date (12/31/(yy-1)) + ddd)
g2j: mmddyy > yyddd = yy(date of integer (integer of date (mmddyy) - integer of date (12/31/(yy-1)))
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jan 16, 2007 9:01 pm
Reply with quote

Hello,

Please don't worry about the "mistake" - we just didn't completely understand what was asked for.

For future questions, i suggest mentioning that you had a tso funtion and at your new site it is not there. If there is a coding question, it is always a good to post it in the forum for that language (unless there is no forum for the language involved icon_wink.gif )

Now that we know what the question was, you were in the correct forum.
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 RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
Search our Forums:

Back to Top