********************************************************************** * To Compile: * * CRTBNDRPG PGM(xxx/CSTMNT) SRCFILE(xxx/QRPGLESRC) * ********************************************************************** FCustomer UF A E K Disk D CustomerData E DS ExtName(Customer:CustRec) D CustData S Like(CustomerData) D Valid S N D Total S 5S 0 Inz(0) D StatusCode S 5S 0 Inz(0) D RecordLock C Const(01218) D Result2Big C Const(00103) D RecLckMsg C Const('Record Locked') D FileMsg C Const('Some File Error') D PgmMsg C Const('Some Program Error') D ResultMsg C Const('Result too large') D CatchAllMsg C Const('Catch all for non-trapped') C *Entry Plist C Parm CustData C Monitor C Eval CustomerID = %SubSt(CustomerData:1:8) C DoU %Status <> RecordLock C CustomerID Chain Customer C EndDo C If %Found C ExSr Validate C If Valid C Eval Total = Total + 1 C Update Custrec C EndIf C Else C ExSr Validate C If Valid C Write Custrec C EndIf C Endif * Begin error trapping for any error with Monitor group C On-Error RecordLock C RecLckMsg Dsply C On-Error *FILE C Eval StatusCode = %Status C StatusCode Dsply C FileMsg Dsply C On-Error Result2Big C ResultMsg Dsply C On-Error *PROGRAM C Eval StatusCode = %Status C StatusCode Dsply C PgmMsg Dsply C On-Error *ALL C CatchAllMsg Dsply C EndMon C Eval *InLr = *On ********************************************************************* * Validate subroutine - validate data before updating ********************************************************************* C Validate BegSr C Eval CustomerData = CustData C Eval Valid = *On C EndSr