MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sql for getting the julian date

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
Meena
Beginner


Joined: 03 Aug 2004
Posts: 20
Topics: 15

PostPosted: Fri Aug 20, 2004 2:06 am    Post subject: Sql for getting the julian date Reply with quote

Can i get the julian date of current date , iam not mentioning the date got using the JULIAN_DAY function.
I know we can use the INTEGER-OF-DATE and INTEGER-OF-DAY functions in cobol , but i need the retreive the same in a select query while executing in spufi.
Can anyone help me??
Thanks
Meena
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri Aug 20, 2004 5:42 am    Post subject: Reply with quote

Meena,

There are many number of ways of getting the desired results.

try these

Code:

SELECT CAST( YEAR(CURRENT DATE) * 1000                     
             + DAYOFYEAR(CURRENT DATE) AS CHAR(7))         
FROM SYSIBM.SYSDUMMY1                                     
;                                                         


This will produce

Code:

2004233


Code:

SELECT SUBSTR(CHAR(YEAR(CURRENT DATE)),3,2) CONCAT
       SUBSTR(CHAR(DAYOFYEAR(CURRENT DATE)),1,3)   
  FROM SYSIBM.SYSDUMMY1                           
  ;                                               


This will produce

Code:

04233


Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group