Well, this is a nasty one.&nbsp; I think it must be a bug.&nbsp; <br><br>I DECLARE GLOBAL in one processing table (temp), which then calls another with a DECLARE EXTERN(temp2).<br><br>The DECLARED value in CALLed table temp2 is just fine until the line I do a lookup.&nbsp; The value of all DECLARED EXTERN variables are then blanked.&nbsp; Can anyone explain why this should be?&nbsp; I'm using 
v5.0.14r4 on SCO.&nbsp; <br><br>Below are the relevant processing tables.&nbsp; The values for all DECLAREds disappear after the first lookup in the CALLed table, right after the debug on statement.&nbsp; Can anyone tell me why it does this?
<br><br>Tyler<br><br><br><br>:'---in-----------------------------:DECLARE GLOBAL ccCustNum(6,.0):<br>::DECLARE GLOBAL ccCardNum(16,*):<br>::DECLARE GLOBAL ccAmntReq(9,.2):<br>::DECLARE GLOBAL ccInvcNum(6,.0):<br>::DECLARE GLOBAL ccCustName(34,uplow):
<br>::DECLARE GLOBAL ccVNumber(8,.0)&nbsp;&nbsp; 'must be 8 digits; add a leading 7 if only 7 digits:<br>::DECLARE GLOBAL ccShowProgress(1,yesno):<br>:'---out-----------------------:DECLARE GLOBAL ccAuthCode(8,allup):<br>::DECLARE GLOBAL ccAmntRsp(9,.2):
<br>::ccCustNum=&quot;433594&quot;; ccCardNum=&quot;4185865892920419&quot;:<br>::ccAmntReq=&quot;1.99&quot;; ccInvcNum=&quot;999999&quot;:<br>::ccCustName=&quot;Joe Test&quot;; ccVNumber=&quot;71234567&quot;:<br>::ccShowProgress=&quot;N&quot;:
<br>::CALL (&quot;/hd1/hd1/appl/filepro/ccfile/auth&quot;):<br><br><br><br>authit:'==============================================================:'Tyler 042406 Authorize a credit card in real time.:<br>:'NOTE ccfile must have already been generated externally.::
<br>:'---in-----------------------------:DECLARE EXTERN ccCustNum:<br>::DECLARE EXTERN ccCardNum:<br>::DECLARE EXTERN ccAmntReq:<br>::DECLARE EXTERN ccInvcNum:<br>::DECLARE EXTERN ccCustName:<br>::DECLARE EXTERN ccVNumber&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'must be 8 digits; add a leading 7 if only 7 digits:
<br>::DECLARE EXTERN ccShowProgress:<br>:'---out-----------------------:DECLARE EXTERN ccAuthCode:<br>::DECLARE EXTERN ccAmntRsp:<br>::ccAuthCode=&quot;&quot;:<br>:ccAmntReq eq &quot;&quot; or ccAmntReq le &quot;0&quot;:ccAuthCode=&quot;Bad_Amnt&quot;; goto rauthit:
<br>:ccCardNum eq &quot;&quot;:ccAuthCode=&quot;No_CC#&quot;; goto rauthit:<br>::debug on:<br>:ccCustNum ne &quot;&quot;:lookup ccfile&nbsp; k=(ccCustNum&amp;ccCardNum)&nbsp;&nbsp;&nbsp; i=B -nx:<br>:not ccfile:ccAuthCode=&quot;No_CFile&quot;; goto rauthit:
<br>:ccfile(4) eq &quot;&quot;:ccAuthCode=&quot;No_Addr&quot;; goto rauthit:<br>:ccfile(7) eq &quot;&quot;:ccAuthCode=&quot;No_Expry&quot;; goto rauthit:<br>::lookup control&nbsp; r=(&quot;493&quot;)&nbsp; -np:<br>:not control:ccAuthCode=&quot;No_Cntrl&quot;; goto rauthit:
<br>::i=control(10); control(10)=i+&quot;1&quot;; write control; close control:<br>::ccfile(9)=ccInvcNum:<br>::f(6,mdy)=@TD:<br>::n(6,*)=mid(@tm,&quot;1&quot;,&quot;2&quot;){mid(@tm,&quot;4&quot;,&quot;2&quot;){mid(@tm,&quot;7&quot;,&quot;2&quot;):
<br>::fp=&quot;/hd1/hd1/appl/fpmerge/pospartnerhh&quot;:<br>::fn=&quot;&quot;{ccInvcNum{&quot;_&quot;{ccCustNum{&quot;_&quot;{f{&quot;_&quot;{n{&quot;_&quot;:<br>::jsfile cr (fp{&quot;/POSTMP/&quot;{fn{&quot;.xml&quot;):
<br>::jsfile tx &quot;&lt;?xml version=\&quot;1.0\&quot; ?&gt;&quot;:<br>::z=&quot;&lt;File xmlns=\&quot;x-schemaCNPCaptureRequestSchema.sch\&quot; UniqueFileName=\&quot;&quot;{fn{&quot;.xml\&quot;&quot;:<br>::z=z&lt;&quot;UseEncryption=\&quot;False\&quot; TransactionCode=\&quot;CNP\&quot; RecordType=\&quot;RQ\&quot; ProcessingCode=\&quot;CA\&quot; VNumber=\&quot;&quot;{ccVNumber{&quot;\&quot;&gt;&quot;:
<br>::jsfile tx &quot;&quot;{z{&quot;&quot;:<br>::jsfile tx &quot;&lt;Transaction&gt;&quot;:<br>::jsfile tx &quot;&lt;AccountDataSource&gt;@&lt;/AccountDataSource&gt;&quot;:<br>::jsfile tx &quot;&lt;AccountNumber&gt;&quot;{ccCardNum{&quot;&lt;/AccountNumber&gt;&quot;:
<br>::jsfile tx &quot;&lt;BillingAddress1&gt;&quot;{ccfile(1){&quot;&lt;/BillingAddress1&gt;&quot;:<br>::jsfile tx &quot;&lt;BillingAddress2&gt;&lt;/BillingAddress2&gt;&quot;:<br>::jsfile tx &quot;&lt;BillingCity&gt;&lt;/BillingCity&gt;&quot;:
<br>::jsfile tx &quot;&lt;BillingCountryCode&gt;&lt;/BillingCountryCode&gt;&quot;:<br>::jsfile tx &quot;&lt;BillingState&gt;&lt;/BillingState&gt;&quot;:<br>::jsfile tx &quot;&lt;BillingZipCode&gt;&quot;{MID(ccfile(4),&quot;1&quot;,&quot;5&quot;){&quot;&lt;/BillingZipCode&gt;&quot;:
<br>::jsfile tx &quot;&lt;CardHolderIDCode&gt;D&lt;/CardHolderIDCode&gt;&quot;:<br>::jsfile tx &quot;&lt;CID&gt;&lt;/CID&gt;&quot;:<br>::jsfile tx &quot;&lt;CIDIndicator&gt;&lt;/CIDIndicator&gt;&quot;:<br>::jsfile tx &quot;&lt;CommTax&gt;&lt;/CommTax&gt;&quot;:
<br>::jsfile tx &quot;&lt;CommTaxIndicator&gt;0&lt;/CommTaxIndicator&gt;&quot;:<br>::jsfile tx &quot;&lt;CustomerID&gt;&quot;{ccCustNum{&quot;&lt;/CustomerID&gt;&quot;:<br>:ccInvcNum ne &quot;&quot;:jsfile tx &quot;&lt;CustomerName&gt;&quot;{ccInvcNum{&quot;&lt;/CustomerName&gt;&quot;:
<br>::jsfile tx &quot;&lt;ExpirationDate&gt;&quot;{MID(ccfile(7),&quot;1&quot;,&quot;2&quot;){MID(ccfile(7),&quot;4&quot;,&quot;2&quot;){&quot;&lt;/ExpirationDate&gt;&quot;:<br>::jsfile tx &quot;&lt;InvoiceNumber&gt;&quot;{ccInvcNum{&quot;&lt;/InvoiceNumber&gt;&quot;:
<br>::jsfile tx &quot;&lt;MerchantTransactionID&gt;&quot;{i{&quot;&lt;/MerchantTransactionID&gt;&quot;:<br>::jsfile tx &quot;&lt;MultSeqCount&gt;1&lt;/MultSeqCount&gt;&quot;:<br>::jsfile tx &quot;&lt;MultSeqNum&gt;1&lt;/MultSeqNum&gt;&quot;:
<br>::jsfile tx &quot;&lt;RequestedACI&gt;Y&lt;/RequestedACI&gt;&quot;:<br>::jsfile tx &quot;&lt;ShipDate&gt;&quot;{@TD{&quot;&lt;/ShipDate&gt;&quot;:<br>::jsfile tx &quot;&lt;TransactionAmount&gt;&quot;{ccAmntReq{&quot;&lt;/TransactionAmount&gt;&quot;:
<br>::jsfile tx &quot;&lt;/Transaction&gt;&quot;:<br>::jsfile tx &quot;&lt;/File&gt;&quot;:<br>::jsfile cr-:<br>::system &quot;chmod 777&quot;&lt;fp{&quot;/POSTMP/&quot;{fn{&quot;.xml&quot;:<br>::system &quot;mv&quot;&lt;fp{&quot;/POSTMP/&quot;{fn{&quot;.xml&quot;&lt;fp{&quot;/POSREQ&quot;:
<br>::i=&quot;0&quot;:<br>::y=&quot;N&quot;; ms=&quot;Sending file to POS.&quot;:<br>::lookup blurb = ccBlurb&nbsp; k=(&quot;&nbsp;&nbsp;&nbsp;&nbsp; 1&quot;)&nbsp;&nbsp; i=A -nx:<br>loop05s::'---wait for authorization:<br>:i eq &quot;120&quot; or y eq &quot;Y&quot;:goto loop05e:
<br>:ccShowProgress eq &quot;Y&quot;:clearp; popup(&quot;1&quot;,&quot;1&quot;) -,&quot;ccauth&quot;:<br>:blurb and ccShowProgress eq &quot;Y&quot;:clears; show popup(&quot;4&quot;,&quot;1&quot;) blurb(3)&lt;blurb(4)&lt;blurb(5)&lt;blurb(6)&lt;blurb(7)&lt;blurb(8)&lt;blurb(9)&lt;blurb(10)&lt;blurb(11)&lt;blurb(12):
<br>::display; sleep &quot;1000&quot;:<br>::ms=&quot;Waiting for POS to process file &quot;:<br>:EXISTS(&quot;&quot;{fp{&quot;/POSREQ/&quot;{fn{&quot;.xml&quot;) gt &quot;0&quot;:ms=&quot;Waiting for POS to pick up file&quot;; goto loop05n:
<br>:EXISTS(&quot;&quot;{fp{&quot;/POSREQ/&quot;{fn{&quot;.old&quot;) gt &quot;0&quot;:ms=&quot;POS has picked up file, waiting for result&quot;:<br>:EXISTS(&quot;&quot;{fp{&quot;/POSRSP/&quot;{fn{&quot;Response1.xml&quot;) gt &quot;0&quot;:y=&quot;Y&quot;; ms=&quot;POS has completed, retrieving result.&quot;; goto loop05e:
<br>loop05n::i=i+&quot;1&quot;; ms=ms&lt;i&lt;&quot;secs&quot;; display; goto loop05s:<br>loop05e::clears; clearp; display; close blurb:<br>::yn=&quot;N&quot;:<br>if03:y eq &quot;Y&quot;:goto endif03:<br>:ccShowProgress eq &quot;Y&quot;:input popup yn &quot;Authorization is taking a long time...keep trying? (Y/n) &quot;:
<br>:yn ne &quot;N&quot;:i=&quot;0&quot;; goto loop05s:<br>:ccShowProgress eq &quot;Y&quot;:msgbox &quot;Authorization process cancelled.&quot;:<br>::ccAuthCode=&quot;Time_Out&quot;:<br>::goto rauthit:<br>endif03:::<br>::lookup pos = pos@&nbsp; r=free&nbsp; -e:
<br>::pos(5)=ccInvcNum; pos(6)=ccCustNum; pos(7)=5; pos(9)=&quot;75658966&quot;:<br>::pos(18)=@TD; pos(19)=@ID; write pos:<br>loop22s::'---iterate thru returned XML file:<br>::import ASCII xml=(&quot;&quot;{fp{&quot;/POSRSP/&quot;{fn{&quot;
Response1.xml&quot;) r=\n f=255:<br>:not xml:goto loop22e:<br>::z=xml(1):<br>if21:not (z co &quot;&lt;ApprovalCode&gt;&quot;):goto endif21:<br>::ccAuthCode=&quot;&quot;{MID(&quot;&quot;{z{&quot;&quot;,&quot;15&quot;,DLEN(&quot;&quot;{z{&quot;&quot;)-&quot;30&quot;):
<br>:ccAuthCode ne &quot;&quot;:pos(10)=ccAuthCode; ccAuthCode=&quot;AP&quot;{ccAuthCode; ccfile(8)=ccAuthCode; pos(8)=ccAuthCode; goto endif21:<br>:ccAuthCode eq &quot;&quot;:ccAuthCode=&quot;DECLINED&quot;; ccfile(8)=ccAuthCode; goto endif21:
<br>endif21:::<br>:z co &quot;&lt;SettlementAmount&gt;&quot;:ccAmntReq=&quot;&quot;{MID(&quot;&quot;{z{&quot;&quot;,&quot;19&quot;,DLEN(&quot;&quot;{z{&quot;&quot;)-&quot;38&quot;); pos(3)=ccAmntReq; goto loop22n:<br>:z co &quot;&lt;TransactionStatus&gt;&quot;:ccfile(10)=&quot;&quot;{MID(&quot;&quot;{z{&quot;&quot;,&quot;20&quot;,DLEN(&quot;&quot;{z{&quot;&quot;)-&quot;40&quot;); pos(4)=ccfile(10); goto loop22n:
<br>:z co &quot;&lt;ErrorMessage&gt;&quot;:ccAuthCode=&quot;POS_ERR&quot;; ccfile(10)=&quot;&quot;{MID(&quot;&quot;{z{&quot;&quot;,&quot;15&quot;,DLEN(&quot;&quot;{z{&quot;&quot;)-&quot;30&quot;); pos(4)=ccfile(10); goto loop22n:
<br>:z co &quot;&lt;ResponseTextMessage&gt;&quot; and pos(4) eq &quot;&quot;:pos(4)=&quot;&quot;{MID(&quot;&quot;{z{&quot;&quot;,&quot;22&quot;,DLEN(&quot;&quot;{z{&quot;&quot;)-&quot;42&quot;); goto loop22n:<br>:z co &quot;&lt;AccountNumber&gt;&quot;:pos(1)=&quot;&quot;{MID(&quot;&quot;{z{&quot;&quot;,&quot;16&quot;,DLEN(&quot;&quot;{z{&quot;&quot;)-&quot;32&quot;); goto loop22n:
<br>:z co &quot;&lt;ExpirationDate&gt;&quot;:pos(2)=&quot;&quot;{MID(&quot;&quot;{z{&quot;&quot;,&quot;17&quot;,DLEN(&quot;&quot;{z{&quot;&quot;)-&quot;32&quot;); goto loop22n:<br>loop22n::goto loop22s:<br>loop22e:::<br>::pos(17)=pos(1){pos(2); write pos:
<br>::write ccfile:<br>rauthit:::<br>:ccShowProgress eq &quot;Y&quot;:clearp; clears:<br>:@PM eq &quot;DEBUG&quot;:msgbox ccAuthCode&lt;&quot;\n&quot;{pos(4):<br><br><br><br>