Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SQLCODE -104 during runing of program

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

New User


Joined: 16 Aug 2009
Posts: 60
Location: chennai

PostPosted: Wed May 19, 2010 4:39 pm    Post subject: SQLCODE -104 during runing of program
Reply with quote

Hi,

I am using dynamic SQL in COBOL-DB2 program and following are the declaration made in program.

01 US.
49 US-LEN PIC S9(4) COMP.
49 US-TEXT PIC X(80).

PROCEDURE DIVISION.

MOVE 40 TO US-LEN.
ACCEPT US-TEXT.

EXEC SQL
EXECUTE IMMEDIATE :US
END-EXEC.

I am accepting US-TEXT , the SQL statement as sting from SYSIN DD * as like this

//SYSIN DD *
'DELETE FROM tbname WHERE EMPCD = "A002" '
/*

i am getting SQLCODE -104 during runing of program and checked with manual saying that it is sysntax error.

Please solve this.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed May 19, 2010 4:47 pm    Post subject:
Reply with quote

display your complete sqlca message, which will inidicate which token db2 has decided to flag as in error.

having no idea how you are executing your program,
the connect that has been/not been made,
it could simply be the qualification fo your tbname.

-104 is a rather specific type of 'syntax' error....................
Quote:
Please solve this.


solve it yourself.
Back to top
View user's profile Send private message
shreejita

New User


Joined: 16 Aug 2009
Posts: 60
Location: chennai

PostPosted: Wed May 19, 2010 4:56 pm    Post subject: Reply to: SQLCODE -104
Reply with quote

i changed the quotes like this

//SYSIN DD *
'DELETE FROM EMPI WHERE EMPCD = 'A002''
/*

Now i am receiving SQLCODE -010 which says string not terminated properly

what z the meaning of that
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Wed May 19, 2010 5:18 pm    Post subject:
Reply with quote

why do you have quotes around the whole statement ?
try this :

//SYSIN DD *
DELETE FROM EMPI WHERE EMPCD = 'A002'
/*

or

//SYSIN DD *
DELETE FROM EMPI WHERE EMPCD = "A002"
/*

depending on your settings
Back to top
View user's profile Send private message
shreejita

New User


Joined: 16 Aug 2009
Posts: 60
Location: chennai

PostPosted: Thu May 20, 2010 10:17 am    Post subject: Reply to: SQLCODE -104 during runing of program
Reply with quote

Thanks ALL, It is working now.
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm

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