I made the necessary changes so it would run as an After Routine but it fails. It appears to fail at a point which is not a problem in the equivalent Transform function, namely in recognising a Link Name.
The code for the Transform function looks like
Code: Select all
$INCLUDE DSINCLUDE DSD_STAGE.H
If LinkName = '' Then
LinkNo = STAGECOM.STAGE<STAGE.HANDLES,1>
End Else
CheckLink = Upcase(LinkName)
LinkList = STAGECOM.STAGE<STAGE.HANDLES>
LinkNo = 0
Loop
Remove PinNo From LinkList Setting MorePinNos
If UpCase(STAGECOM.PIN(PinNo)<PIN.LOCAL.NAME>) = CheckLink Then
LinkNo = PinNo
Exit
End
While MorePinNos Do Repeat
If Not(LinkNo) Then
Call DSLogFatal(LinkName:' is not a link associated with ':STAGECOM.NAME,'ImpLinkTRAN1')
End
End
LinkColNames = STAGECOM.PIN(LinkNo)<PIN.COL.NAME>
Call DSLogInfo("1. LinkColNames !! " :LinkColNames,"ImpLinkTRAN1")
Return(0)
One argument is passed to this code - LinkName.
As mentioned the only changes I have made to this code are those required to allow it to run as an 'After Routine'. In the Transform Function routine all the fields for the relevant link are listed in the log but for the After Routine I get the fatal error "HPLoad_Write is not a link associated with Generic_1..Transformer_2" (HPLoad_Write is the name of the Link).
This would suggest that the code is failing at the line
Code: Select all
If UpCase(STAGECOM.PIN(PinNo)<PIN.LOCAL.NAME>) = CheckLink
I do not why this line would work in the Transform Function Routine but fails in the After Routine. Any ideas/help would be greatly appreciated.
[/code]