While I agree that the user typing the commands may find the results unexpected, if you think about how the TCL commands are implemented, it actually makes sense. If I type: ED FOO BAR The ED command has been given an item-id so it attempts to read it. If I type: ED FOO it checks if there's a select-list and uses it, otherwise it either gives you an error message about syntax or prompts you for an item-id, depending on your mv flavor.
Now consider: SELECT FILENAME 'itemid' Or SELECT FILENAME @ID = "itemid" both effectively say "hey! I have given you an item id". The TCL "SELECT" verb, once given an item-id, doesn't bother to check for a select list. Like any TCL verb it just reads the supplied item-ids. Item-ids supplied on the command-line override any active SELECT list. Once you get that, and realize that the two variations above are interpreted by the SELECT command as being equivalent to an item-id being provided on the command line, then the behavior is understood. I didn't say "expected". I also didn't say "desirable". I said "understood"! :) It's one of those syntactical things you need to be aware of. Depending on your MV flavor SELECT FILENAME @ID = "itemid" May not be interpreted as an "item-id on the command line". In order to make my commands portable, I always use the form: SELECT FILENAME 'item-id' ... using single quotes for item-id, if I really want to specify an item-id and not scan the whole file or use the active select list. I always use SELECT FILENAME WITH dictid = "item-id" ... If I want to simply add selection criteria based on the item-id to my SELECT statement, scanning the whole file or using the active select list. The same behavior applies to SSELECT, LIST, SORT and any other related TCL processors. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Richard A. Wilson Sent: Thursday, July 07, 2011 8:46 AM To: U2 Users List Subject: Re: [U2] Found something interesting.....Bug or No Bug....that is my question? Prime information also returned a hit anytime the following syntax was used I'm guessing UV tried to emulate prime whenever possible SELECT filename recordid perhaps a different flavor would yield different results Rich Dianne Ackerman wrote: > Yikes, not what I would have expected. Also happens on 10.2.7 -Dianne > > On 7/7/2011 11:02 AM, George Gallen wrote: >> UV on Unix - Version 10.0.1 >> >> If you do: >> SELECT FILENAME WITH FIELD = SOMETHING And you want to know if ITEM >> 1234 is in that list SELECT FILENAME 1234 Will always return a hit >> (unless it doesn't exist in the FILE) and ignores the active list >> >> whereas >> >> SELECT FILENAME WITH FIELD = SOMETHING SELECT FIELNAME WITH @ID = >> 1234 Will return a zero if it's not in the active list >> >> So....if you don't specify a "WITH" qualifier, it will ignore any >> active list and treat it >> as if it's a new SELECTion >> >> moral of the story, don't get used to omitting the WITH @ID when >> doing selects otherwise, it will bite you if your working with an >> active list. >> >> >> >> George Gallen >> Senior Programmer/Analyst >> Accounting/Data Division, EDI Administrator [email protected] >> ph:856.848.9005 Ext 220 >> The Wyanoke Group >> http://www.wyanokegroup.com >> >> >> >> _______________________________________________ > > _______________________________________________ > U2-Users mailing list > [email protected] > http://listserver.u2ug.org/mailman/listinfo/u2-users > -- Richard A Wilson Lakeside Systems Smithfield, RI, USA Voice 401-231-3959 Fax 206-202-2064 _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
