Page 1 of 1

Obtaining Column Information within Transform.

Posted: Thu Aug 18, 2005 7:14 am
by gsherry1
I am interested in knowing what methods are avialable for accessing the column name and other column information within transform deriviations.

Suppose I wished to perform lookup on source whose key is the column names on my input data. My first step would be to create a new column and try to populate this with the column name. I prefer this not to be done manually.

I am interested in both server and parallel solutions.

TIA.

Posted: Thu Aug 18, 2005 7:20 am
by ArndW
gsherry1,

you can use the DSGetJobInfo() routine to get information about stages and links in your job (using key DSJ.ME or other jobs by doing a DSAttachJob() to them), then use DSGetLinkInfo() and DSGetStageInfo() to get the information you are seeking.

Note that these are informational routines, you cannot add a column to a job during it's run. Server jobs do not allow this, and while there are nifty things that can be done in Px without specifying column names there is no call there either to manipulate the columns.

Posted: Thu Aug 18, 2005 7:27 am
by roy
Hi,
What do you mean by not manually?
If loading a prevously imported table definition to the column tab in a stage is good enough for you then you'll only be imlementing good practice.
There is no real need to manually code a column name unless it is a temporary one that doesn't reside in your source table definition or final target table definition.

IHTH,

Posted: Fri Aug 19, 2005 3:35 am
by ray.wurlod
In parallel jobs you can use a Lookup stage against a Lookup File Set stage or performing a sparse lookup against a database stage (e.g. DB2 or Oracle). In either case the lookup key column is mapped automatically with no requirement for manual intervention.
No such capability exists in server jobs (as at version 7.5.x).