Here's a DFSORT job that will do what you asked for:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
YRMON,S'&YR4.&MON'
/*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
INREC IFOUTLEN=80,
IFTHEN=(WHEN=INIT,
BUILD=(C'PRYR,''YYYY''',81:YRMON)),
IFTHEN=(WHEN=(85,2,CH,EQ,C'01'),
OVERLAY=(7:81,4,ZD,SUB,+1,EDIT=(TTTT))),
IFTHEN=(WHEN=NONE,
OVERLAY=(7:81,4))
/*
//S2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... input file (FB/200)
//SORTOUT DD DSN=... output file (FB/200)
//SYSIN DD *
OPTION COPY
INREC BUILD=(PRYR,1,196)
/*