You cannot directly pass parm values to DFSORT , however you can create a symnames dataset (FB lrecl=80) and pass the value. Look at the example below. This job will give the last date of CURRENT MONTH-1 AND CURRENT MONTH-2 . Today is July 22 , you would get the last dates of June and May.
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
PVALUE,C'XX'
//SORTIN DD *
A
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,BUILD=(DATE2,C'01',X,DATE2-1,C'01')),
IFTHEN=(WHEN=INIT,
OVERLAY=(20:1,8,Y4T,TOJUL=Y4T,30:10,8,Y4T,TOJUL=Y4T)),
IFTHEN=(WHEN=(24,3,ZD,EQ,1),
OVERLAY=(01:1,4,ZD,SUB,+1,EDIT=(TTTT),C'1231',
20:1,8,Y4T,TOJUL=Y4T),HIT=NEXT),
IFTHEN=(WHEN=(34,3,ZD,EQ,1),
OVERLAY=(10:10,4,ZD,SUB,+1,EDIT=(TTTT),C'1231',
30:10,8,Y4T,TOJUL=Y4T),HIT=NEXT),
IFTHEN=(WHEN=(28,1,CH,EQ,C' '),
OVERLAY=(24:24,3,ZD,SUB,+1,EDIT=(TTT),
40:20,7,Y4T,TOGREG=Y4T),HIT=NEXT),
IFTHEN=(WHEN=(38,1,CH,EQ,C' '),
OVERLAY=(34:34,3,ZD,SUB,+1,EDIT=(TTT),
50:30,7,Y4T,TOGREG=Y4T),HIT=NEXT),
IFTHEN=(WHEN=(40,1,CH,EQ,C' '),OVERLAY=(40:20,7,Y4T,TOGREG=Y4T)),
IFTHEN=(WHEN=(50,1,CH,EQ,C' '),OVERLAY=(50:30,7,Y4T,TOGREG=Y4T))
OUTREC BUILD=(C'ABCDEFG', $ CONSTANT
PVALUE, $ PARM FROM SYMNAMES
C'0000', $ CONSTANT
40,8,Y4T,DTNS=(MDY), $ LAST MONTH LAST DATE
50,8,Y4T,DTNS=(MDY), $ LAST 2 MONTH LAST DATE
80:X) $ PAD SPACES UPTO 80
//*