Try this.
$$ add to fil file
_OUTPT=MACRO/
WWRD=POSTF(31,1,23) $$ Check value ofW word
IF (WWRD.NE.999999) THEN
$$ It is not empty
WVAL=WWRD
XX=POSTF(31,19) $$ Output block as it is
ELSE
XX=POSTF(31,2,23,WVAL) $$ Add QVAL to the block
XX=POSTF(31,19) $$ Output the block
ENDIF
TERMAC
$$ Addto cycle macro
CIMFIL/ON,CYCLE
CYCTYP = POSTF(7,4)
TYP=POSTF(7,4)
CASE/TYP
WHEN/ICODEF(DEEP)
XX=POSTF(2,1,4667,1) $$ Enable _OUTPT macro
WHEN/ICODEF(OFF)
Xx=POSTF(2,1,4667,0) $$ Disable _OUTPT macro
ENDCAS
XX=POSTF(13) $$ Process
CIMFIL/OFF