Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 7312

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: 6254
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 Create Dynamic Sort card with Omit co... balaji81_k DFSORT/ICETOOL 9 Thu Sep 26, 2019 10:06 pm
No new posts Increase the Maximum Length of LRECL ... Dhineshpondy7 JCL & VSAM 5 Wed Aug 07, 2019 6:23 pm
No new posts Having problem passing a variable to ... markzasz JCL & VSAM 12 Thu Jul 11, 2019 5:31 pm
No new posts position, start pos, length of column... juares castro SYNCSORT 14 Fri Jun 21, 2019 8:47 pm
No new posts Pipeline scan problem John Poulakos CICS 1 Thu Feb 28, 2019 10:02 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us