Issue in passing value to global parameter

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
ajithaselvan
Participant
Posts: 75
Joined: Mon Jul 12, 2010 4:11 am
Location: Chennai

Issue in passing value to global parameter

Post 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
Ajitha S
jgreve
Premium Member
Premium Member
Posts: 107
Joined: Mon Sep 25, 2006 4:25 pm

Re: Issue in passing value to global parameter

Post 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.
ajithaselvan
Participant
Posts: 75
Joined: Mon Jul 12, 2010 4:11 am
Location: Chennai

Re: Issue in passing value to global parameter

Post 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#
Ajitha S
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Is the parameter name (in the parameter set) really all upper case? These names are case sensitive.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jgreve
Premium Member
Premium Member
Posts: 107
Joined: Mon Sep 25, 2006 4:25 pm

let's try echoing the param values...

Post 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 ).
ajithaselvan
Participant
Posts: 75
Joined: Mon Jul 12, 2010 4:11 am
Location: Chennai

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

Post 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#
Ajitha S
Post Reply