Scott Roth · May 20, 2021

What does ERROR #5002: Cache error: <MAXSTRING>zSaveData+14 ^EnsLib.HL7.Segment.1 mean?

We are seeing ERROR #5002: Cache error: <MAXSTRING>zSaveData+14 ^EnsLib.HL7.Segment.1 come up on a Routing rule when we are trying to Encoded PDF's through a DTL. In the DTL we are copying source to target. Is there a limitation on trying to copy source to target? 

At the bottom of the DTL you are see that we commented out converting the Encoded PDF to a Stream, is it recommended that we always use %Stream anytime we are dealing with PDF's?




0 330
Discussion (4)1
Log in or sign up to continue

I'd strongly recommend to use %Stream since 3.6 MB is huge for a String but not for a PDF.
Besides the absolute maximum of 3.6 MB for %String you may have additional limits of %String.
Dating from ancient ODBC the default max. for Strings is 50 !!!! If you don't set (MAXLEN="") explicitely

Where would you set the MAXLEN?

In your class definition, if you wanted a maximum length of 1000 as an example, you would define your string as:

Property mystring As %String (MAXLEN = 1000);

But as Robert has already pointed out, if you're dealing with something very large, it's better to use some sort of %Stream instead.

Use %VarString instead of %String. It has 3.6Mb limit by default.