We have a requirement to generalize the sort cards by using symbolic parameters; this is to avoid writing different SORT cards for similar requirements. Same is required for instances where a particular field in the sort key can change depending on the user's requirement; for example: key contains sequence numbers, and the user wants to sort only on seq: 1 or seq: 2; here the values 1/2 will be input by the user and be passed to SORT cards through JP variables. I'd coded a test SORT card for this, the below piece being only a workaround solution to the actual problem:
// SEQ='1' * PASS SEQUENCE HERE
//STEP001 EXEC PGM=SORT,COND=(0,NE),PARM=('JP1"&SEQ"')
//SYSOUT DD SYSOUT=*
//SYMNOUT DD SYSOUT=*
//SORTIN DD DSN=&EDSEG.1,DISP=SHR
//SORTOUT DD DSN=&FINALEXT,
//SYSIN DD *
OUTFIL INCLUDE=((26,1,CH,EQ,JP1),AND, <-- problematic line
The challenge that I'm facing here is SYMNAMES post translation converts i/p to C'<passed value>'; my i/p being a numeric value; ideally the correct SORT card should be as below post translation:
I've tried passing the entire SORT card itself through the JP parameters, but even then post translation value is still not what I am looking for. Had to replace ZD with a CH to deliver the solution as a temp fix.
Is there a way to achieve the above result (basically getting a numeric value passed through symbolics in SORT) using a symbolic SORT card?
The current translated SORT card appears as below: