This example shows total-only processing using a new record format.
DCLF FILE(FINTOT) DCL &COUNTA *CHAR LEN(7) DCL &TOTAMTA *CHAR LEN(9) OVRDBF FILE(FINTOT) TOFILE(FILEA) SHARE(*YES) OPNQRYF FILE(FILEA) FORMAT(FINTOT) MAPFLD((COUNT '%COUNT') + (TOTAMT '%SUM(AMT)')) RCVF CLOF OPNID(FILEA) CHGVAR &COUNTA &COUNT CHGVAR &TOTAMTA &TOTAMT SNDPGMMSG MSG('COUNT=' *CAT &COUNTA *CAT + ' Total amount=' *CAT &TOTAMTA); DLTOVR FILE(FINTOT)
You must convert the numeric fields to character fields to include them in an immediate message.