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
 

 

Problem with length of Dynamic SQL

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

New User


Joined: 02 Aug 2011
Posts: 17
Location: India

PostPosted: Fri Mar 15, 2013 6:42 pm    Post subject: Problem with length of Dynamic SQL
Reply with quote

Hi,

I am trying to execute a dynamic SQL in a cobol program .. the dynamic SQL is placed in the below variable

01 WS-SQL-AREA-G.
49 WS-SQL-PTR PIC S9(4) COMP.
49 WS-SQL-AREA PIC X(32760).

Since the max size of WS-SQL-PTR is +9999, when the length of my query exceeds by that numbers. it is throwing a sqlcode -104 on PREPARE

Pls suggest on how to execcute a query which has length more than +9999.

Thanks in Advance.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7254

PostPosted: Fri Mar 15, 2013 7:42 pm    Post subject: Reply to: Problem with length of Dynamic SQL
Reply with quote

Define the field as COMP-5, not COMP. This will give you up to 32,767 in a signed field.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Mar 15, 2013 8:03 pm    Post subject:
Reply with quote

You talk about SQLCODE=-104, have you seen what is flagged in SQLCA?
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 SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm


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