#!/bin/ksh
TempDir=PATHNAME
proj=PROJECT_NAME #your project name
jobname=JOB_NAME # name of the job for which information is required.
. $DSHOME/dsenv
$DSHOME/bin/dsjob -lstages $proj $jobname 2>/dev/null > $TempDir/stage.txt
# This will give the name of each and every stage used in the job.
# I am using loop so that we can get link name for each and every stage used in the job.
cat $TempDir/stage.txt |while read line
do
stagename=`echo $line`
dsjob -llinks $proj $jobname $stagename 2>/dev/null > $TempDir/LinkName.txt
# This will give the Link_name for each every stage
# Displaying the values
indx=1
cat $TempDir/LinkName.txt | while read line
do
prjct_arry[$indx]="$line"
echo [$indx] $line >> $TempDir/LinkName1.txt
indx=`expr $indx + 1`
done
value=`cat $TempDir/LinkName1.txt| wc -l`
if [ $value -gt 1 ]
then
linkname=`more $TempDir/LinkName1.txt |head -1 | tail -1 | cut -d' ' -f2`
echo $linkname is input to $stagename >> $TempDir/LinkName_Output.txt
linkname=`more $TempDir/LinkName1.txt |head -2 | tail -1 | cut -d' ' -f2`
echo $linkname is output to $stagename >> $TempDir/LinkName_Output.txt
else
linkname=`more $TempDir/LinkName1.txt |head -1 | tail -1 | cut -d' ' -f2`
echo $linkname is input to $stagename >> $TempDir/LinkName_Output.txt
fi
rm $TempDir/LinkName1.txt
done
cat $TempDir/LinkName_Output.txt
Since right now i am not having unix OS that's why i am unable to test the above code..
Hope this will help you out.
http://findingjobsindatastage.blogspot.com/
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)
This implements the same methodology as noted early on. Why 'from a transformer'? Will you be feeding in job names from a list or query? You won't be able to call it directly there, but as discussed you'd need a routine that would take a job name as a parameter and return (I assume) a comma delimited list of the link names.
The routine code would look very similar to the posted script but with the equivalent 'DS' functions in place of the 'dsjob' calls.
-craig
"You can never have too many knives" -- Logan Nine Fingers