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
 

 

Sql Code -204, please help

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

New User


Joined: 24 May 2010
Posts: 86
Location: Pune

PostPosted: Fri Aug 02, 2013 4:32 pm    Post subject: Sql Code -204, please help
Reply with quote

Hi ,

In one of my prog, I am getting -204 at the below query -

STRING
'INSERT INTO TWCCA11 ' DELIMIOTED BY SIZE
'SELECT * FROM TDWCA11 ' DELIMITED BY SIZE
'WHERE CSNO = ?' DELIMITED BY SIZE
'AND CSTYP = ?' DELIMITED BY SIZE
INTO CSE-IRT-T
END-STRING
MOVE LENGTH OF(CSE-IRT-T) TO CSE-IRT-L
EXEC SQL
PREPARE CSE_INSERT FROM :CSE-IRT
END-EXEC

var def -
05 CSE-IRT
49 CSE-IRT-L PICS9(4) COMP.
49 CSE-IRT-T PIC X(150).
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri Aug 02, 2013 4:43 pm    Post subject:
Reply with quote

Did you try to execute the query in SPUFI??
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Fri Aug 02, 2013 4:54 pm    Post subject: Reply to: Sql Code -204, please help
Reply with quote

You have typed. We don't want to look at your typos and "solve" those first. Please paste from your emulator, and use the Code tags, which preserve spacing.

Do you have trailing blanks on each literal (except the last)?

When you use LENGTH OF, are you expecting a result of 150 each time?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Aug 02, 2013 5:00 pm    Post subject:
Reply with quote

since a -204 means that the db2 object to which you are refering is not defined to the db2 system.

i would guess that TWCCA11 (and TDWCA11) needs to be better qualified,
all of which you would have known,
had you bothered to look-up the -204 sql code.

and if you do not understand what is meant by qualification,
READ the manual.

also, since this is a db2 question, i am moving it to db2 and out of COBOL
Back to top
View user's profile Send private message
kishpra

New User


Joined: 24 May 2010
Posts: 86
Location: Pune

PostPosted: Fri Aug 02, 2013 5:14 pm    Post subject: Reply to: Sql Code -204, please help
Reply with quote

i ran the query in Spufi and it ran fine.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Fri Aug 02, 2013 7:00 pm    Post subject: Re: Reply to: Sql Code -204, please help
Reply with quote

kishpra wrote:
i ran the query in Spufi and it ran fine.

Then continue to run it in SPUFI (assuming that you really mean SPUFI and not DSNTEP2/4). Mr. Brenholtz has given you the solution; you do not wish to apply it.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 642
Location: Whitby, ON, Canada

PostPosted: Sat Aug 03, 2013 3:04 am    Post subject: Re: Reply to: Sql Code -204, please help
Reply with quote

Akatsukami wrote:
kishpra wrote:
i ran the query in Spufi and it ran fine.

Then continue to run it in SPUFI (assuming that you really mean SPUFI and not DSNTEP2/4). Mr. Brenholtz has given you the solution; you do not wish to apply it.

I always find it a little bit scary when someone with so little apparent DB2 experience tries to mess with an advanced technique like dynamic SQL in a Cobol program. But maybe I am just getting a bit conservative in my old age.
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 PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Help in understanding what is th... mainakdalal PL/I & Assembler 9 Mon Oct 03, 2016 8:03 pm


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