Debugging Basic Code in a function

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
IanCockcroft
Participant
Posts: 1
Joined: Fri Feb 10, 2006 12:25 am
Location: Johannesburg

Debugging Basic Code in a function

Post 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
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

There is no debugger, you to do it the traditional way and use inline command. The Print does a bit of help
Wolfgang Hürter
Amsterdam
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
ameyvaidya
Charter Member
Charter Member
Posts: 166
Joined: Wed Mar 16, 2005 6:52 am
Location: Mumbai, India

Post by ameyvaidya »

You may need to double-click the results section in the test grid to see the output of the print statements though.
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post 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.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Post Reply