My problem
I have created a Windows cmd file
test.cmd
which is expecting two parameters to be passed toKitchen.bat
(Pentaho).I call
test.cmd
in Windows command line by passing two parameters:test.cmd 1 2
In Spoon (designer), I write the two parameters to a log file.
After the job completed, I still seeing the variable itself instead of the value (1 2) that I have passed.
What I have tried?
Firstly, I doubt that the "param" in the bat file got problem (where it takes the value and pass to the kitchen.bat), so I googled and I have tried all the possible solution, below is what I tried.
"-param:A=%A%"
"/param:A=%A%"
/param "A:%A%"
'/param:"A=%A%"'
Unfortunately, non of these are working.
Here is my source code
test.bat:
echo "Starting Job.."
echo "printing parameter.."
echo %1
echo %2
Set A=%1
Set B=%2
set LOG_PATH=C:\App\Reporter\Pentaho\Config\Utilities\Import.log
Set CONFIG_PATH=C:\App\Reporter\Pentaho\Config\Utilities
C:\App\REPORTER\Pentaho\Env\V8.2\kitchen.bat /file:"CONFIG_PATH"\test.kjb "/level=Basic" "/logfile=%LOG_PATH%" "-param:A=%A%" "-param:B=%B%"
pause
Windows command line:
C:......>test.cmd 1 2
Pentaho KJB:
I use "write to log" function to retrieve the value from the variable.
V1 = ${A}
V2 = ${B}
Here the result
V1 = ${A}
V2 = ${B}
Showing variable itself instead of the actual values (1, 2).