SubRoutine returning error values

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
Pavan_Yelugula
Premium Member
Premium Member
Posts: 133
Joined: Tue Nov 23, 2004 11:24 pm
Location: India

SubRoutine returning error values

Post by Pavan_Yelugula »

Hi All
Can you please point me out the mistake in the following Subroutine

DEFFUN DSGetJobInfo(JobName,Info) Calling "DSJ.DSGetJobInfo"

Ans=DSGetJobInfo(JobName,Info)

It is compiling fine but when i give proper values in JobName and info it is giving me error

The values i m passing as Arg are JobName->DSJ.BasicTrial(Succesful Job)
Info->DSJ.JOBNAME

Thanks in advance
Pavan
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Do not do a "DEFFUN" statement. Simply put this:

Code: Select all

$INCLUDE DSINCLUDE JOBCONTROL.H
$INCLUDE DSINCLUDE DSR_UVCONST.H
$INCLUDE DSINCLUDE DSR_COMCONST.H
into the top of any function that needs access to job control APIs.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Probably cleaner to just include the appropriate header file than to use a DEFFUN like that:

Code: Select all

$IFNDEF JOBCONTROL.H 
$INCLUDE DSINCLUDE JOBCONTROL.H 
$ENDIF
Check the online help for the DSGetJobInfo routine and you'll see that it doesn't need the job name but the job handle. You'll need to use DSAttachJob first to establish a handle to your job in question and then use the new handle to get the job information.

When you are done, make sure you 'detach' the handle.

Oh, and hopefully where you put 'Info' in the call you posted, you are actually using one of the legitimate InfoTypes, yes?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The DSGetJobInfo function is not Cataloged with a "DSJ." prefix.

In fact, it is Cataloged with no prefix.

So either lose the CALLING clause from your DEFFUN statement, or lose the "DSJ." prefix from within the CALLING clause.

Code: Select all

DEFFUN DSGetJobInfo(JobName,Info) 
DEFFUN DSGetJobInfo(JobName,Info) Calling "DSGetJobInfo" 
Or, as the others have suggested, include JOBCONTROL.H, in which the correct DEFFUN declarations are already coded for you!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Pavan_Yelugula
Premium Member
Premium Member
Posts: 133
Joined: Tue Nov 23, 2004 11:24 pm
Location: India

Post by Pavan_Yelugula »

hi All

Thanks for the replies. it is working great now

Thanks and regards
Pavan
Post Reply