Multiple Instance job link info problem

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
leomauer
Premium Member
Premium Member
Posts: 100
Joined: Mon Nov 03, 2003 1:33 pm

Multiple Instance job link info problem

Post by leomauer »

I have the following problem.
I am retrieving the link info from the multiple instance job.
Code in UNIX script is as follows

Code: Select all

dsjob -linkinfo $DSproject $DSjob.$parmTypCd$dtTypCd $DSTransform $DSLink>$linkInfoFile 2>&1

rc=$?
if (($rc != 0))
   then 
   cat $linkInfoFile
   rm $linkInfoFile
   print ABORT WITH RC = $rc
   exit $rc
fi
   
grep 'Link Row Count' $linkInfoFile|awk '{print $5}'>$cntFile
linkCnt=$(cat $cntFile)
print $DSLink link count:   
print $linkCnt
Invocation IDs are like .TS, .TP and the other 22 valid values.
It works OK when the invocation ID is one of the valid 24 values that the job was executed with.
Now I tried the value that is invalid(the ID that this job was never executed under) expecting to get an error.
Problem is I got none.
The content of the linkInfoFile is
Status code = 0
Link Row Count : 0
Link Last Error : <none>
Link DBMS Code : not available
SQL State : not available
Link Name : ClaimsUnld
Return code of dsjob is 0.
Apparently I am not able to recognize within the script that I am trying to get link info from none existing instance.
Any idea?
Thanks
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Check the job status with the invocation id. You can decide the result upon the return.
leomauer
Premium Member
Premium Member
Posts: 100
Joined: Mon Nov 03, 2003 1:33 pm

Post by leomauer »

Sainath.Srinivasan wrote:Check the job status with the invocation id. You can decide the result upon the return.
I tried it. Return code is still 0 but the output gives something
ward /etl/test/scripts$ dsjob -jobinfo galaxy MyJob.AA
Job Status : NOT RUNNING (99)
Job Controller : not available
Job Start Time : Thu Feb 17 11:08:18 2005
Job Wave Number : 0
User Status : not available
Job Control : not available
Interim Status : NOT RUNNING (99)
Invocation ID : AA
Last Run Time : not available
Job Process ID : 0
Invocation List : FAO340UnetClaimsUnld.TS,FAO340UnetClaimsUnld.TP,FAO340UnetClaimsUnld.SS,FAO340UnetClaimsUnld.SP,FAO340UnetClaimsUnld.PS,FAO340UnetClaimsUnld.DS,FAO340UnetClaimsUnld.DP,FAO340UnetClaimsUnld.PP,FAO340UnetClaimsUnld

Status code = 0
ward /etl/test/scripts$ print $?
0
Not too gracious but will do.
Thanks.
Leo
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

I think the best way can be

dsjob -linvocations <project> <job>

This will give you the list of invocations id from which you can grep yours to verify.
Post Reply