Er moet een programma worden geschreven dat een verbale tijdmelding geeft. Als het 8 uur 25 is, dan moet het programma melden: het is nu acht uur vijfentwintig. Het programma vraagt de systeemtijd op en geeft uitvoer op het standaarduitvoermedium.
illustratie: Geert Nijmolen
identification division. program-id. VERBALE-TIJDMELDING. *Auteur: Andree Hollander *Datum: 1988/08/08 data division. working-storage section. 01 KLEINTABEL. 02 pic x(36), value "een twee drie vier". 02 pic x(36), value "vijf zes zeven acht". 02 pic x(36), value "negen tien elf twaalf". 02 pic x(36), value "dertien veertien vijftien zestien". 02 pic x(36), value "zeventienachttien negentien". 01 redefines KLEINTABEL. 02 KLEIN pic x(9) occurs 19 times. 01 TIGTABEL value "tien twintigdertig veertigvijftig". 02 TIG pic x(7) occurs 5 times. 01 SYSTEEMTIJD. 02 UREN pic 99. 02 MINUTEN pic 99. 01 GETAL pic 99. 01 redefines GETAL. 02 TIENTAL pic 9. 02 EENHEID pic 9. 01 WIJZER pic 99, value 1. 01 UITVOERREGEL. 02 pic x(10), value "Het is nu ". 02 VERBAAL pic x(32), value spaces. procedure division. HOOFD. accept SYSTEEMTIJD from time if UREN = zero then string "nul" delimited by size into VERBAAL with pointer WIJZER else move UREN to GETAL perform ZEGHET end-if string " uur " delimited by size into VERBAAL with pointer WIJZER if MINUTEN not = zero then move MINUTEN to getal perform ZEGHET end-if display UITVOERREGEL stop run. ZEGHET. if getal < 20 then string KLEIN(GETAL) delimited by space into VERBAAL with pointer WIJZER else if EENHEID = zero then string TIG(TIENTAL) delimited by space into VERBAAL with pointer WIJZER else string KLEIN(EENHEID) delimited by space "en" delimited by size TIG(TIENTAL) delimited by space into VERBAAL with pointer WIJZER end-if end-if.