Page 1 of 1

Posted: Thu Jun 05, 2014 3:23 am
by ray.wurlod
System variable @PARTITIONNUM, available in Transformer stage.

Posted: Thu Jun 05, 2014 5:57 am
by Gazelle
Thanks for the reply, but in our case we need to run the WLM_SET_CLIENT_INFO procedure in the DB2Connector before reading the database,
i.e. there is no prior Transformer stage, and I do not know how to access the @PARTITIONNUM value from within a Before-SQL statement.

The value really needs to be accessible from within the DB2Connector, because it can use different partitioning than the rest of the job.
e.g. if I look at the DB2 Snapshot when a DB2Connector reads a table, I see two entries: one for the "agent" process (set for each node), and one for the "coordinator" process.
I haven't tested this yet, but my understanding is that if the table is partitioned, then I would see multiple "agent" processes (equal to the number of table partitions that need to be read, which depends on the values of the partition key in the SQL statement).

I get the feeling that "partition" in this context is set by DB2, and not by the DataStage job or the DB2Connector stage. Somehow the value ends up in the $SLOT2 variable within the agent process.