***************************************************************** * * Module Name: CONDHDLRD * * This is the display file used by the CONDHDLR service program. * * Here are the steps you should follow to install this * display file and the CONDHDLR service program. * * 1) Compile this display file CONDHDLRD (option 14 PDM) * 2) Compile module CONDHDLR with option 15 in PDM (CrtRpgMod) * 3) Execute the following command: * CrtSrvPgm SrvPgm( CONDHDLR ) Export( *All ) ActGrp( SrvPgmAct ) * * To run the condition handler demo software do the following: * * 1) Compile physical file CUST (option 14 in PDM) * 2) Use DFU or a third party file editor to put a couple of * records into CUST. The only thing that really needs to be * filled in for the purposes of this demo is the customer number * (CuNum). For simplicity use customer numbers 1 and 2 * 3) Issue the following command: * ChgPf File( Cust ) WaitRcd( *Immed ) * Note, when using the CONDHDLR service program, this command * should be issued for any file in which you want the pCondHdlr * procedure to handle file lockout conditions. This will eliminate * a waiting period for the record to be unlocked. * 4) Compile display file TSTDSPF (PDM option 14) * 5) Compile ILE RPG module TSTCNDHDLR with option 15 (CrtRpgMod) * 6) Issue the following command * * CrtPgm Pgm( TSTCNDHDLR ) ActGrp( *Caller ) BndSrvPgm( CONDHDLR ) * 7) Sign on to a second interactive session so you now have 2 * interactive sessions. * 8) In interactive session 1), Call TSTCNDHDLR. * 9) Fill in customer number 1 and press Enter. * 10) Without modifying the record, jump over to your second * interactive session and repeat steps 8 and 9 over there. * 11) You should see the record locked window. You can try either * of the replies and see what happens. * ***************************************************************** A DSPSIZ(24 80 *DS3) A R W01 A WINDOW(*DFT 15 50) A WDWBORDER((*COLOR WHT) (*DSPATR RI)- A (*CHAR ' ')) A 1 13'Record Locked Notification' A COLOR(WHT) A JOBID 28A O 11 17COLOR(WHT) A 3 3'This program has attempted to plac- A e a lock' A COLOR(WHT) A 4 3'on a record which is already locke- A d.' A COLOR(WHT) A 11 2'Job:' A COLOR(WHT) A 6 2'File:' A COLOR(WHT) A FILENAME 10 O 6 17COLOR(WHT) A 7 2'Library:' A COLOR(WHT) A FILELIB 10 O 7 17COLOR(WHT) A 8 2'Member:' A COLOR(WHT) A MBRNAME 10 O 8 17COLOR(WHT) A 9 2'Record No:' A COLOR(WHT) A RECNO 5Y 0O 9 17COLOR(WHT) A EDTCDE(J) A 13 3'Reply C to cancel or R to retry:' A DSPATR(RI) A SCREPLY 1 I 13 38VALUES('C' 'R') A R DUMMY A ASSUME A 3 7'x'