Page 1 of 1

Code Walkthrough

Posted: Tue Mar 23, 2004 4:28 pm
by bdixon
Hi All,

Does anyone tips on code walkthroughs for datastage jobs and batches.

Thanks
Brad

Posted: Tue Mar 23, 2004 4:49 pm
by ray.wurlod
There isn't a lot of "code" as such, and what there is is DataStage BASIC. Do your interlocutors understand DataStage BASIC?

What I prefer to do is to load up the graphical interface with lots of annotations (they're cost free at execution time) explaining absolutely everything that's going on. For example, I bring out the SQL onto the canvas near an SQL-using stage. There's an annotation outlining what each Transformer stage is doing. There's an annotation specifying what's in each text file - and in a walk through you can use View Data.

And Show Performance Statistics will display row counts on each link.

If they're still skeptical, use the Debugger to show inputs and outputs of Transformer stages and order of execution of links.

Finally, for the bigger picture, the Director shows what ran, when, and with what outcome.

Posted: Tue Mar 23, 2004 5:52 pm
by vmcburney
The main area of code review for inexperienced users, and some traps I fell into early on:
- lack of knowledge about stage variables. In particular having the same code appearing several times in a transformer (in several constraints and derivations) when it could be used once in a stage variable and then use the stage variable multiple times.
- not enough use of routines. The same calculation or formatting code appearing time and time again in different jobs. A reusable routine can simplify transformer code and is maintainable and easier to test.
- better ways of doing things in routine code. In particular how to use arrays, some advanced features of the format commands, using case statements instead of embedded ifs. etc.

Your code reviews and walkthroughs will be very important in the first few weeks of your project to ensure everyone is using the same standards and should become routine and bried as people become more experienced.