I think you would be more surprised that an executed select wasn't picking
up an active select list :). 

I do recall getting burned by UniData's select handling while we were
transitioning from D3. I had a Y2K program that would go though files and
change a 2 digit year that was part of the key. D3 would drop the select
where UniData wouldn't and it totally hammered a major file. eg in UniData
you can go SELECT CUSTOMERS WITH...; DATE; LIST CUSTOMERS and only see the
select list; however, D3 would drop the select list with the date command
and the list would list all.

In this case, you just don't "want" it to use the select list as you're
trying to do something different. Usually, we have a little more control
over where things start out - but it looks like you're trying to create a
dictionary item that you intend to use all over the place. UniData has the
REQUIRE.SELECT option for lists to make sure it only runs when there is an
active select, but I can't think of anything that would ignore an active
list.

Compounding the question is how does the active select list work while in
the middle of the actual select. Like I said, it would be nice that list 0
would contain everything up to that point, so you could save it, process
something else, "re-activate" it and continue selecting. However, it's not
hard to imagine someone optimizing the select process might not including
this permutation in testing scenarios.

The unibasic select works well for ignoring the active list, but
necessitates processing the entire file. I think in most cases, we've
already had a "dense index" in place that we can read instead of doing the
"nested" select.

hth
Colin

-----Original Message-----
From: Kevin King
Sent: September 24, 2012 3:03 PM
To: U2 Users List
Subject: Re: [U2] Unidata 7.1.16 Multiple Active Select Lists

Thanks for the information.  It is unusual that the subroutine works fine
without a list but it consumes the active select list if there is one when
the subroutine EXECUTES the select command.

On Mon, Sep 24, 2012 at 2:11 PM, Colin Alfke <alfke...@hotmail.com> wrote:

> Kevin;
>
> The "problem" is that the initial list is list 0 so that your execute 
> select uses it - regardless of pass/rtnlist. Like David said you will 
> have to save the list items before your select and then restore it to 
> list 0 when done.
> Another alternative is to use the unibasic select - which loses any 
> index gains and you have to process the file yourself.
>
> I don't use rtn/passlist so I'm not sure why they aren't compiling - 
> but if you're using the "TO 2" syntax you shouldn't need them and I 
> don't think they'll help you anyway, but I would be surprised that the 
> compiler would catch the double usage.
>
> I've used the initial techniques with existing select lists. How list 
> 0 behaves while it's still building is an interesting test. I would 
> like it to work - but am not really surprised that it doesn't.
>
> hth
> Colin
> -----Original Message-----
> From: Kevin King
> Sent: September 24, 2012 12:20 PM
> To: U2 Users List
> Subject: Re: [U2] Unidata 7.1.16 Multiple Active Select Lists
>
> What I don't understand is why I can't seem to get PASSLIST and 
> RTNLIST to work in BASIC.  Seems that's exactly what these are 
> intended to do but they give me nothing but compilation failures.
>
>  [snip]
> >>> On Behalf Of Kevin King
> >>> Sent: Monday, September 24, 2012 10:43 AM
> >>> To: U2 Users List
> >>> Subject: Re: [U2] Unidata 7.1.16 Multiple Active Select Lists
> >>>
> >>> Well, that success was short lived.  While the READLIST and 
> >>> FORMLIST allow my SUBR(..) field to not consume the active select 
> >>> list zero, these two commands produce different results:
> >>>
> >>> LIST ORDER.LINE WITH fieldName fieldName
> >>>
> >>> ...this will show the lines that have this field set, and will 
> >>> show the field properly.  However, this command returns no items:
> >>>
> >>> SELECT ORDER.LINE WITH fieldName
> >>>
> >>> Basically my program is doing this:
> >>>
> >>> READLIST ACTIVE.LIST FROM 0 ELSE NULL
> >>> *
> >>> CMD = "select ... TO 2"
> >>> EXECUTE CMD CAPTURING OUTPUT
> >>> *
> >>> EOF = @FALSE
> >>> LOOP
> >>>   READNEXT ID FROM 2 ELSE EOF = @TRUE UNTIL EOF DO
> >>>   ..
> >>> REPEAT
> >>> *
> >>> CLEARSELECT 2
> >>> *
> >>> FORMLIST ACTIVE.LIST TO 0
> >>>
> >>> All other input/ideas appreciated.
> >>>
>
>
> _______________________________________________
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
>
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

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

Reply via email to