Obtaining Column Information within Transform.

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
gsherry1
Charter Member
Charter Member
Posts: 173
Joined: Fri Jun 17, 2005 8:31 am
Location: Canada

Obtaining Column Information within Transform.

Post 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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post 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,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply