Issue while running After-job subroutine

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
sumesh.abraham
Participant
Posts: 153
Joined: Thu May 11, 2006 1:52 am
Location: Bangalore

Issue while running After-job subroutine

Post by sumesh.abraham »

I have created a routine to compare data in 2 sequential files and take action on sync/non-sync scenarios. The arguments for the routine are the file path and I see ErrorCode is automatically added when I select the Type as 'Before/After subroutine'. In this case how should deal with the ErrorCode. I have specified the below statement as last line in routine

Code: Select all

Ans = ErrorCode
In the After job subroutine, I provided the argument as filepath 0
How should I define this? When I execute the job there is an issue with the error code returned. The error that I get is

Code: Select all

After-job routine returned error: Error variable unassigned on return from AFTER routine DSU.testroutine
What could be the issue here? Appreciate your help!
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You determine the return value for "ErrorCode" in your after-job routine. If the return value is nonzero then the job will consider that as an error and then abort.
sumesh.abraham
Participant
Posts: 153
Joined: Thu May 11, 2006 1:52 am
Location: Bangalore

Post by sumesh.abraham »

Thanks for the reply. All I am doing in the subroutine is reading 2 files and comparing them. If I assign ErrorCode to any desired value within the routine and provide the same in the After-job routine section of the job properties, will it work? I tried with value as 1 and 0, but I still get the same error.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

If you assigned 0 to ErrorCode in your routine, then you won't get that error message (which states that the variable hasn't been assigned).

Your routine will have 2 parameters, the first is what you pass in as a string, the second is the error code. Variables in UV-Basic are case sensitive.
Post Reply