Written by

Release Engineer at Amazing Charts | Harris CareTracker
Question Daniel Lee · Nov 8, 2019

Class compile error 5475

I have a task that has been working successfully for some time now but when I attempt to recompiled I get this error:

---------------------------
Studio
---------------------------
ERROR #5475: Error compiling routine: ACLIB.Utils.PurgeOrphanedMessages:PurgeOrphaned.  Errors:  
ERROR:  source lines(38) : MPP5610 : Referenced macro not defined: 'vaExtentGbl'
 TEXT:  . Set segid=$G($$$vaExtentGbl(%tID,"segs",1),"0,0"), data=$S(segid[",":$G($$$vaSegment(segid)),1:$G($$$vaSegmentGbl(segid))), %C105172d(16)=$Case($$$vaDataSegName(data),"FHS":"FHS","BHS":"BHS",:$$$vaDataDocName(data)) 
ERROR:  source lines(38) : MPP5610 : Referenced macro not defined: 'vaSegment'
 TEXT:  . Set segid=$G($$$vaExtentGbl(%tID,"segs",1),"0,0"), data=$S(segid[",":$G($$$vaSegment(segid)),1:$G($$$vaSegmentGbl(segid))), %C105172d(16)=$Case($$$vaDataSegName(data),"FHS":"FHS","BHS":"BHS",:$$$vaDataDocName(data)) 
ERROR:  source lines(38) : MPP5610 : Referenced macro not defined: 'vaSegmentGbl'
 TEXT:  . Set segid=$G($$$vaExtentGbl(%tID,"segs",1),"0,0"), data=$S(segid[",":$G($$$vaSegment(segid)),1:$G($$$vaSegmentGbl(segid))), %C105172d(16)=$Case($$$vaDataSegName(data),"FHS":"FHS","BHS":"BHS",:$$$vaDataDocName(data)) 
ERROR:  source lines(38) : MPP5610 : Referenced macro not defined: 'vaDataSegName'
 TEXT:  . Set segid=$G($$$vaExtentGbl(%tID,"segs",1),"0,0"), data=$S(segid[",":$G($$$vaSegment(segid)),1:$G($$$vaSegmentGbl(segid))), %C105172d(16)=$Case($$$vaDataSegName(data),"FHS":"FHS","BHS":"BHS",:$$$vaDataDocName(data)) 
ERROR:  source lines(38) : MPP5610 : Referenced macro not defined: 'vaDataDocName'
 TEXT:  . Set segid=$G($$$vaExtentGbl(%tID,"segs",1),"0,0"), data=$S(segid[",":$G($$$vaSegment(segid)),1:$G($$$vaSegmentGbl(segid))), %C105172d(16)=$Case($$$vaDataSegName(data),"FHS":"FHS","BHS":"BHS",:$$$vaDataDocName(data)) 
---------------------------
OK   
---------------------------

The error above is related to something I did not write, possibly from the Include (Ensemble, %sySite). I tried to recompile with options and checked the dependent classes but this still does not resolve the issue. 

For this class, I just modified the SQL Statement to include 'AND Name NOT LIKE '%ACK%'. Here is the complete SQL statement. 

	&sql(DECLARE C1 CURSOR FOR
		Select TOP :%tMaxCountToPurge ID, TimeCreated Into :%tID,:%tTimeCreated From EnsLib_HL7.Message
		Where TimeCreated < :%tDoNotDeleteDate AND Name NOT LIKE '%ACK%'
		Order By TimeCreated Asc)

Note that the query works correctly in the Terminal application. 

When I debug the task, the error code indicated above appears in the INT file. 

Do I need to recompile my Ensemble or %sySite classes? I am not certain what would have changed to cause the error; my simple addition to the WHERE condition should not cause this problem. 

Thank you. 

Comments

Daniel Lee  Nov 8, 2019 to Robert Cemper

Thank you for your reply. 

I had to add EnsHL7 to the list of includes. It is interesting that this compiled previously without the reference. 

0
Robert Cemper · Nov 8, 2019

It seems that you have lost the ????.inc the includes the definitions of
$$$vaExtentGbl
$$$vaSegment
$$$vaSegmentGbl
$$$vaDataSegName
$$$vaDataDocName
either you  lost the related Include statement or the whole file is lost sad

So in Studio run a "search in files" over *.inc for 

#Define vaExtentGbl
#Define  vaSegment
#Define  vaSegmentGbl
#Define  vaDataSegName
#Define  vaDataDocName
to find out which .inc you are missing.

The query you changed is totally unrelated to it, as far as it seems. 

0
Robert Cemper  Nov 8, 2019 to Daniel Lee

if your class inherits from some other the include may have gone there? 
typically explained by:  "We do not reference it here. "
 

0
Evgeny Shvarov  Nov 9, 2019 to Robert Cemper

Nobody remembered the change of a.INC and not the reason for the change.

Git remembers everything ;)

0
Robert Cemper  Nov 9, 2019 to Evgeny Shvarov

Right!

But without Git (several years back) . . . . . . . .
It's a matter of organization and discipline anyhow.  

0
Robert Cemper  Nov 8, 2019 to Daniel Lee

another way to explain your phenomenon:

  • assume you have a.INC
  • assume inside you have #DEFINE vaXYZ
  • next, you have b.INC with an #include a
  • now your class C with include b and using $$$vaXYZ compiles fine
  • later #DEFINE vaXYZ is  removed from a.INC
  • NOTHING HAPPENS
  • you have constructed a time bomb
  • long time later you do any change on class C
  • now your bomb crashes your compilation

I experienced such a case where the bomb was sleeping for 5 years.
Nobody remembered the change of a.INC and not the reason for the change.

0