{ "header": { "version": 1, "type": "record" }, "body": { "record1": { "<1>": "declare subroutine record_lock\r\ndeclare function msg\r\n$insert logical\r\n$insert annual_contracts_equ\r\n$insert msg_equates\r\n\r\nListId = 'AC_ID*':@station\r\nACKey = xlate( 'SYSLISTS', ListId, 1, 'X' )\r\nif ACKey then\r\n * check to see if open for this customer\r\n ACRec = xlate( 'ANNUAL_CONTRACTS', ACKey, '', 'X' )\r\n CustNo = .cust_no->text\r\n WrongCust = false$\r\n ErrMsg = ''\r\n if ACRec <> CustNo then\r\n ErrMsg:= 'Annual Contract ':ACKey:' is an Annual Contract for ':oconv( ACRRec, '[XLATE_CONV,COMPANY*CO_NAME]' )\r\n ErrMsg:= ' not ':oconv( CustNo, '[XLATE_CONV,COMPANY*CO_NAME]' )\r\n WrongCust = true$\r\n end\r\n WrongStat = false$\r\n if ACRec <> 'O' then\r\n if ErrMsg then\r\n ErrMsg:= ' and is not OPEN'\r\n end else\r\n ErrMsg:= 'Annual Contract ':ACKey:' is not OPEN'\r\n end\r\n WrongStat = true$\r\n end\r\n if ( WrongCust = false$ ) and ( WrongStat = false$ ) then\r\n .ac_id->text = ACKey\r\n\t open 'SYSLISTS' to SysListsTable else\r\n\t Void = msg( '', 'Unable to open SYSLISTS...' )\r\n\t return 0\r\n\t end\r\n\t record_lock( SysListsTable, 'SysLists', ListId )\r\n\t delete SysListsTable, ListId else\r\n\t Void = msg( '', 'Unable to delete ':ListId:' from SYSLISTS...' )\r\n\t return 0\r\n\t end\r\n\t unlock SysListsTable, ListId else\r\n\t Void = msg( '', 'Unable to unlock SYSLISTS ':ListId )\r\n\t return 0\r\n\t end\r\n\tend else\r\n\t MsgInfo = ''\r\n\t MsgInfo = ErrMsg\r\n\t MsgInfo = '!'\r\n\t Void = msg( '', MsgInfo )\r\n\tend\r\nend\r\nRETURN 0" } } }