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
 

 

Can we get current date from any db2 table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
rups

New User


Joined: 19 Jan 2006
Posts: 17
Location: bangalore

PostPosted: Mon Jun 04, 2007 10:53 am    Post subject: Can we get current date from any db2 table
Reply with quote

hi,

can we get current date from any db2 table.

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

mahi

New User


Joined: 04 Apr 2006
Posts: 86
Location: Pune

PostPosted: Mon Jun 04, 2007 12:07 pm    Post subject:
Reply with quote

yes we cam get it.. As per my knowledge from SYSIBM.SYSDUMMY1 we can get it....
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Mon Jun 04, 2007 4:33 pm    Post subject:
Reply with quote

'SELECT CURRENT DATE FROM SYSIBM.SYSDUMMY1 INTO :WS-CURRENT-DATE ' would get you the current date into the working storage variable WS-CURRENT-DATE
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Jun 04, 2007 5:14 pm    Post subject:
Reply with quote

prasadvrk wrote:
'SELECT CURRENT DATE FROM SYSIBM.SYSDUMMY1 INTO :WS-CURRENT-DATE ' would get you the current date into the working storage variable WS-CURRENT-DATE

Code:
EXEC SQL
SET :WS-CURRENT-DATE = CURRENT DATE
END-EXEC.


Will also work.
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: Mon Jun 04, 2007 8:32 pm    Post subject:
Reply with quote

Hello,

I'm probably missing something here.

Is there some reason to interface with db2 to get a value already locally available from the system?

If you need to adjust the date, using db2 works nicly, but to just obtain the current date? Not sure i understand icon_confused.gif
Back to top
View user's profile Send private message
vardhan0007

New User


Joined: 05 Jun 2006
Posts: 51
Location: Bangalore,India

PostPosted: Wed Aug 08, 2007 3:24 pm    Post subject: How to format dates
Reply with quote

Hi,

I want to foramt date from 'yyyy-mm-dd' to either 'mmyydd' or 'ddmmyy'
or to julian date. CAn someone assist me onthis how to format the date.

Thanks in advance

Harsha.
Back to top
View user's profile Send private message
Prajesh_v_p

Active User


Joined: 24 May 2006
Posts: 133
Location: India

PostPosted: Wed Aug 08, 2007 5:55 pm    Post subject:
Reply with quote

Basically current date refers to special register for getting the date....and hence it does not depend on the table.. the reason why we we are using sysdummy is that, it is having only one row always..

if you do select current date from a table having N rows..it will give N records with current date..

As dick said, you can get away with a db call just for current date..
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Aug 08, 2007 6:02 pm    Post subject: Re: How to format dates
Reply with quote

vardhan0007 wrote:
Hi,

I want to foramt date from 'yyyy-mm-dd' to either 'mmyydd' or 'ddmmyy'
or to julian date. CAn someone assist me onthis how to format the date.

Thanks in advance

Harsha.


You ask the same question under another topic.
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 -> DB2 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 How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am


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