SELECT with the SAVING keyword, with or without NO.NULLS, returned the
correct value in @SYSTEM.RETURN.CODE, in my tests.

I don't know or have Universe, so I could be wrong, but it appears you
have an implied BSELECT, as demonstrated with the SAVING keyword.  A
BSELECT is, as quoted from the UniData UniQuery doc:

BSELECT filename ['record_IDs'][selection_criteria] attribute
[attribute...]

The UniQuery BSELECT command retrieves data from a file into an active
select list.  Unlike the SELECT command, which retrieves only record
IDs, BSELECT builds a list of the attributes you name in the UniQuery
statement.  You must name at least one attribute in the statement.


In UniData, you can also do an implied BSELECT by following the same
syntax as BSELECT  in a SELECT command.

UniData does not have @SELECTED.  @SYSTEM.RETURN.CODE is normally an
error code (if negative) or the number of items in the select list (if
non-negative) for any executed UniQuery commands dealing with select
lists.  It is misbehaving for BSELECT.


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Jerry Banker
> Sent: Tuesday, June 26, 2007 9:24 AM
> To: u2-users@listserver.u2ug.org
> Subject: RE: [U2] RE: [UD] BSELECT @SYSTEM.RETURN.CODE anomaly
> 
> Does the same thing happen when you use SELECT filename 
> SAVING [UNIQUE] field NO.NULLS?
> I'm not on Unidata so I can't try it. Universe doesn't have 
> the BSELECT command.
> @SYSTEM.RETURN.CODE only returns 0 on a select so we use 
> @SELECTED which does return the full amount in the select list.
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]
> 
> Sent: Monday, June 25, 2007 4:20 PM
> To: u2-users@listserver.u2ug.org
> Subject: [U2] RE: [UD] BSELECT @SYSTEM.RETURN.CODE anomaly
> 
> My apologies for the poor job I did posting this.  I sent it 
> before I had completed the subscribe procedures.  I blame it 
> on my vacation.  :-)
> 
> Because of my mistake, I didn't get the replies.  I had to 
> get them from the list archive.  Here are my replies to the replies:
> 
> 
> To Dave Davis, who said, "If you were curious about the 
> number of customers queried couldn't you just do a SELECT 
> CUSTOMER first?"
> 
> I agree.  Or, if you had done a previous select to whittle 
> down the list, you'd already know how many records would be 
> queried for the BSELECT.
> 
> 
> To David A. Green, who said, "SYSTEM(11) returns number of 
> items in the active select list.  I think we should leave the 
> @SYSTEM.RETURN.CODE as the number of records selected."
> 
> @SYSTEM.RETURN.CODE is NOT the number of records selected.  
> That is the problem.  It is the number of records 
> queried/polled, not the number of items returned in the 
> select list.  Those numbers will not be the same for a 
> multivalued attribute or if the attribute is null and UDT.OPTION
> 59 is ON.
> 
> Try this and see if you feel the same way about @SYSTEM.RETURN.CODE:
> 
> EXECUTE 'UDT.OPTIONS 59 ON'
> CMD1 = 'BSELECT CUSTOMER WITH @ID GE "200" TAPES_RENTED'
> CRT CMD1
> EXECUTE CMD1
> IF @SYSTEM.RETURN.CODE GT 0 THEN
>   CMD2 = 'DELETE TAPES'
>   CRT ; CRT CMD2
>   EXECUTE CMD2
> END
> 
> SYSTEM(11) is our workaround.  But it is a pain because:
> A) It is non-standard, i.e. not necessary for other SELECTs.
> B) It is not what the documentation says.  BASR.pdf states 
> that @SYSTEM.RETURN.CODE will contain the number of items in 
> the select list.
> C) If the program reports errors, it must first check 
> @SYSTEM.RETURN.CODE, and if okay then check SYSTEM(11).
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to