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: 7315

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 Problem commiting to DB2 from IMS MPP Ole Soerensen IMS DB/DC 1 Wed Jul 26, 2017 5:19 pm
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Length of Tape file Mohan Kothakota JCL & VSAM 9 Thu Apr 20, 2017 10:24 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm


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