I have an Index global (XWES.ETI) that I want to use to pull subscripts for anther table. The XWES.ETI global has a single subscript (a sequentional number) and has two pieces of data that I want to use as subscripts for actual global defined in the cache sql storage map (^ZIDETRP). My class compiles without error but won't load and gets an error in %AcquireLock because one my created variables (edt) is undefined. I know this code is close but I just can't seem to spot the issue. Suggestions anyone? The class is as follows:
Class System.ErrTest Extends (%Persistent, %XML.Adaptor) [ StorageStrategy = Legacy ]
{
Property ErrID As %Library.Integer;
Property ErrDt As %Library.Date;
Property ErrNum As %Library.Integer;
Property EDat As %Library.String;
/// Index iMaster on ErrID [IDKey,Unique];
Index iMaster On ErrID [ IdKey, Unique ];
<Storage name="Legacy">
<ExtentSize>100000</ExtentSize>
<IdLocation>^XWES.ETI</IdLocation>
<SequenceNumber>6</SequenceNumber>
<SQLMap name="Map1">
<Data name="EDat">
<Delimiter>$c(0)</Delimiter>
<Node>1</Node>
<Piece>1</Piece>
</Data>
<Data name="ErrDt">
<RetrievalCode> Set {*}=edt</RetrievalCode>
</Data>
<Data name="ErrNum">
<RetrievalCode> Set {*}=enum</RetrievalCode>
</Data>
<Global>^ZIDETRAP</Global>
<RowReference>^ZIDETRAP(edt,enum)</RowReference>
<Subscript name="1">
<AccessType>Other</AccessType>
<Accessvar name="1">
<Code> S edt=$p(^XWES.ETI({L1}),"^",1)</Code>
<Variable>edt</Variable>
</Accessvar>
<Accessvar name="2">
<Code> S enum=$p(^XWES.ETI({L1}),"^",2)</Code>
<Variable>enum</Variable>
</Accessvar>
<Expression>{ErrID}</Expression>
<NextCode> s {L1}=$Order(^XWES.ETI({L1}))</NextCode>
</Subscript>
<Type>data</Type>
</SQLMap>
<StreamLocation>^WSandlin.System.ErrTestS</StreamLocation>
<Type>%CacheSQLStorage</Type>
</Storage>
}