May 30, 2022

Debugging the cause of the MEDITECH ERROR LOC for String Length or Symbol Table Overflow (MAGIC)

Sometimes an NPR Report crashes and a screen pops up with some information about the crashed report.  One piece of data that appears is the ERROR LOC.  There is a specific number that links to each type of error that causes a crash.  For instance, there is a specific number for a Symbol Table Overflow.  There is another number for exceeding the acceptable String Length (255 characters).  These numbers are unique to each Meditech network.

A symbol is a variable that stores a value.  As NPR Report Writers create more and more complex reports, they often use these symbols, sometimes referred to as variables.  These Symbols are recorded in a Symbol Table.  The space allocated for each symbol table is 1 block, or 1KB (1024 bytes).  A byte is required to display a character.  If the characters in your Symbols and their values exceed 1024, you experience Symbol Table Overflow which causes your report to crash.  (Users most often get around this by changing all of their variables to "global" or "slash" variables.  MAGIC Programmers can also get around this by appending X to the end of their program call, forcing a "stacking" of the symbol tables).

Meditech's Operating System allows a maximum length of 255 characters for any string.  If you exceed that length, your report crashes.

To determine what the ERROR LOC number is for each of these types of errors, you can create an NPR Report and cause it to crash on purpose by replicating the error type. 

For instance, here are some quick steps to force a Symbol Table Overflow error:

  1. Create an NPR Report for any DPM, enter a Report Title and an Active Y flag, then enter this Footnote: AL START ""^X,DO{X+1^X^X[X]}
    Here are the steps to force a String Length error:
  2. Create an NPR Report for any DPM, enter a Report Title and an Active Y flag, then enter this Footnote: AL START ""^X,DO{X+1^X_X^X}

When your reports run, they will crash.  You can then make note of the ERROR LOC number.  You can then make note of that number and refer to it whenever you have another report that crashes.  If you spot that number, you now know if the report crashed because of either Symbol Table Overflow or String Length.

Topics: MEDITECH, Magic System, NPR Report

You Might Also Enjoy

Sometimes MEDITECH does not make a segment available as a Detail Segment in their NPR ...

WITH is a Footnote that allows you to specify which Subscript a user-defined (xx) field ...

@Translation.message is an NPR Programming Macro that can be used in NPR Report Writer ...

You can use the following steps to write data to your Windows clipboard from an NPR ...

Select the Report DPM NPR.PROC Enter a report name (any name you like) Page 1 will need a ...