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:
// SET EDSEG=XXXX.XXX.XXX.XXXX,
// FINALEXT=XXXX.XXX.XXX.XXXXXX.XXXX,
// 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,
// DISP=(NEW,CATLG,DELETE),UNIT=(SYSDA),
// SPACE=(TRK,(10,20),RLSE),DCB=(RECFM=FB,LRECL=60)
//SYSIN DD *
SORT FIELDS=COPY
OMIT COND=((1,3,CH,EQ,C'000'),OR,
(1,3,CH,EQ,C'999'))
OUTFIL INCLUDE=((26,1,CH,EQ,JP1),AND, <-- problematic line
(27,2,ZD,EQ,99),AND,
(34,1,CH,EQ,C' ')),
BUILD=(1:1,22,23:67,4,PD,EDIT=(TTTTTTT),LENGTH=7,
30:85,19,12X)
/*
// FINALEXT=XXXX.XXX.XXX.XXXXXX.XXXX,
// 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,
// DISP=(NEW,CATLG,DELETE),UNIT=(SYSDA),
// SPACE=(TRK,(10,20),RLSE),DCB=(RECFM=FB,LRECL=60)
//SYSIN DD *
SORT FIELDS=COPY
OMIT COND=((1,3,CH,EQ,C'000'),OR,
(1,3,CH,EQ,C'999'))
OUTFIL INCLUDE=((26,1,CH,EQ,JP1),AND, <-- problematic line
(27,2,ZD,EQ,99),AND,
(34,1,CH,EQ,C' ')),
BUILD=(1:1,22,23:67,4,PD,EDIT=(TTTTTTT),LENGTH=7,
30:85,19,12X)
/*
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:
OUTFIL INCLUDE=((26,1,ZD,EQ,1),AND,
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:
SORT FIELDS=COPY
OMIT COND=((1,3,CH,EQ,C'000'),OR,(1,3,CH,EQ,C'999'))
OUTFIL INCLUDE=((26,1,CH,EQ,C'1'),AND,(27,2,ZD,EQ,99),AND,(34,1,CH,EQ,*
C' ')),BUILD=(1:1,22,23:67,4,PD,EDIT=(TTTTTTT),LENGTH=7,*
30:85,19,12X)
OMIT COND=((1,3,CH,EQ,C'000'),OR,(1,3,CH,EQ,C'999'))
OUTFIL INCLUDE=((26,1,CH,EQ,C'1'),AND,(27,2,ZD,EQ,99),AND,(34,1,CH,EQ,*
C' ')),BUILD=(1:1,22,23:67,4,PD,EDIT=(TTTTTTT),LENGTH=7,*
30:85,19,12X)
Thanks.