This usually indicates that your EXECUTE is executing at a different execution 
layer. Prime INFORMATION did this by default and had to use PERFORM to use the 
same runtime execution layer or overide with a $option statement.
 
________________________________________
From: u2-users-boun...@listserver.u2ug.org 
[u2-users-boun...@listserver.u2ug.org] On Behalf Of Dan McGrath 
[dmc...@imb.com.au]
Sent: Monday, 12 October 2009 1:56 PM
To: u2-users@listserver.u2ug.org
Subject: [U2] EXECUTE 'CLEARSELECT'

Hi all,



One of the programmers here has noticed this quirky behaviour in Unidata
7.1.



First, we created a file called TEST and gave it 3 records, AA, AB and
AC. Then we executed the following program:



   PROGRAM TEST



   CLEARSELECT

   EXECUTE 'SELECT TEST WITH @ID = "A]"'

   CRT "Records after SELECT ":SYSTEM(11)



   READNEXT KEY ELSE NULL



   EXECUTE "CLEARSELECT"

   CRT "Records after EXECUTE CLEARSELECT: ":SYSTEM(11)



   EXECUTE 'SELECT TEST WITH @ID = "A]"'

   CRT "Records after SELECT ":SYSTEM(11)



   READNEXT KEY ELSE NULL



   CLEARSELECT

   CRT "Records after CLEARSELECT: ":SYSTEM(11)



   EXECUTE 'SELECT TEST WITH @ID = "A]"'

   CRT "Records after SELECT ":SYSTEM(11)



   STOP



and received the following results:



3 records selected to list 0.



Records after SELECT 3

Records after EXECUTE CLEARSELECT: 2



3 records selected to list 0.



Records after SELECT 2

Records after CLEARSELECT: 0



3 records selected to list 0.



Records after SELECT 3



We would expect SYSTEM(11) to return 0 after the EXECUTE "CLEARSELECT"
but it returns how many items were in the list prior to the CLEARSELECT.
Also odd is that the select itself returns that it selected 3 records,
but then SYSTEM(11) reports 2 and READNEXT will only extract 2 from the
list. The work around is to use Unibasic CLEARSELECT which functions
correctly as demonstrated above. When testing this using BASICTYPE "u"
and "WHEN @ID LIKE" the issue did not present itself. I have tested both
UNIX and Windows.



Does this happen in 7.2?



Regards,

Dan


###########################################################################################
The information transmitted in this message and attachments (if any) is 
intended only
for the person or entity to which it is addressed. The message may contain 
confidential
and/or privileged material.  Any review, retransmission, dissemination or other 
use of
or taking of any action in reliance upon this information by persons or 
entities other
than the intended recipient is prohibited.  If you received this in error, 
please
contact the sender and delete the material from any computer.

The intended recipient of this e-mail may only use, reproduce, disclose or 
distribute
the information contained in this e-mail and any attached files with the 
permission of IMB.
###########################################################################################
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

************** IMPORTANT MESSAGE *****************************       
This e-mail message is intended only for the addressee(s) and contains 
information which may be
confidential. 
If you are not the intended recipient please advise the sender by return email, 
do not use or
disclose the contents, and delete the message and any attachments from your 
system. Unless
specifically indicated, this email does not constitute formal advice or 
commitment by the sender
or the Commonwealth Bank of Australia (ABN 48 123 123 124) or its subsidiaries. 
We can be contacted through our web site: commbank.com.au. 
If you no longer wish to receive commercial electronic messages from us, please 
reply to this
e-mail by typing Unsubscribe in the subject line. 
**************************************************************



_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to