Link Derivation

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
sathishmca
Participant
Posts: 43
Joined: Mon Mar 03, 2008 10:58 pm
Location: Chennai

Link Derivation

Post by sathishmca »

How to get the derviation of all links in a job ?
Sathish Bhojan
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Open the job in Designer and inspect them.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
PhilHibbs
Premium Member
Premium Member
Posts: 1044
Joined: Wed Sep 29, 2004 3:30 am
Location: Nottingham, UK
Contact:

Re: Link Derivation

Post by PhilHibbs »

sathishmca wrote:How to get the derviation of all links in a job ?
Export the job to a DSX, and search for "Derivation". If you have Perl installed:

Code: Select all

perl -ne "$lk=$_ if /^      Name/;$f=$_ if /^         Name/;print $lk.$f.$_ if /^ +Derivation/;" filename.dsx
This will print out the link name, field name, and derivation for every output field in the job.

Slightly more sophisticated, includes job name, removes repetition:

Code: Select all

perl -ne "$j=$_ if /^   Identifier/;$lk=$_ if /^      Name/;$f=$_ if /^         Name/;if (/^ +Derivation/){print $j.$lk.$f.$_;$j=$lk=''}" jobname.dsx
Phil Hibbs | Capgemini
Technical Consultant
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or push the button in the Designer that looks like the IE icon, it will generate an HTML document with everything in the job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
PhilHibbs
Premium Member
Premium Member
Posts: 1044
Joined: Wed Sep 29, 2004 3:30 am
Location: Nottingham, UK
Contact:

Post by PhilHibbs »

pfff, where's the fun in that?
Phil Hibbs | Capgemini
Technical Consultant
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:lol:

Yah, yah Mr Henry... give me Perl or give me death.
-craig

"You can never have too many knives" -- Logan Nine Fingers
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Re: Link Derivation

Post by gateleys »

PhilHibbs wrote:
sathishmca wrote:How to get the derviation of all links in a job ?
Export the job to a DSX, and search for "Derivation". If you have Perl installed:

Code: Select all

perl -ne "$lk=$_ if /^      Name/;$f=$_ if /^         Name/;print $lk.$f.$_ if /^ +Derivation/;" filename.dsx
This will print out the link name, field name, and derivation for every output field in the job.

Slightly more sophisticated, includes job name, removes repetition:

Code: Select all

perl -ne "$j=$_ if /^   Identifier/;$lk=$_ if /^      Name/;$f=$_ if /^         Name/;if (/^ +Derivation/){print $j.$lk.$f.$_;$j=$lk=''}" jobname.dsx
Hey Phil (or any Perl Gurus here),

Can you change the second Perl script so that it returns the JobName (StageName if possible) that contains the string that I want to search for? The search string may be part of the SQL in an ORAOCI stage, Xfmr derivation or even in an Annotation.

Thank you.
gateleys
Post Reply