ALARM is a record level keyword to tell IBM i operating system to activate the audible alarm when the record format defined in the DSPF with which this keyword is associated is being displayed. The alarm is of short duration.
- DSPF using ALARM keyword
- RPGLE program to display record of DSPF using ALARM keyword
A R RCD1 A 10 ALARM
Here, we defined record format RCD1 and used record level keyword ALARM and associated indicator 10 with it which means when indicator 10 will be then only this keyword would be activated during record format display. Create this DSPF named DSPF_1 using option 14 or CRTDSPF command.Now, we need to create the RPGLE program to display this DSPF record format.
FDSPF_1 CF E WORKSTN /Free *in10 = *on; exfmt RCD1; *in10 = *off; *inlr = *on; /End-Free
In this program, we declared display file DSPF_1 in combined mode to perform both input output operation. Then, we set indicator *IN10 to ON and then EXFMT(write/read) the record format RCD1 of the display file DSPF_1.Once this record format executed. It will first check if indicator associated with ALARM keyword is ON then only OS will activate this audible alarm for the short duration. Therefore, after this EXFMT we will reset this indicator *IN10 to OFF and the last record indicator to ON.