We have moved to www.dataGenX.net, Keep Learning with us.

Friday, July 18, 2014

Some DataStage Job design

Updating the Master Reports List (MRL) in Datastage

Create a Job which has a Row Generator stage linking to an ODBC or DB2 stage. Change the parameter in the Row Generator stage to output zero records. Write the SQL to update the MRL table as 'After SQL' in the output ODBC or DB2 stage.

Running SQL Commands in Datastage

Create a Job which has a Row Generator stage linking to an ODBC or DB2 stage. Change the parameter in the Row Generator stage to output zero records. Write the SQL as 'After SQL' in the output ODBC or DB2 stage.

Emptying a Dataset

Create a Job which has a Row Generator stage linking to a Dataset stage. Change the parameter in the Row Generator stage to output zero records. Set the parameter for the Dataset stage to 'Override'.

How To Generate a Key for An Output Table

The preferred way is to use the Surrogate Key stage. However, this can be impractical if Datastage is not solely responsible for the allocation of key values (if you are sharing a file with another Job Sequence, or Data Integrator is also generating keys). In this case you have to ensure that keys you use are not duplicated by the parallel processing engine, so you can't just increment by one. Determine the existing highest key on the table using a Sort stage, and then reading one value of the existing key. Then use the following formula in a Transformer Stage:
highestexistingkey + ((@INROWNUM - 1) * @NUMPARTITIONS + @PARTITIONNUM + 1)



Like the Facebook Page & join Group
https://www.facebook.com/DataStage4you
https://www.facebook.com/groups/DataStage4you

https://twitter.com/datastage4you
For WHATSAPP group , drop a msg to 91-88-00-906098