IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

STOP RUN without commit, sqlcode=00000010M


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
toughhou

New User


Joined: 21 Jan 2010
Posts: 5
Location: China

PostPosted: Sat Aug 13, 2011 3:26 pm
Reply with quote

Hi All, When I tried to run a dynamic sql statment program, I got some problems. Anyone can help with it?

B210-DELETE-CUST.
MOVE SPACE TO DEL-STMT-TEXT.
STRING 'DELETE FROM TOUGH.' TABLE-NAME
'WHERE INVNO= ''' INVNO ''''
DELIMITED BY SIZE
INTO DEL-STMT-TEXT.
DISPLAY 'SQL: ' DEL-STMT-TEXT.
EXEC SQL
EXECUTE IMMEDIATE :DEL-STMT
END-EXEC.

===========(1)=================
EXEC SQL
COMMIT
END-EXEC.
===========(1)=================
If the program stop run without commit(i mark (1) here) after execution of the above sql statment, the sqlcode=00000010M.Anyone can explain about why I should commit manually. I remember that the program can commit automatically.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sat Aug 13, 2011 4:56 pm
Reply with quote

Here is the defintion of a -104 SQLCODE
Suggest you bookmark and use LookAt - z/OS message help
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sat Aug 13, 2011 5:26 pm
Reply with quote

you don't show any code where you are checking the SQLCODE after invoking DB2 to process your SQL.

so, not sure what sql statement is receiving the -104.

relying on auto commit in batch is poor programming.

in cics, normally you use syncpoints and at task termination,
db2 is invoked for the commit.
Back to top
View user's profile Send private message
toughhou

New User


Joined: 21 Jan 2010
Posts: 5
Location: China

PostPosted: Sat Aug 13, 2011 8:00 pm
Reply with quote

dbzTHEdinosauer wrote:
you don't show any code where you are checking the SQLCODE after invoking DB2 to process your SQL.

so, not sure what sql statement is receiving the -104.

relying on auto commit in batch is poor programming.

in cics, normally you use syncpoints and at task termination,
db2 is invoked for the commit.



toughhou wrote:
Hi All, When I tried to run a dynamic sql statment program, I got some problems. Anyone can help with it?

B210-DELETE-CUST.
MOVE SPACE TO DEL-STMT-TEXT.
STRING 'DELETE FROM TOUGH.' TABLE-NAME
'WHERE INVNO= ''' INVNO ''''
DELIMITED BY SIZE
INTO DEL-STMT-TEXT.
DISPLAY 'SQL: ' DEL-STMT-TEXT.
EXEC SQL
EXECUTE IMMEDIATE :DEL-STMT
END-EXEC.

===========(1)=================
EXEC SQL
COMMIT
END-EXEC.
===========(1)=================
If the program stop run without commit(i mark (1) here) after execution of the above sql statment, the sqlcode=00000010M.Anyone can explain about why I should commit manually. I remember that the program can commit automatically.


Here you see, if I didn't code the commit which I marked between "===========(1)============", it will give a sqlcode of 00000010M. But you told me it's -104, why 00000010M stands for -104? Could you explain?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sat Aug 13, 2011 8:21 pm
Reply with quote

Please refer to this Sticky which answers your question.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10876
Location: italy

PostPosted: Sat Aug 13, 2011 8:25 pm
Reply with quote

Quote:
why 00000010M stands for -104? Could you explain?

pretty basic concept

the sign zones generally used are C and F for positive numbers D for negatives

so
Code:
x'c0c1c2c3c4c5c6c7c8c9'
x'f0f1f2f3f4f5f6f7f8f9'

are the hex representations for positive signed zoned numbers
Code:
x'd0d1d2d3d4d5d6d7d8d9'

are the same for negative signed zoned numbers

up to you to understand the why !
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts SQLCODE = -122 while using the scalar... DB2 4
No new posts SQLCODE = -16002 when using XMLEXISTS DB2 1
No new posts Is SQLCODE -811 possible while fetchi... DB2 1
No new posts filter COMMIT/ROLLBACK statements DFSORT/ICETOOL 13
No new posts SQLCODE=-204 SQLSTATE=42704 DB2 4
Search our Forums:

Back to Top