Page 1 of 1

Issue in passing value to global parameter

Posted: Thu Jul 21, 2011 1:04 am
by ajithaselvan
Hi

There is a unix script has been called from Control M to execute the DS sequence. Below are the parameters we are passing
1. Sequence name
2. Project name
3. Domain
4. Server
5. User
6. password
7. Logfile

The purpose of log file is to store all unix script logs that have been used by the particular sequence. So I have included the logfile as one of the parameters in all unix scripts and I parameterised that in DS job.

Here is my issue
The job is getting aborted, if I declare the logfile as global parameter.
But I'm able to run the job successfully when I declare it as local parameter.

Pls help me to fix this issue

Re: Issue in passing value to global parameter

Posted: Thu Jul 21, 2011 10:44 am
by jgreve
ajithaselvan wrote:The job is getting aborted, if I declare the logfile as global parameter. But I'm able to run the job successfully when I declare it as local parameter. Pls help me to fix this issue
Ok, can you paste the error message(s) that it aborts with?
And what is your logfile file name expression? I'd like to see how you're using the parameter.

Re: Issue in passing value to global parameter

Posted: Fri Jul 22, 2011 12:34 am
by ajithaselvan
jgreve wrote:
ajithaselvan wrote:The job is getting aborted, if I declare the logfile as global parameter. But I'm able to run the job successfully when I declare it as local parameter. Pls help me to fix this issue
Ok, can you paste the error message(s) that it aborts with?
And what is your logfile file name expression? I'd like to see how you're using the parameter.

Script i tried to execute:
bash #DEV_PARAMS.scriptpath#/#DEV_PARAMS.scriptname# #file1# #file2# #DEV_PARAMS.LOGFNAME#
* DEV_PARAMS - is the name of the parameterset
the purpose of the script is to ftp the file from mainframe and place it in unix server.

Warning:
SEQ name..JobControl (@EXEC CMD NAME): Executed: bash /usr/appl/pjt/scripts/ftp_from_mainframe.sh file A File B
Reply=1
SEQ_NAME..JobControl (@EXEC CMD NAME): Command bash did not finish OK, reply = '1'.

Value is not getting passed to logfile.

But script is executed fine if i do the below change
bash #DEV_PARAMS.scriptpath#/#DEV_PARAMS.scriptname# #file1# #file2# #LOGFNAME#

Posted: Fri Jul 22, 2011 3:34 am
by ray.wurlod
Is the parameter name (in the parameter set) really all upper case? These names are case sensitive.

let's try echoing the param values...

Posted: Mon Jul 25, 2011 12:37 pm
by jgreve
You've got a couple of things going on here:
1) Control-M calls a datastage launcher script.
2) The datastage launcher script launches a sequencer
3) The sequencer launches datastage jobs (apparently parallel jobs).

Are you invoking your script from the datastage job(s) with after job "execSH" routines?


Once you get inside of datastage, I'm curious about what your datastage param values actually are. Try running with this (all one line, and the double-quotes are significant; please leave them in):

Code: Select all

bash echo "scriptpath=<#DEV_PARAMS.scriptpath#> scriptname=<#DEV_PARAMS.scriptname#> file1=<#file1#> file2=<#file2#> logname=<#DEV_PARAMS.LOGFNAME#> just logname=<#LOGFNAME#>"
Then post the result of your sequencer & job(s) from the director log? This would be from the part where your log says something like "jobname...: AfterJob (ExecSH): Executed command: echo..." - post all of that.

Also please look at the beginning of the run on the director log for your sequencer and the datastage parallel job you tested on, where it says "Starting Job..." and post those values too please.

(I'd ask you to just go back to the director log preamble and grab the job parameters from there, but I suspect our next step will be running your script and redirecting its output to /tmp/test.dat ).

Re: let's try echoing the param values...

Posted: Tue Aug 02, 2011 6:56 am
by ajithaselvan
Thanks jgreve for the reply.
Here is my response.
I'm invoking the scripts using execSH" routines and in sequence job using execute command activity.

This issue is resolved by hardcoding the parameter name in the script called from control M.

I tried executing the script which you have provided.
Values are getting passed for all the parameters except #DEV_PARAMS.LOGFNAME#