How does one manage multiple active select lists in Unidata? I could have
sworn I've done this before, but for some reason it's not working at all as
I recall.
I have this SUBR(..) type field in file A that selects records from file B
to calculate an aggregate. This works fine when listing file
Can you use SELECT yourfile WITH whatever TO 8 {specific list number} in the
master process, and let your SUBR virtual field default to list 0 {zero}?
The other option could be to do a READLIST within the SUBR function and reset
the list when RETURNing, but this could be onerous in terms of
By definition you can only have one active list at a time in UniData.
But you can use list 1-9 in your subroutine (or at TCL) by using the TO and
FROM keywords.
PERFORM SELECT CUSTOMERS WITH STATE = 'CO' TO 1
LOOP
READNEXT CUST.KEY FROM 1 ELSE ...
David A. Green
(480) 813-1725
DAG Consulting
I've found that TO 8 does not work...
HOWEVER...
LISTNO = 8
TO LISTNO
Works fine... always meant to ask Rocket why I have that issue, but just
worked around it as shown.
DW
-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On
And I think it's more on the 'READNEXT' and the 'FROM' that I've seen the
issue, by the way...
Any place in BASIC (not the ECL-level stuff) seems to not like the 'actual
numeric' -- but a variable works fine.
YMMV -- just something I've seen.
-Original Message-
From:
Hi Kevin, Any reason why you are using type U ? This certainly
works using P ...
S='SELECT SOMEFILE WITH SOMETHING = OOJIT'
EXECUTE S RTNLIST MYLIST CAPTURING ANYOUTPUT
EOF=0
LOOP UNTIL EOF DO
READNEXT MYID FROM MYLIST THEN
GSOUB MYMESS
END ELSE EOF=1
REPEAT
Martin
-Original
It's all fine if the program controls both lists, but in this case the
SUBR(..) type field could be accessed in just about any context, from TCL,
from a download, from MITS, from another BASIC routine, with or without a
select list...
The RTNLIST doesn't solve the problem of my select command
If you already have an active list then you'll have to save it, then restore
it. See READLIST and FORMLIST.
David A. Green
(480) 813-1725
DAG Consulting
-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Kevin King
And we have a winner! Thank you everyone! The READLIST and FORMLIST will
work; seems kinda kludgy, but hey, it's working.
On Mon, Sep 24, 2012 at 11:21 AM, David A. Green
dgr...@dagconsulting.comwrote:
If you already have an active list then you'll have to save it, then
restore
it. See
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
BASICTYPE M and P allows for named Select Lists, so you can
EXECUTE SENTENCE RTNLIST WIP.LIST CAPTURING JUNK
LOOP
READNEXT WIP.ID FROM WIP.LIST ELSE EXIT
CALL SUB1
REPEAT
So in SUB1 you can do another EXECUTE to another
That may be applicable if we're controlling both lists, but in this
situation list 0 could come from anywhere. We just need to be able to
execute a second list without blowing away list 0.
On Mon, Sep 24, 2012 at 11:44 AM, Trevor Fulton tful...@epicor.com wrote:
BASICTYPE M and P allows for
So the first Select (which you cannot control) will be to the default of
0 (or to anything), then you only need to EXECUTE to a named list in the
second EXECUTE.
Trevor.
-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf
Aren't these nested selects kind of slow?
If the field in file b is indexed, I would use the SETINDEX and READFWD
statements in place of the SELECT statement. You are using Unidata, so unless
you need to make this work for Universe as well that's what I would do.
-Original Message-
One thing to look out for is when using FORMLIST make sure your variable
ACTIVE.LIST has stuff in it. Otherwise you get a null active list.
David A. Green
(480) 813-1725
DAG Consulting
-Original Message-
From: u2-users-boun...@listserver.u2ug.org
Good thought on the index, but alas, no index on the file. We could
probably add one, but then how do we control the order of the records being
retrieved from the list? (The order is important to our process.)
On Mon, Sep 24, 2012 at 11:49 AM, Dave Davis dda...@harriscomputer.comwrote:
Aren't
Seems like the simple solution would be in your subroutine, before you
need to generate your select, test the SYSTEM variable to see if an
active select is already in use. If it is, do a READLIST into a
variable. Then at the end of your subroutine, if anything is in your
variable, do a UNIBASIC
Bob, this is exactly what I'm attempting, to save the current 0 list and
restore it. David, checking the list before the FORM.LIST appears to have
solved the problem. Thank you.
Has this kind of thing always been this onerous? I recall doing it much
more easily - on Unidata - but it's been
What we do in situations like this is set up a subroutine that retrieves the
list of record keys in B, given the value of the index I want to retrieve.
This can then be called from an I-type in A, or from another subroutine.
I do the sort the hard way (in basic) so that the keys are in the
Have you given any consideration on reading the list from the pointer file ?
George
-Original Message-
From: Kevin King
Sent: Monday, September 24, 2012 1:01 PM
To: U2 Users List
Subject: Re: [U2] Unidata 7.1.16 Multiple Active Select Lists
Bob, this is exactly what I'm
That's just it, George, there is no saved list. It's just an active list 0.
On Mon, Sep 24, 2012 at 12:05 PM, George R Smith
geo...@grsmith.arcoxmail.com wrote:
Have you given any consideration on reading the list from the pointer file
?
George
-Original Message- From: Kevin King
Kevin,
Got it, and you don't want to or can't READNEXT thru and create your own
list and save it to file of our choice then
read it back in and use. I know it seems like you should not have to do
that but I have used this in the past.
George
-Original Message-
From: Kevin King
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.
On Mon, Sep 24, 2012 at 12:12 PM, George R Smith
geo...@grsmith.arcoxmail.com wrote:
Kevin,
Got it,
Guess I should have waited to decide I had the answer until I paid
attention to ALL of the message you typed. sigh I wonder if there is
a difference between FORMLIST and just plain SELECT. As long as your
variable exists, even if it's empty, you should get the same contents in
cursor 0 as when
AH! Probably explains why we would have to set WIP.LIST in your example --
we use BASICTYPE P everywhere. Never thought about it being
BASICTYPE-based, but makes perfect sense.
Thanks Trevor!
-Original Message-
From: u2-users-boun...@listserver.u2ug.org
Dave,
Be careful with that because LOCATE's sort BY AR or DR may be
different from LIST's sort BY an R-justified field. Leading zeros,
negative numbers, decimals with trailing zeros all come to mind.
If I recall that inconsistency is consistent across several MV platforms.
However, it
Kevin,
This is a long shot, an Is-it-plugged-In-Category question, but you
might as well check:
On UV I got bit recently using numbered select lists because 1, 2,
... were custom items in the VOC.
Some commands recognized the numbered select lists on the command line;
but some read the
Well aware of all that, especially the negative numbers issue.
I restrict use of AR, DR locates to non-negative integers.
Otherwise I use comparisons inside of a loop.
-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf
UDT.OPTIONS 85 U_NUMERIC_SORT
The UniBasic LOCATE function sorts data in ASCII order. This yields unexpected
results for those users who expect negative numbers to appear before positive
numbers in an ascending sort. This option offers a way to force negative
numbers to be sorted before
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
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
I missed this part of the discussion in the other thread.
I mentioned just within the last few weeks here that I prefer to use
the function-form of Locate because it is standard across most MV
platforms. The noted exception is with this very specific case.
The exact same issue you cite below was
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.
On 24/09/12 22:38, Tony Gravagno wrote:
If U2 does not support ARS/DRS, for standardization and portability I
highly recommend these platforms adopt the same convention in addition
to the documented but platform-specific UDT.OPTIONS.
I've never come across the S option in UV, but then I've
On 24/09/12 18:54, Kevin King wrote:
Good thought on the index, but alas, no index on the file. We could
probably add one, but then how do we control the order of the records being
retrieved from the list? (The order is important to our process.)
You'll have to check, but IME with UV the
My documentation says PASSLIST and RTNLIST only work on select list 0 and ONLY
work if the executed command is that which *creates* select list 0. If the
select list already exists *before* it reaches the execute, it will give you an
error.
The execute with the passlist is the one which
36 matches
Mail list logo