Question
· 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. 

Discussion (7)1
Log in or sign up to continue

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. 

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.