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
Issue in passing value to global parameter
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 75
- Joined: Mon Jul 12, 2010 4:11 am
- Location: Chennai
Re: Issue in passing value to global parameter
Ok, can you paste the error message(s) that it aborts with?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
And what is your logfile file name expression? I'd like to see how you're using the parameter.
-
- Participant
- Posts: 75
- Joined: Mon Jul 12, 2010 4:11 am
- Location: Chennai
Re: Issue in passing value to global parameter
jgreve wrote:Ok, can you paste the error message(s) that it aborts with?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
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#
Ajitha S
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
let's try echoing the param values...
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):
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 ).
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#>"
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 ).
-
- Participant
- Posts: 75
- Joined: Mon Jul 12, 2010 4:11 am
- Location: Chennai
Re: let's try echoing the param values...
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#
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#
Ajitha S