Check job name,project name existence

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
meet_deb85
Premium Member
Premium Member
Posts: 132
Joined: Tue Sep 04, 2007 11:38 am
Location: NOIDA

Check job name,project name existence

Post by meet_deb85 »

Hi all,
I am wokring on a log generation utility using unix shell scripting,here i m trying to find out existence of job name and project name in DS server.Is there any unix command to retrieve these information,any suggestion.?? I want to write script like
Nagaraj
Premium Member
Premium Member
Posts: 383
Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore

Uv command

Post by Nagaraj »

may be you can use a uv command to LIST all the job names in the project directry, and write it to a file and then search in that file....this shd give you the syntax.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There are dsjob options to list all projects and to list all jobs in a project, those should get you exactly what you need.
-craig

"You can never have too many knives" -- Logan Nine Fingers
meet_deb85
Premium Member
Premium Member
Posts: 132
Joined: Tue Sep 04, 2007 11:38 am
Location: NOIDA

Re: Uv command

Post by meet_deb85 »

Nagaraj wrote:may be you can use a uv command to LIST all the job names in the project directry, and write it to a file and then search in that file....this shd give you the syntax.
Yes that i am thinking,but how can go to UV prompt and save job name to file....
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Why don't you try the command level API dsjob. That does all the work for you.

To log into UV schema, you need to know the correct project name. So if the project name is incorrect, that itself will fail. Which means you will have to list all schemas available to locate the project first.

So no point going in this direction.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

Without going into details (meaning: please don't offer advice on improving this, I fought that fight and lost), here is a sample Unix line to retrieve log messages.

Code: Select all

if [[ ${JobStat} == ${DSJS_RUNFAILED} ]]; then
            ErrorDisplay=$(${G_DS_HOME}/bin/dsjob -logsum -type FATAL
            -max {MaxDsplyErrors} ${G_DS_PROJ_NAME} ${IJOB})
            Info_Msg "${ErrorDisplay}"
fi
"Info_Msg" is an home-grown utility to direct echoes to the log file. In this example, I'm only interested in the last 10 (-max) fatal error messages, and in my case I maintain a text file for each sequencer and the jobs it invokes (IJOB). I have looping involved, but I don't want to crowd this example. All of the parameters are explained in the Advanced User Guide at the section header "Command Line Interface" at the bullet "Accessing Log Files".
Post Reply