How to get Job Type (Sequence, Server or EE Job)
Moderators: chulett, rschirm, roy
How to get Job Type (Sequence, Server or EE Job)
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.
i.e. is it a Server Job, an Enterprise Job or a Sequence Job.
Thanks, Nick.
Regards,
Nick.
Nick.
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.
JobType 0 is a Server, 2 is a Sequence and 3 is a PX Job.
The other method is to issue a
The string "Output" will have the text and you need to parse the job type from that string.
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
The other method is to issue a
Code: Select all
EXECUTE 'SELECT JOBTYPE FROM DS_JOBS WHERE JOB = ':JobName:';' CAPTURING Output RETURNING ErrorCode
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
That stage may be here sooner than you think!
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers