170 likes | 256 Views
EP105 Debugging Sybase XJS/390: How Can We Help?. Bruce Yelen Senior Software Engineer Enterprise Solutions Division Byelen@sybase.com. The most common error message you’ll see! Not very informative. Have to “count” and find the line. Hopefully it’s an obvious error!.
E N D
EP105Debugging Sybase XJS/390:How Can We Help? • Bruce Yelen • Senior Software Engineer • Enterprise Solutions Division • Byelen@sybase.com
The most common error message you’ll see! Not very informative. Have to “count” and find the line. Hopefully it’s an obvious error! The “dreaded” message -
Nothing! But line 24 is missing its semicolon. Line 25 shows -
The script returns its proper output. With the fix in place -
The script runs, but the data is wrong. (We’re not all into skating) When the problem is not as simple –
The XJS/390 debugger follows the program flow, and shows variables Debugging the script –
When using the debugger, keep the following in mind: It can only debug functions. It will only step from the first instruction (breakpoints will be supported in future releases). The field values of a MSCRMAP object will not show in the Automatic Variable or Watch windows. It is useful for checking the logic “flow”. XJS/390 debugger –
Add statements to printout trace data. These can be: Write() or writeln() statements. Use the sendmsg() method of mscrtds. Write to CICS temporary storage. Problems with write/writeln/sendmsg: These commands conflict with the sendrow() method of mscrtds. They may not send any data or text. CICS temporary storage is more reliable. Getting more debugging data –
For those unfamiliar with CICS: “Temp storage” is an area that CICS applications can store data for retrieval later. The application provides a queue name. Any data stored under that queue name can be retrieved “first in, first out”. XJS/390 provides easy access to CICS temp storage. CICS Temporary Storage
We’ve added the commands to write the phone number from DB2 and the key being used to read the VSAM dataset to a temp storage queue named “DEBUG ”. Using temp storage for tracing –
Do it the hard way by logging into CICS… Viewing the saved temp storage data –
Or the easy way with Mscript! Viewing the saved temp storage data –
HostLib(cics, "MSCRCICS", map, "MSCRMAP", tds, "MSCRTDS"); var queuedata = map.static(80); var qdata = map.field(queuedata,0,map.char,80); tds.describe(1, queuedata,qdata,60,"Temp Storage"); var i = 1; while (cics.readq("DEBUG ",queuedata,i) == 0) { tds.sendrow(); i++; } tds.senddone(); cics.deleteq("DEBUG "); Simple Mscript code to read (and delete) CICS temp storage –
We never moved the phone number into the VSAM record key! The error is revealed –
The missing line’s been added…. Make the correction –
Run the test – The output looks good….. And the trace output is correct!
Future releases of XJS/390 will include various debugging enhancements, including: Breakpoints. Display attribute and data of MSCRMAP object fields. Support for array variable display. Future Debugging Enhancements