After job subroutine

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
dsuser08
Participant
Posts: 29
Joined: Wed Feb 06, 2008 3:56 am

After job subroutine

Post by dsuser08 »

Hi

I have developed a simple job loading data from sequential file into database.Job is working fine.I have written a routine to load log in a text file.When i tested it as transform function routine it is working fine.When I converted it to After job subroutine.Job gets aborted.I am not able to compile the job.It give an error " Cannot give mutually exclusive access to job".
In After job subroutine,First parameter is jobname .Second parameter is error.How should I pass the value in the input value column of job properties.Can i give comma and pass the values.

Please help
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I haven't seen that error message and am unclear how you could be generating it.

The Before/After job routines have 2 parameters, the first is input to the subroutine and can contain whatever you wish while the 2nd is returned and contains the ErrorCode. If you wish to pass more than one value to a Before/After subroutine you need to put those values into one string and parse them in the routine, i.e. if you wish to pass parameters "JobName" and "TheAnswer" you would call the routine "#JobName#,#TheAnswer#" and in the routine parse the elements using something like "Field(InputArg,',',1)"
dsuser08
Participant
Posts: 29
Joined: Wed Feb 06, 2008 3:56 am

Post by dsuser08 »

Thanks so much for your reply.Now its accepting the jobname as parameter in the after job routine,but its not getting the log into the text file.Job fails with error "unable to attach job".I am using dsattachjob within
routine.

But the routine is working fine when I had it as transform function .I get output in seconds

Please help
Last edited by dsuser08 on Fri Feb 08, 2008 6:52 am, edited 1 time in total.
MOHAMMAD.ISSAQ
Participant
Posts: 78
Joined: Fri Mar 02, 2007 4:54 am
Location: CHENNAI

Post by MOHAMMAD.ISSAQ »

I think you're calling "DSLogFatal" function.This function never return to the before/after sub routine.It's better if you used "DSLogWarn".
dsuser08
Participant
Posts: 29
Joined: Wed Feb 06, 2008 3:56 am

Post by dsuser08 »

I am not using DS.Logfatal...
Still am facing the same issue.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You are probably attaching to the job itself in the after-job routine. Instead of using DSAttachJob(), just use the mnemonic DSJ.ME for the job handle.
dsuser08
Participant
Posts: 29
Joined: Wed Feb 06, 2008 3:56 am

Post by dsuser08 »

Thanks so much Arndw
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Exactly. If/when that fixes your problem, please mark the topic as Resolved. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply