Page 1 of 1

Debugging Basic Code in a function

Posted: Fri Feb 10, 2006 1:06 am
by IanCockcroft
Hi, I am new to DS. Now clo9cking 8 hours. My CV has been updated.
ANyway, I am writing a function and need to debug it. How can I do this? Is there a tool or utility I can put it in and check it. I am not that good with basic code and using a debugger is the best way, I feel, to learn.

Thanks
Regards
Ian

Posted: Fri Feb 10, 2006 1:40 am
by WoMaWil
There is no debugger, you to do it the traditional way and use inline command. The Print does a bit of help

Posted: Fri Feb 10, 2006 1:45 am
by ArndW
The tool with which you write a routine in DataStage not only allows you to write and compile it, but it also has a "test" button which lets you call it independantly from a DataStage job. and to pass parameters to it. This is what is used to debug most routines. The DataStage engine has a source-level debugger for code, but this is not available in the graphical front-end and I've found the "test" facility along with judicious use of a PRINT statements for debugging purposes is more than enough.

Posted: Fri Feb 10, 2006 4:34 am
by ameyvaidya
You may need to double-click the results section in the test grid to see the output of the print statements though.

Posted: Fri Feb 10, 2006 3:08 pm
by ray.wurlod
I prefer to use DSTransformError() or DSLogInfo() to PRINT. You can also use compiler directives $DEFINE, $IFDEF, $IFNDEF, $ELSE and $ENDIF to "conditionally compile" your debugging statements. When debugging is done, simply change $DEFINE to $UNDEFINE and recompile, and your debugging statements - though remaining present in the source code - are no longer compiled in the working routine.

Posted: Sat Feb 11, 2006 9:02 am
by kcbland
Consider building the "Ans" result as a text string during development. When you run the test button, you'll be able to double-click on the results and see a verbase description of results. When finished, change the derivation for "Ans" to just return the appropriate result.