I have assumed you records are FB and 80 bytes long.
If you are one who likes to learn, add this into your JCL (say, before SYSIN):
//SYMNAMES DD *
INPUT-RECORD,1,80,CH
EXTEND-FOR-INCLUDE-VALUE,*,3,CH
TEXT-TO-CHECK,1,=,=
TEXT-FOR-COPY-TO-END,C'ram'
//SYMNOUT DD SYSOUT=*
Use these as your control cards:
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,
BEGIN=(TEXT-TO-CHECK,
EQ,
TEXT-FOR-COPY-TO-END),
PUSH=(EXTEND-FOR-INCLUDE-VALUE:
TEXT-TO-CHECK))
OUTFIL INCLUDE=(EXTEND-FOR-INCLUDE-VALUE,
EQ,
TEXT-FOR-COPY-TO-END)
If you just want a solution, try this:
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'ram'),
PUSH=(81:1,3))
OUTFIL INCLUDE=(81,3,CH,EQ,C'ram')