A variable defined in a parameter file cannot be used in a post-session command alone. It must be used along with other session properties like Output file directory or Source file directory for it to be used in the post-session command.
Consider a variable $OutputFileRepSybase that is defined as /home/test in the parameter file.
If this variable is used in a post-session command alone, as in the case of rm $OutputFileRepSybase/f1.txt, the variable will not be expanded and consequently it will fail. However, if the variable is used in Output file directory and then in the post-session command, it works fine.
We needs to create workflow variables (Workflow->Edit->Variables) with their corresponding names mentioned in parameter file. Then use them as $$Variablename.
For example we define 4 variables in parameter file:
Firstly we create corresponding workflow variables, and then we can use them in Post-Session Failure Command like this:
Osql -S $$SERVERNAME -d $$DATABASENAME -U $$USERNAME -P $$PASSWORD -Q”EXEC insert_test” -b >> c:\myscript.log 2>&1