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
 

 

CURRENT DATE functionality dynamically(CURRENT DATE - : var)

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

New User


Joined: 23 Apr 2010
Posts: 3
Location: USA

PostPosted: Wed Apr 11, 2012 5:24 am    Post subject: CURRENT DATE functionality dynamically(CURRENT DATE - : var)
Reply with quote

Hi,

I am trying to use the CURRENT DATE functionality dynamically as,

"CURRENT DATE - : variable DAYS " in my query. I am getting compatibility issues.

I tried by giving
a) variable declaration as 9 (03) comp-3 but is getting compilation error.
b) variable declaration as X (10) since current date is returning a 8 byte field but is getting bind error.

Again I tried the query as "CURRENT DATE - DAYS (:variable) " as argument to the scalar function, but was not able to get through the bind errors.

The query works when "CURRENT DATE - 99 DAYS " is given. So I think its an issue with the host variable.

The SQl return code is -171 THE DATA TYPE, LENGTH, OR VALUE OF ARGUMENT nn OF function-name IS INVALID.

Please help me with this.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Apr 11, 2012 6:38 am    Post subject:
Reply with quote

you are invited to see for yourself,
what kind of host variables are used in
Datetime arithmetic
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 TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Add system date inside of a PS file a... pramitdas DFSORT/ICETOOL 5 Sun Aug 28, 2016 12:06 am


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