HOW TO: Use PowerCenter service variables in a Command task
Solution
To use PowerCenter service variables, service process variables, built-in variables or parameters in a PowerCenter Command task, do the following:
Windows
1.Create a batch file.
2.Add the parameter value to the batch file.
Example
echo $PMRepositoryServiceName >c:\environment.txt
echo $PMRepositoryUserName >>c:\environment.txt
1.Save the batch file.
2.Create the Command task in a workflow.
3.Call the batch file from the command task.
UNIX
1.Create a shell script file.
2.Add the parameter value to the shell script file.
Example
echo $PMRepositoryServiceName >~/environment.txt
echo $PMRepositoryUserName >>/export/home2/pc851/environment.txt
1.Save the shell script file.
2.Create the Command task in a workflow.
3.Call the shell script file from the command task.
More Information
The parameters used are only applicable for PowerCenter 8.5.x and later releases, but the functionality does exist in 8.1.x as well.
For 8.1.1 the following can be done as well:
echo $PMWorkflowLogDir >> /export/home2/pc811sp4/environment.txt
Reference
PowerCenter Advanced Workflow Guide > "Parameter Files" > "Where to Use Parameters and Variables" > "Task Input Fields that Accept Parameters and Variables"