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

Problem with length of Dynamic SQL


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Mar 15, 2013 7:42 pm
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

Superior Member


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

PostPosted: Fri Mar 15, 2013 8:03 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
Search our Forums:

Back to Top