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

Find sql statement in dbrm that is bind failure


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Jan 11, 2008 9:37 pm
Reply with quote

Sometimes I do not have access to a pre-compile listing, which I could use to find the 'offending sql' in a bind error.

access to the dbrm and this rexx gives me the 'offending sql', which I can then find in the program - if necessary.


Code:

/* REXX */
/*       this rexx macro is member name:  DBRMLN
ADDRESS ISREDIT
'MACRO (LINENO)'
/*  TRACE ?R   */
HEX_LINE = D2X(LINENO,6)
FIND "X'"HEX_LINE"'"
EXIT


invocation example:
edit or view the appropriate dbrm and then:
DBRMLN 2768

2768 is the statement number from the 'failed bind' report.

the 'FIND' will point you to the sql in the dbrm. Though the sql in a dbrm is somewhat cryptic (will be moreso in vsn8 - unicode), you can figure out which sql in your program is the same.

hope this helps someone.
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
No new posts Find the occurrence of Key Field (Par... DFSORT/ICETOOL 6
No new posts Find a record count/numeric is multip... COBOL Programming 1
Search our Forums:

Back to Top