How to pass i/p file name as parameter while running a graph by wrapper(back end ) ?

Showing Answers 1 - 1 of 1 Answers

Kannan

  • Sep 8th, 2006
 

Hi All,

You can pass the i/p file name as parameter using Graph level parameter which is for particularly first graph if this graph only using that input file and another parameter file for another graph. Here  i have given the wrapper if you are using graph level script.

------------------------------------------------------------------------------

#!/bin/ksh

#Running the set up script on enviornment
typeset PROJ_DIR="$(cd $(dirname $0)/..; pwd)"
. $PROJ_DIR/ab_project_setup.ksh $PROJ_DIR

#Exporting the script parameter1 to INPUT_FILE_NAME
if [ $# -ne 2 ];
then
  INPUT_FILE_PARAMETER_1=$1
  INPUT_FILE_PARAMETER_2=$2
 
  # This grpah is using the input file
  cd $AI_RUN
  ./my_graph1.ksh $INPUT_FILE_PARAMETER_1

  # This graph also is using the input file.
  ./my_graph2.ksh $INPUT_FILE_PARAMETER_2

  exit 0;
else
 echo "Insufficient parameters"
 exit 1;
fi
------------------------------------------------------------------------------

Another way, You can also use the Sandbox Parameter for if you are uing that input file more than one times in project then you have to use this option. Firstly, you have create a Parameter in Sandbox then set the properies alike scope must be set as "formal". and the value of parameter value must be exported before running this graph script in wrapper script.

-------------------------------------

#!/bin/ksh

#Running the set up script on enviornment
typeset PROJ_DIR="$(cd $(dirname $0)/..; pwd)"
. $PROJ_DIR/ab_project_setup.ksh $PROJ_DIR

#Exporting the script parameter1 to INPUT_FILE_NAME
export INPUT_FILE_NAME=$1

# This grpah is using the input file
cd $AI_RUN
./my_graph1.ksh

# This graph also is using the input file.
./my_graph2.ksh

exit 0;

--------------------------------------------------------------------------

Hopefulyy this would help to understand with scripts.

Thanks

Kannan.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions