EXECUTE plus RTNLIST question

67 views
Skip to first unread message

ianp

unread,
Sep 11, 2007, 6:18:38 AM9/11/07
to jBASE
Is it possible for two EXECUTEs to trip over each other?

Example

EXECUTE 'SELECT fileA' RTNLIST varA
EXECUTE 'SELECT fileB WITH XYZ="abc"' RTNLIST varB

What happens *sometimes* is that varA is empty even though fileA
contains many records. The circumstance is always when varB returns
some keys but the code can be run 100 times during the day and will
only fail once. The only difference that I can point to is system
load. It fails at times when there are few users on the system.

What is the sequence of events when EXECUTE is used with RTNLIST? Does
the SELECT create an active select list and EXECUTE copies it to the
variable right at the end? If so, is it possible that the second
EXECUTE is hijacking the active list before the first EXECUTE has
completed?

Thanks

foxy.md

unread,
Sep 12, 2007, 5:15:30 AM9/12/07
to jBASE
Try to launch EXECUTE "CLEASELECT" between these 2 selects.

foxy.md

unread,
Sep 12, 2007, 5:26:51 AM9/12/07
to jBASE
sorry, mistake: EXECUTE "CLEARSELECT"

foxy.md

unread,
Sep 12, 2007, 5:29:00 AM9/12/07
to jBASE
or better:

EXECUTE 'SELECT fileA' RTNLIST varA

EXECUTE "CLEARSELECT"


EXECUTE 'SELECT fileB WITH XYZ="abc"' RTNLIST varB

EXECUTE "CLEARSELECT"

ianp

unread,
Sep 12, 2007, 9:22:48 AM9/12/07
to jBASE
Thanks for that but are you saying that there is definitely a problem
with the two EXECUTEs?

I would just like to understand why the CLEARSELECT is needed...

> > > > Thanks- Hide quoted text -
>
> - Show quoted text -

Daniel Klein

unread,
Sep 12, 2007, 10:59:04 AM9/12/07
to jB...@googlegroups.com
I can only surmise that the CLEARSELECT was suggested because, without it, the second EXECUTE would attempt to operate off of the list returned from the first EXECUTE. If no list was returned from the first EXECUTE (ie No records selected) then the second EXECUTE would operate as if the first EXECUTE did not exist.

A better idea of what you are trying to do would allow us to provide a more complete/accurate response.

Dan

Tom Turkington

unread,
Sep 12, 2007, 12:22:18 PM9/12/07
to jB...@googlegroups.com
As the problem is with varA and not varB - I don't think the CLEARSELECT
needs to be run between the selects...??

I would think that maybe there's an active select list (in certain
circumstances) that may be causing the first SELECT to return zero items,
because none of the items in the 'active select list' are in fileA - ... but
if that were the case you would typically be seeing a message about Item Z
(Y, A, ...) not being found... unless the code is actually doing CAPTURING
JUNK or something ...

I believe the SYSTEM(11) function will return info on whether there's an
active select list, so you might check it before doing the execute. If a
select list is active, then a CLEARSELECT would be appropriate, but then
again, you might want to figure out why there was such a creature to begin
with? i.e. perhaps some other process didn't finish processing all of its
items.

Generally, RTNLIST clears the active list, so I wouldn't think the
CLEARSELECT would be necessary between these statements anyway; so perhaps
some flavor of Pick/JBase behaves differently in this regard?

Tom

Emery A Grantier

unread,
Sep 12, 2007, 1:16:32 PM9/12/07
to jB...@googlegroups.com
The fact that the RTNLIST clause is being used in both EXECUTEs should make them totally independent.  If the second EXECUTE is being affected by the first there is a bug in jBASE that needs to be fixed.

From: jB...@googlegroups.com [mailto:jB...@googlegroups.com] On Behalf Of Daniel Klein
Sent: Wednesday, September 12, 2007 7:59 AM
To: jB...@googlegroups.com

Subject: Re: EXECUTE plus RTNLIST question
I can only surmise that the CLEARSELECT was suggested because, without it, the second EXECUTE would attempt to operate off of the list returned from the first EXECUTE. If no list was returned from the first EXECUTE (ie No records selected) then the second EXECUTE would operate as if the first EXECUTE did not exist.

A better idea of what you are trying to do would allow us to provide a more complete/accurate response.

Dan

On 9/12/07, ianp < ianp...@googlemail.com> wrote:

Charlie Noah

unread,
Sep 12, 2007, 2:03:09 PM9/12/07
to jB...@googlegroups.com
For a time after we upgraded to 3.4.8 we had a problem with internal select lists hanging around
when they shouldn't. Someone advised (may have been Jim I) that we set environment variable
preserve_default_list = false in Config_EMULATE. The problem went away and hasn't returned. FWIW,
we're running Universe emulation.

Regards,
Charlie Noah
Inland Truck Parts

Dan Ell

unread,
Sep 12, 2007, 2:36:10 PM9/12/07
to jB...@googlegroups.com
>>>>> Is it possible for two EXECUTEs to trip over each other?
>>>>> Example
>>>>> EXECUTE 'SELECT fileA' RTNLIST varA
>>>>> EXECUTE 'SELECT fileB WITH XYZ="abc"' RTNLIST varB

I would think not. But, if this code was run while a select was active and that select was with items not in fileA, then you would get exactly what you say your problem is. The CLEARSELECT suggested would eliminate this if it came before the two statements.

CLEARSELECT


EXECUTE 'SELECT fileA' RTNLIST varA
EXECUTE 'SELECT fileB WITH XYZ="abc"' RTNLIST varB

Dan Ell

ianp

unread,
Sep 13, 2007, 12:00:55 AM9/13/07
to jBASE
Thanks everyone, for the ideas and suggestions. It is definitely
possible that a previous process left an active list (the job that
fails is running about 5 hours into a 7 hour batch process so there is
plenty of scope for that!).

I'll try out the CLEARSELECT and then start looking for the needle in
the haystack...

Thanks again.

> >> - Show quoted text -- Hide quoted text -

Reply all
Reply to author
Forward
0 new messages