View previous topic :: View next topic
|
Author |
Message |
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
I believe that the duration needs to be declared as FIXED DEC (15,0), not as FIXED BIN (15) (the DB2 SQL reference appears to support this).
With this change, I have taken GuyC's code, successfully pre-compiled and compiled it, successfully link-edited it, successfully bound the package and the plan, and have written and successfully run JCL that executes that program via background TSO, taking the date as a parameter. I repeat "successfully" to emphasize that I had no problem in doing these things. |
|
Back to top |
|
|
venuhunev
New User
Joined: 26 May 2007 Posts: 70 Location: chennai
|
|
|
|
Hi..
select date(2011-02-13) - 1 year, date('2011-02-13') - 1 year
from sysibm.sysdummy1
it gives
0005-06-19, 2010-02-13
I understand the arithmetic involved in date(2011-02-13) - 1 year. thnx for that.
but my requirement is date('2011-02-13') - 1 year and date being passed from JCL.
Bolded is the problem now which gives the abend as the value is passed from the input file
Input file: 2011-02-13
I want to have the value in query as date('2011-02-13') |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Have you tried having '2011-02-13' in your input file instead of just 2011-02-13?? |
|
Back to top |
|
|
venuhunev
New User
Joined: 26 May 2007 Posts: 70 Location: chennai
|
|
|
|
Nope. cant change the input field as per the requirements. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
You don't know PL/I, do you?
You have been given the exact solution. You cannot understand it. You do not know how to test it. You do not know how to implement it. You can only repeat nonsense that reveals your ignorance, and have wasted three days doing so. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
If you cannot change your input file then I suggest you get your program to add the quotes - look at the manual to see how to include quotes in a string. |
|
Back to top |
|
|
|