what you want to do is symbolically create your DSN for the ERRFILE and use the same substitution values to modify your instream data.
i can think of two choices:
A) modify the SYSIN input before the JCL is executed (leaving it instream)
B) modify the SYSIN input in a previous STEP (SYSIN would be temp DS)
A - write a REXX (or COBOL or PL1 or ASM) to generate the JCL, modifying the instream data on-the-fly and either SUBMIT or write it to INTRDR (or however you spell it!! Need to check out the REXX forum for this stuff.
you might beable to modify the dataset containing your SYSIN data (or use it as input and generate a temp ds for input to the SYSIN) with DFSORT/ICETOOL when Frank checks in
write a program that inputs the JCL SYMBOLICs as PARM= parameters and resolve the symbols in the ds for input to the SYSIN - for that you may have to go to another forum (appl progm)
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.