UNIX Commad line - no wait required upon invoking the job

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
Aquilis
Participant
Posts: 204
Joined: Thu Apr 05, 2007 4:54 am
Location: Bangalore
Contact:

UNIX Commad line - no wait required upon invoking the job

Post by Aquilis »

Hi,

Am trying to execute the datastage jobs from UNIX without waiting for the job completion. I just wanted to trigger the datastage job without waiting for the job status.

I just need to trigger the DS Jobs and nothing else is expected. Currently command is waiting for the Job status, which is not expected. Can any one help me on this.

Below is the command line which is being used in unix script.

Code: Select all

dsjob  -domain $DS_DOMAIN  -user $DS_USER  -password $DS_PASSWORD  -server $DS_SERVER -run -mode NORMAL  -warn 0 -param ${DS_PARAMETERSET_LIST} -param ${DS_PARAMSETNAME}=${DS_PARAMSETVALUE} -param jpFileName=${FILE_NAME} -param jpFileExtn=${FILE_EXTN} -jobstatus ${DS_PROJECT} ${DS_JOBNAME}.${FILE_NAME}
Aquilis
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Try with running in background. Just put && to the end of command.
Aquilis
Participant
Posts: 204
Joined: Thu Apr 05, 2007 4:54 am
Location: Bangalore
Contact:

Post by Aquilis »

Even though & at the end of the command line triggers the multiple jobs with different instances, but still script is waiting for completion of that particular instance.

Does -jobstatus option ?
Aquilis
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Both -jobstatus and -wait make it wait for completion so it can report the appropriate status back to you. If you don't want it to wait, do not include either option.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Aquilis
Participant
Posts: 204
Joined: Thu Apr 05, 2007 4:54 am
Location: Bangalore
Contact:

Post by Aquilis »

Yes. Even after removing the -jobstatus option, job instance going under wait mode.

Here goes the piece from scriptm used for invokation -

Code: Select all

cat ${APP_WRK_DIR}elm_list_of_files.txt | while read line;
do

FILE_NAME=`echo ${line} | cut -d'.' -f1`
FILE_EXTN=`echo ${line} | cut -d'.' -f2`

### Reset Datastage if job status was unsuccessfull during last run.
${DS_BIN_DIR}/$DSJOB_LOGON_CLAUSE -jobinfo ${DS_PROJECT} ${DS_JOBNAME}.${FILE_NAME}| grep "RUN OK"
JOB_INFOSTATUS=$?
if [ ${JOB_INFOSTATUS} -ne 0 ]
  then
      ${DS_BIN_DIR}/$DSJOB_LOGON_CLAUSE -run -mode RESET ${DS_PROJECT} ${DS_JOBNAME}.${FILE_NAME}
  else
      echo "Previous Run Successful"
fi

### Run DataStage job
echo " ***** Process Initiated for manual file ${FILE_NAME} ****** "
${DS_BIN_DIR}/$DSJOB_LOGON_CLAUSE -run -mode NORMAL  -param ${DS_PARAMETERSET_LIST} -param ${DS_PARAMSETNAME}=${DS_PARAMSETVALUE} -param jpFileName=${FILE_NAME} -param jpFileExtn=${FILE_EXTN} ${DS_PROJECT} ${DS_JOBNAME}.${FILE_NAME} &

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

Post by chulett »

Well, that's certainly not the documented behaviour nor what I recall from personal experience in the past. Perhaps contacting your official support provider is in order?

Out of curiousity, what exactly is in your $DSJOB_LOGON_CLAUSE variable?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try preceding the job run request with nohup
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Shouldn't be necessary... or do you not agree?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Agree, shouldn't be necessary if dsjob behaves as we believe it does, but it will force asynchronous execution of the command unconditionally.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Aquilis
Participant
Posts: 204
Joined: Thu Apr 05, 2007 4:54 am
Location: Bangalore
Contact:

Post by Aquilis »

nohup didn't work either.

Thinking on the situation I just redirected the stdout & stderr :idea: . Just to rest in peace.

Code: Select all

${DS_BIN_DIR}/$DSJOB_LOGON_CLAUSE -run -mode NORMAL  -param ${DS_PARAMETERSET_LIST} -param jpFileName=${FILE_NAME} -param jpFileExtn=${FILE_EXTN} ${DS_PROJECT} ${DS_JOBNAME}.${FILE_NAME} > /dev/null 2>&1
thanks to you guys for suggesting multiple options.
Aquilis
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What exactly do you mean by "didn't work"? :?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Aquilis
Participant
Posts: 204
Joined: Thu Apr 05, 2007 4:54 am
Location: Bangalore
Contact:

Post by Aquilis »

Forgive... Didn't address the core issue.

'dsjob' command is trying to write stdout into "nohup.out " file, causing job to wait.

To resolve what we did is, redirected both stdout and stderr into /dev/null.
Aquilis
Post Reply