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 

To override CURRENT DATE

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


Joined: 17 Jan 2006
Posts: 26
Topics: 13

PostPosted: Mon Feb 28, 2011 9:13 am    Post subject: To override CURRENT DATE Reply with quote

I need to override the current date with the future value (no hard coding) for testing purpose of a Cobol DB2 program.


SELECT A.1, A.2 FROM space.table A
WHERE CURRENT DATE - 180 DAYS > DATE(A.2)
WITH UR

Anyone please help me.


Thanks,
Vishwa
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Mon Feb 28, 2011 10:15 am    Post subject: Reply with quote

well
Code:

CURRENT DATE - 180 DAYS

is not a future date.

and what datatype(ddl definition)/value of A.2 ?

what problems are you having?
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Feb 28, 2011 11:25 am    Post subject: Reply with quote

viswanathan,

Change the Current date field to a Host variable and then pass what ever date you want

Code:

SELECT A.1
      ,A.2
 FROM space.table A
WHERE DATE(:HCOL_DATE - 180 DAYS > DATE(A.2)
 WITH UR


Once you are done testing remove the Host variable and replace it with current date
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