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
 

 

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: 6966
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: 1278
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 Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm


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