Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to get current date by spufi?

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

New User


Joined: 19 Nov 2005
Posts: 26
Location: Shanghai, China

PostPosted: Fri Dec 12, 2008 7:03 pm    Post subject: How to get current date by spufi?
Reply with quote

Hi,

Can any person tell me how to get current date by spufi?

Thank you.

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

sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Fri Dec 12, 2008 7:13 pm    Post subject:
Reply with quote

Hi LUBAN,

This can help you
Code:
SELECT CURRENT DATE FROM SYSIBM.SYSDUMMY1; 


Sushanth
Back to top
View user's profile Send private message
luban

New User


Joined: 19 Nov 2005
Posts: 26
Location: Shanghai, China

PostPosted: Fri Dec 12, 2008 8:22 pm    Post subject:
Reply with quote

Hi Sushanth,

Actually, I need to run a job every day, to get data of previous day.
So the spufi will be like:

SELECT MY_DATA FROM MY_TABLE
WHERE
MY_DATA = previous date (YYYYMMDD);

How can I get previous date ( I think current - 1 ) in form YYYYMMDD?

Anyone can help?

Thank you.

Ban
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: Fri Dec 12, 2008 10:23 pm    Post subject:
Reply with quote

Hello,

Are weekends and holidays the handled same as "regular" days or is there some consideration for these that is not the same?
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Mon Dec 15, 2008 10:44 am    Post subject:
Reply with quote

Luban,

If you want just the previous day date, you can use this query.
Code:
SELECT  ( CURRENT DATE - 1 DAY ) AS YESTERDAY
      , ( CURRENT DATE ) AS TODAY             
  FROM  SYSIBM.SYSDUMMY1                     
;                                             


Code:
previous date (YYYYMMDD);


Since you put it in this way, are you looking for BUSINESS previous day. If that so, you must write a function or procedure to get that, taking into consideration with things like festival holiday, bank holiday, country holiday and more holidays like that. You are looking for an year calender.

Sushanth
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 Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts Comparision with current time arunsoods DFSORT/ICETOOL 5 Thu Nov 09, 2017 10:37 am
This topic is locked: you cannot edit posts or make replies. Comparing current time with the time ... arunsoods SYNCSORT 1 Mon Oct 30, 2017 4:07 pm
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us