My program has to print a dataset to a form ID. This is the syntax generally:

SYSOUT=4,OUTPUT=*.XACT6,RECFM=FBA

But the Output variable (XACT6) has to be generated from the program based on who sends the file. The mapping will be done in a DB2 table. So

if A sends the file the Output statement should look like
"OUTPUT=*.XACT1,RECFM=FBA"

if D sends the file the Output statement should look like
"OUTPUT=*.XACT4,RECFM=FBA"

The DB2 table will have the mapping of A to XACT1 and D to XACT4.

But the problem is how to code this in the JCL as it is created from the previous step in the program. Even though I declare it as a symbolic parameter , where can I pass its value from. The assigning of the value to a symbolic parameter should be through a SET statement again which I can hard code.