IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Db2 error in Pl/1 program


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Mar 17, 2011 4:22 pm
Reply with quote

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
View user's profile Send private message
venuhunev

New User


Joined: 26 May 2007
Posts: 70
Location: chennai

PostPosted: Sat Mar 19, 2011 9:00 am
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sat Mar 19, 2011 11:27 am
Reply with quote

Have you tried having '2011-02-13' in your input file instead of just 2011-02-13??
Back to top
View user's profile Send private message
venuhunev

New User


Joined: 26 May 2007
Posts: 70
Location: chennai

PostPosted: Sat Mar 19, 2011 12:34 pm
Reply with quote

Nope. cant change the input field as per the requirements.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Sat Mar 19, 2011 8:31 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sat Mar 19, 2011 8:36 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2 Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts DB2 Event passed to the Application P... DB2 1
Search our Forums:

Back to Top