I have a task that has been working successfully for some time now but when I attempt to recompiled I get this error:
<quote>---------------------------
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   
---------------------------</quote>
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. </p>

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 &lt; :%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. 

</body></html>