DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
This topic is not resolved, but there is a WORKAROUND.
Author Message
leandrohmvieira
Participant



Joined: 02 Sep 2015
Posts: 36
Location: Brasilia, Brazil
Points: 371

Post Posted: Wed Oct 26, 2016 8:00 am Reply with quote    Back to top    

DataStage® Release: 11x
Job Type: Server
OS: Windows
Greetings Experts,

I want to ETL the rowcount of my jobs , and for it we adopted a dev pattern and created an after-job routine that get the values and inserts them in a table. But when routine is executed from a job that does not have the link, the routine aborts:

LDWDim_Age..AfterJob (fatal error from DSGetLinkInfo): Job control fatal error (-9)
(DSGetLinkInfo) Unknown link INS in stage SRK of job LDWDim_Age


My code is the following:

Code:
IF DSGetLinkInfo(DSJ.ME, "SRK","INS", DSJ.LINKROWCOUNT) = DSJE.BADLINK THEN
      ErrCode = DSSetParam(hJob1, "QTD_RGT_INS", 0)
END
ELSE
      ErrCode = DSSetParam(hJob1, "QTD_RGT_INS",DSGetLinkInfo(DSJ.ME, "SRK","INS", DSJ.LINKROWCOUNT) )
END


To other error conditions, the routine just return me the values, but for DSJE.BADLINK it aborts.

Am i doing something wrong? I know there is other ways to check if a link exists on a job, looking into STAGE and LINK lists, but im just curious about this behavior, would be much more easy to just take error code just like other errors...

Thanks in advance.

_________________
Leandro Vieira

Kyros Tecnologia- Uberlândia, Brazil
leandrohmvieira
Participant



Joined: 02 Sep 2015
Posts: 36
Location: Brasilia, Brazil
Points: 371

Post Posted: Fri Oct 28, 2016 4:30 am Reply with quote    Back to top    

I could not achieve a way to ignore this error, so i did a workaround solution, starting from JobInfo, which i have sure it exists.

Here is the code:

Code:
FOR Counter = 1 TO (COUNT(ParamDef,',')+1) STEP 1

   ParamName = FIELD(ParamDef,",",Counter)
   StageName = FIELD(StageDef,",",Counter)
   LinkName = FIELD(LinkDef,",",Counter)

   StageList = ",":DSGetJobInfo (DSJ.ME, DSJ.FULLSTAGELIST):","
   IF NOT(StageList MATCH "0X,":StageName:",0X" ) THEN
      ErrCode = DSSetParam(hJob1, ParamName,0)
      CONTINUE
   END

   LinkList = ",":DSGetStageInfo (DSJ.ME,StageName,DSJ.LINKLIST):","
   IF LinkList MATCH "0X,":LinkName:",0X" THEN
      ErrCode = DSSetParam(hJob1, ParamName,DSGetLinkInfo(DSJ.ME, StageName,LinkName, DSJ.LINKROWCOUNT))
   END
   else
      ErrCode = DSSetParam(hJob1, ParamName,0)
   END
   
NEXT Counter

_________________
Leandro Vieira

Kyros Tecnologia- Uberlândia, Brazil
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours