ArndW wrote:I posted a full routine, but you would need to join as a premium member to use it. Lookup up DSAttachJob() in the docs, it has 2 parameters. ...
Yeah I tried the function with the other parameter as well :
New DSAttachJob("Job1",DSJ.ERRNONE)
'New' being the user variable defined in the user variable activity stage. I still get the error message saying
That means that the generated code in a Job Sequence doesn't contain the "INCLUDE DSINCLUDE JOBCONTROL.H" statement, and you won't be able to use these routines. You will have to write a small routine (or get someone to e-mail you the routine listed earlier in this thread) that calls DSAttachJob(), DSGetLinkInfo() and DSDetachJob() to return the row count.
I really think this is a perfect example of how a premium membership pays for itself - think in terms of the time you have spent on this issue and your effective hourly rate.
Or you could try to search for "DSAttachJob DSGetLinkInfo" and you will find at least one thread with DS/BASIC code doing just what you want.
Hold on... you're trying to attach to a job, interrogate it for link counts (etc,etc) all in a UserVariables Activity stage expression?
You'll need to write a routine to do all this and pass your found value back out, then leverage the routine's $ReturnValue there.
Edited to add: Actually, what value is this stage bringing to the table? Unless I'm missing something, it isn't really needed - create the routine mentioned and use a Routine Activity stage to run it. Then conditional triggers from the Routine Activity stage to either run or not run something downstream based on the result.
-craig
"You can never have too many knives" -- Logan Nine Fingers
chulett wrote:Hold on... you're trying to attach to a job, interrogate it for link counts (etc,etc) all in a UserVariables Activity stage expression?
You'll need to write a routine to do ...
So basically, I have to write a routine with these three function calls and returns the row count ? Call this routine in a user variable activity stage and set the value to a user variable.
Arnd...Yes, I completely agree with you about the premium membership. If I did have one, it would have been tremendous help for a speedy resolution of this problem.
hJob = DSAttachJob("MyJobName", DSJ.ERRWARN)
* Test whether attach was successful
Name = DSGetJobInfo(hJob, DSJ.JOBNAME)
If Name = DSJE.BADHANDLE
Then
Call DSLogWarn("Failed to attach job MyJobName", "MyRoutine")
Return
End
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.