API Return Codes

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
zam62
Participant
Posts: 42
Joined: Tue Apr 29, 2003 12:21 pm

API Return Codes

Post by zam62 »

I have create a C program using the DSAPI to run our DataStage Jobs. When a user tries to execute a job and does not have permissions to run datastage, I am getting a general failure in my C program because there is no corresponding error code being set. I cannot find the proper return code for a "no permissions" error. IS there one, or is there a way to see if the user has permissions before even opening the job?
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I have not used the API from a C program but I have in BASIC. I imagine the job fails hard and the error is not trapped because that is what happens within DataStage. You get a core dump most of the time unless you do not have write permission to write to core file.

Kim.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The DSAPI is documented in the Server Job Developer's Guide. Within this there is a list of error codes (constants all beginning with DSJE_). Most of the functions themselves are int, and return a negative integer in case of error. These values can also be seen in the online help for the DataStage BASIC counterparts of the C functions in the DSAPI.

In your particular case, what code is being returned from which function that leads you to state that no error code is being set?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
you could also concider giving a default connection to the DS jobs that run a controll job that anyone can run;
this job will actually get as paramters the user and job to be run;
the controll job will access a privilages table that determines "who can run which jobs" and act acordingly.

this might be more complicated to manage but more secure, also you can send emails or any other informative info to the person/s that manage the system about this activity.

you can give your users in the same manner a way to get the job status of the job they want to check in order to see if it failed or not (in cases that they have no privilages to run it supply the relevant message).

IHTH (I hope This Helps)
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
Post Reply