Page 1 of 1

UNIX Commad line - no wait required upon invoking the job

Posted: Tue Jun 25, 2013 11:29 am
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}

Posted: Tue Jun 25, 2013 11:48 am
by prasson_ibm
Try with running in background. Just put && to the end of command.

Posted: Tue Jun 25, 2013 1:10 pm
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 ?

Posted: Tue Jun 25, 2013 1:27 pm
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.

Posted: Tue Jun 25, 2013 2:05 pm
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

Posted: Tue Jun 25, 2013 2:28 pm
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?

Posted: Tue Jun 25, 2013 4:42 pm
by ray.wurlod
Try preceding the job run request with nohup

Posted: Tue Jun 25, 2013 6:03 pm
by chulett
Shouldn't be necessary... or do you not agree?

Posted: Tue Jun 25, 2013 10:16 pm
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.

Posted: Wed Jun 26, 2013 5:23 am
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.

Posted: Wed Jun 26, 2013 3:49 pm
by ray.wurlod
What exactly do you mean by "didn't work"? :?

Posted: Mon Jul 01, 2013 4:31 am
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.