The standard commit (STDCMT) processing program performs the functions required to communicate with a single notify object used by all applications.
While the commitment control function automatically writes an entry to the notify object, a user-written standard program must process the notify object. The standard program simplifies and standardizes the approach.
The program is written to verify the parameters that were passed and perform the appropriate action as follows:
The following example shows the standard commit processing program, STDCMT.
SEQNBR *... ... 1 ... ... 2 ... ... 3 ... ... 4 ... ... 5 ... ... 6 ... ... 7 .. 1.00 FNFYOBJP UF E K DISK A 2.00 ICMTID DS 3.00 I 1 10 UNQUSR 4.00 I 11 20 UNQPGM 5.00 I 21 220 BIGFLD 6.00 C *ENTRY PLIST 7.00 C PARM RQSCOD 1 8.00 C PARM RTNCOD 1 9.00 C PARM CMTID 220 10.00 C UNQUSR CABEQ*BLANKS BADEND H1 Invalid 11.00 C UNQPGM CABEQ*BLANKS BADEND H2 Invalid 12.00 C* 13.00 C* 'O' for Open 14.00 C* 15.00 C RQSCOD IFEQ 'O' Open 16.00 C SETON 98 End LR 17.00 C GOTO END 18.00 C END 19.00 C* 20.00 C* 'C' for Close 21.00 C* 22.00 C RQSCOD IFEQ 'C' Close 23.00 C SETOF 98 24.00 C GOTO END 25.00 C END 26.00 C* 27.00 C* 'R' for Read - Get last record for the key 28.00 C* 29.00 C RQSCOD IFEQ 'R' Read 30.00 C KEY KLIST 31.00 C KFLD UNQUSR 32.00 C KFLD UNQPGM 33.00 C KEY CHAINNFYOBJR 51 Not found 34.00 C 51 MOVE '0' RTNCOD 35.00 C 51 GOTO END 36.00 C MOVE '1' RTNCOD Found 37.00 C LOOPl TAG 38.00 C KEY READENFYOBJR 20 EOF 39.00 C 20 GOTO END 40.00 C GOTO LOOP1 41.00 C END 42.00 C* 43.00 C* 'W' FOR Write 44.00 C* 45.00 C RQSCOD IFEQ 'W' Write 46.00 C WRITENFYOBJR 47.00 C GOTO END 48.00 C END 49.00 C* 50.00 C* 'D' for Delete - Delete all records for the key 51.00 C* 52.00 C RQSCOD IFEQ 'D' Delete 53.00 C KEY CHAINNFYOBJR 51 Not found 54.00 C 51 MOVE '0' RTNCOD 55.00 C 51 GOTO END 56.00 C MOVE '1' RTNCOD Found 57.00 C LOOP2 TAG 58.00 C DELETNFYOBJR 59.00 C KEY READENFYOBJR 20 EOF 60.00 C N20 GOTO LOOP2 61.00 C GOTO END 62.00 C END 63.00 C* 64.00 C* 'S' for Search for the last record for this user 65.00 C* (Ignore the -Program- portion of the key) 66.00 C* 67.00 C RQSCOD IFEQ 'S' Search 68.00 C UNQUSR SETLLNFYOBJR 20 If equal 69.00 C N20 MOVE '0' RTNCOD 70.00 C N20 GOTO END 71.00 C MOVE '1' RTNCOD Found 72.00 C LOOP3 TAG 73.00 C UNQUSR READENFYOBJR 20 EOF 74.00 C N20 GOTO LOOP3 75.00 C GOTO END 76.00 C END 77.00 C* 78.00 C* Invalid request code processing 79.00 C* 80.00 C SETON H2 Bad RQS code 81.00 C GOTO BADEND 82.00 C* 83.00 C* End of program processing 84.00 C* 85.00 C END TAG 86.00 C N98 SETON LR 87.00 C RETRN 88.00 C* BADEND tag is used then fall thru to RPG cycle error return 89.00 C BADEND TAG