How to get Job Type (Sequence, Server or EE Job)

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
nick.bond
Charter Member
Charter Member
Posts: 230
Joined: Thu Jan 15, 2004 12:00 pm
Location: London

How to get Job Type (Sequence, Server or EE Job)

Post by nick.bond »

Given a job name is it possible and if so what is the BASIC code to find out what the "type" of job it is from within a routine.

i.e. is it a Server Job, an Enterprise Job or a Sequence Job.

Thanks, Nick.
Regards,

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

Post by ArndW »

The job type resides in a column in the DS_JOBS file. I don't know of any published API routine such as DSGetJobInfo() whre this information is available, so the only way to get this would be to read the DS_JOBS file - and that will only work until the repository is changed at version 8.

You can either open the DS_JOBS file and read the record or you can issue a SELECT statement. The SELECT is easier and more future-proof in that it might be easily changed, reading the DS_JOBS is somewhat faster.

You might need to change my code around, as I am not at a DataStage machine and am typing freehand.

Code: Select all

   OPEN '','DS_JOBS' TO DsJobsFilePtr ELSE CALL DSLogFatal('Unable to open DS_JOBS file, status is ':STATUS(),'')
   READV JobType FROM DsJobsFilePtr, JobName, 6
   ELSE
      JobType = '?'
      CALL DSLogWarn('Unable to find job "':JobName:'" in DS_JOBS.','')
   END
   CLOSE DSJobsFilePtr
JobType 0 is a Server, 2 is a Sequence and 3 is a PX Job.

The other method is to issue a

Code: Select all

   EXECUTE 'SELECT JOBTYPE FROM DS_JOBS WHERE JOB = ':JobName:';' CAPTURING Output RETURNING ErrorCode
The string "Output" will have the text and you need to parse the job type from that string.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

You have JOBTYPE in DS_JOBS to indicate this.

Server jobs - 0
JobSequnce - 2
PX Jobs - 3
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In case anyone is wondering, 1 is 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.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Actually i was. Thanks Ray. You really working on the RMM stage arent you :wink:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That stage may be here sooner than you think! :lol:
-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 »

Wow. An intelligent computer that can read a persons mood just by the motion of the eyebrows. O they will have to do better than that to even come close to RMM stage :twisted:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
nick.bond
Charter Member
Charter Member
Posts: 230
Joined: Thu Jan 15, 2004 12:00 pm
Location: London

Post by nick.bond »

Thanks.

p.s. what's RMM?
Regards,

Nick.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Read My Mind
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
Post Reply