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
 

 

Command to convert date from julian to greg

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Command to convert date from julian to greg
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: 3158
Location: Tucson AZ

PostPosted: Tue Jan 16, 2007 8:11 am    Post subject: Re: date conversion
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    Post subject: Re: date conversion
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

Site Director


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

PostPosted: Tue Jan 16, 2007 9:53 am    Post subject:
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: 2360
Location: Israel

PostPosted: Tue Jan 16, 2007 10:03 am    Post subject:
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    Post subject:
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: 1452
Location: Chicago, IL

PostPosted: Tue Jan 16, 2007 11:22 am    Post subject: Re: Command to convert date from julian to greg
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Tue Jan 16, 2007 3:39 pm    Post subject:
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

Site Director


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

PostPosted: Tue Jan 16, 2007 9:01 pm    Post subject:
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    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 Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Customizing the ISPF HILITE Command Pedro TSO/ISPF 3 Fri Mar 03, 2017 11:49 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am


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