DS Job Type Identification - Server or PX in Unix

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
nvalia
Premium Member
Premium Member
Posts: 180
Joined: Thu May 26, 2005 6:44 am

DS Job Type Identification - Server or PX in Unix

Post by nvalia »

Hi,

We have both Server & Parallel jobs in our project depending on the requirements.The Parameters for both are different.
So to dynamically pass the param values at runtime from a seperate param file we need to know whether the job is a Server or Parallel job.

The job name itself, which is an argument to the DS run Unix script, doesn't provide any unique identifier.

Is there any way by which we can find this out?

NV
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I know it's been documented in the forums, I just don't remember the answer. From what I recall, Kim Duke posted some code that illustrated how to check.

You can see some of the information in the dsapi.h file under the $DSHOME/include directory. The Repos Information section shows:

Code: Select all

#define DSS_JOBS           1        /* The Object Type to return */ 
#define DSS_JOB_ALL        15       /* list all jobs */ 
#define DSS_JOB_SERVER     1        /* list all server jobs */ 
#define DSS_JOB_PARALLEL   2        /* list all parallel jobs */ 
#define DSS_JOB_MAINFRAME  4        /* list all mainframe jobs */ 
#define DSS_JOB_SEQUENCE   8        /* list all sequence jobs */ 
The secret is knowing how to get this information from the repository.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

The JOBTYPEIND in DS_JOBS repository table will identify parallel jobs from server jobs.
Here are the indicators:
Server Jobs - 0
Parallel Jobs - 3
Job Sequences - 2
A simple uv query would be

Code: Select all

SELECT NAME FROM DS_JOBS WHERE JOBTYPEIND = 'n';
where n is one of the indicators listed above.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

For completeness, 1 indicates a mainframe job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

viewtopic.php?t=101044&highlight=JOBTYPE

Has several ways to get this.
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You'd probably want to flip the query around for your needs:

Code: Select all

SELECT JOBTYPEIND FROM DS_JOBS WHERE  NAME = 'YourJobName';
And then handle your parameters accordingly based on the type retrieved.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

If you are doing this in a UNIX script or BASIC you need to validate the parameter name before you set the value or dsjob will fail. We did this with

dsjob -lparams

You need to search for that code. I posted code snipets.
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yes you did. Me likey what you done did and fully intend to steal bits of it when I have some spare time. :D
-craig

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