Skip to content

Run Time Error 166 in Deferred Processing

Release Date: 2/16/2022
Version: 7.5 & Up

Q - I couldn't find documentation about error 166. Our deferred processes locked and had this error. Can you provide any information about what this message means?
    EL850RP.EXE - COBOL Text Window
    Execution error: file 'EL850U.LBR\NWSMSCRN.gnt'
    error code: 166, pc=0, call=7, seg=0
See sample screen below:


A - Error Code 166 means “recursive call not allowed.” Typically, this would be a programming bug.  We can find details of the run time error by looking at the <ElliottRoot>\Log\99\RTerrors.Log file where 99 is the company ID, like 01-99.  In your RTerrors.Log file, we see the following entry that corresponds to this error 166:
 
02/15/2022 00:02:01.59 DAVPSQL1   DEFERRED   IM2402
      Execution error : file 'EL850U.LBR\NWSMSCRN.gnt'
      error code: 166, pc=0, call=7, seg=0

  I/O Trace
00:02:01.51 EL850RP(1) SYEVENT Read       0   IM2402 IMTRXTRFIMITMFILI/M Trx Transfer Posting     0000001Item No
00:02:01.51 EL850RP(2) SYEVENT Read       0   IM2402 IMTRXTRFIMITMFILI/M Trx Transfer Posting     0000001Item No
00:02:01.51 EL850RP(1) SYEVENT Read       0   IM2402 IMTRXISSIMITMFILI/M Trx Issue Posting         0000001Item No
00:02:01.51 EL850RP(2) SYEVENT Read       0   IM2402 IMTRXISSIMITMFILI/M Trx Issue Posting         0000001Item No
00:02:01.51 EL850RP(1) SYEVENT Read       0   IM2402 IMTRXADJIMITMFILI/M Trx Adjustment Posting   0000001Item No
00:02:01.51 EL850RP(2) SYEVENT Read       0   IM2402 IMTRXADJIMITMFILI/M Trx Adjustment Posting   0000001Item No
00:02:01.51 EL850RP(1) SYEVENT Read       0   PO2002 RECVITEMIMITMFILReceive Item                 00000001Item
00:02:01.51 EL850RP(2) SYEVENT Read       0   PO2002 RECVITEMIMITMFILReceive Item                 00000001Item
00:02:01.51 EL850RP(1) SYEVENT ReWrite     0   PO2002 RECVITEMIMITMFILReceive Item                 00000001Item
00:02:01.51 EL850RP(2) SYEVENT ReWrite 0080 0   PO2002 RECVITEMIMITMFILReceive Item                 00000001Item
  End I/O Trace

  System Call Stack

NWSMRPTP in
CALLSCN in IM2402
NWSMSCRN in IM2402
NWSMEVTH in IM2402
FILERR in IM2402
CALLSCN in IM2402
NWSMSCRN in IM2402
  End System Call Stack

The  details imply that there are two defer processing tasks are running. The first defer process task EL850RP(1) is locking out EL850RP(2). Hence the EL850RP(2) gets an IO error 0080 (update conflict) when it tries to update the SYEVENT table.  If you have duplicate defer processing tasks running, it can be a problem.  Please make sure you only run one of them.  If you have two different defer processing tasks running for two different companies, then you should try to avoid running the defer tasks at the same time. Generally speaking, IO update conflicts should not happen if defer processing tasks are for two different companies and they have their own databases in individual DATA_?? folders.  In this case, the update conflict is for SYEVENT, which resides in the root directory.  This is a rare case.

The error 166 can happen if there's an IO error that's from the system manager (NWMSSCRN) program. This is a known problem. It is possible for us to make changes to avoid error 166.  But even if we fix error 166, you still will run into error 80, which is the root cause for error 166. Solving runtime error 166 does not resolve Btrieve error 80.  So the defer processing will still be stopped and, therefore, would not be much of an improvement.

To avoid error 166, you can avoid running IM2402 (IM Inventory Trx Posting) for both of companies at the same time. Set them apart by one minute, or have a different time slot for the second company. These measures will help to resolve this problem.  But even if you don't take these measures, we think the likelihood of this error 166 happening is slim.


EMK

Feedback and Knowledge Base