× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Are you sorting the array after loading it?

The ASCEND keyword tells the system that you promise the data is sorted.

It doesn't actually sort it for you.

Charles

On Wed, Dec 14, 2016 at 10:42 AM, Bill Howie <blhowie66@xxxxxxxxx> wrote:

Jon,

Here's my definition of my array:

loc s 8 dim(1600) ascend

Here's my lookup:

eval n = %lookupgt(scpos:loc)

The "SCPOS" field, in the scenario I'm looking at, would have be like this:
"OVbbbbbb" where the b's are blanks. I would want to position my subfile
to records which could have just "OV" in them, or "OVERFLOW", or
"OVER-1AB", etc. So I'm basically entering a partial value in my search
field and I want to be able to find the array elements from there on. If
LOOKUPGT won't work I'll just go to creating a temporary file to hold my
locations. If I do that, SETLL would work in this scenario, right? We are
at V5R4 FYI.

Bill



On Wed, Dec 14, 2016 at 12:21 PM, Jon Paris <jon.paris@xxxxxxxxxxxxxx>
wrote:

Nope - not if you are using GT - BUT - the array must be in sequence. Is
it?

Also what is in the backend of the key field? Spaces or low values or ...
??


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Dec 14, 2016, at 11:36 AM, Bill Howie <blhowie66@xxxxxxxxx> wrote:

Jon,

Upon further review I think I really only need the one "LOC" field in
my
array. So it becomes a simple 1-dimension array. So right now my
lookup
statement looks just like yours. But if I key in "OV" in my
position-to
screen field, I want it to show all locations from there on, like ones
with
"OVER-1A", "OVER-2A", etc. However, my LOOKUPGT statement returns a
zero
for N. Does the search argument have to exactly match something in the
array? In other words, can it be a partial value and still work?

Bill

On Wed, Dec 14, 2016 at 11:23 AM, Jon Paris <jon.paris@xxxxxxxxxxxxxx>
wrote:

Only the "plain vanilla" %Lookup is currently supported for DS arrays
I
believe.

This should work though:

d ds
d locarray dim(1600)
d arch 2 overlay(locarray)
d loc 8 overlay(locarray: *Next)

Then the lookup becomes:

n = %lookupgt(scpos: loc);

Not tested but should be about right.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Dec 14, 2016, at 10:54 AM, Bill Howie <blhowie66@xxxxxxxxx>
wrote:

Thanks for the replies......let me throw another wrinkle in this if I
may.
Instead of a file in this case, I have a qualified array that holds
my
locations. Like this:

dlocarray ds dim(1600) qualified
d brch 2
d loc 8

"BRCH" is always constant and the "LOC" field is the location. So
basically I have an array that holds all the locations. My thinking
was
I
could search the array with the %LOOKUPGT BIF and it would find the
next
one greater than what the user positions to. But the compiler
doesn't
like
the following:

eval n = %lookupgt(scpos:locarray(*).loc)

"SCPOS" would be the screen field that the user keys in to position
the
subfile. But I can't get the syntax right for how I can search the
locations that are in the array. I get the following compiler
errors:

*RNF0571 20 1 The second parameter for %LOOKUPxx is not valid.

*RNF5343 30 1 Array has too many omitted indexes; specification
is
ignored.

Thoughts?

Bill

On Wed, Dec 14, 2016 at 10:35 AM, Alan Shore <ashore@xxxxxxxx>
wrote:

Hi Bill
We always put a position to field - above the subfile data. So that
when
someone enters a value in this field, presses Enter - or a
particular
function key - the file is setll with that value (other than spaces)
and
then builds the subfile from that point on
NOTE - we ALWAYS build page at a time subfiles
A load ll sub file requires a different piece of logic

Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill


-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Jeff
Young
Sent: Wednesday, December 14, 2016 10:28 AM
To: RPG programming on the IBM i (AS/400 and iSeries) <
rpg400-l@xxxxxxxxxxxx>
Subject: Re: Subfile question - Position To functionality

Bill,
You would need to get the "bin" from the subfile record using a
CHAIN
to
the subfile record that the cursor is positioned to, then use that
value to
read you data file and reload the subfile.

Jeff Young
Sr. Programmer Analyst

On Wed, Dec 14, 2016 at 10:18 AM, Bill Howie <blhowie66@xxxxxxxxx>
wrote:

Hello all,

Question for the group. I have the need to add "position to"
functionality to a subfile program. In this scenario, my subfile
has
one field which is
a bin location in a warehouse. The one field could look something
like
"OVER-1A". I want the user to be able to key in just the letter
"O"
in a field on the subfile screen and have the subfile display
starting
with the records that begin with "O" and going from there. Is it
just
as simple as doing a SETLL with the "O" as the key and it will read
the records from there on or is there more to it than that? Any
info
is
as always
appreciated. Thanks!

Bill
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email:
RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please
take
a
moment to review the archives at http://archive.midrange.com/
rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: http://amzn.to/2dEadiD

--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To
subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: http://amzn.to/2dEadiD

--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: http://amzn.to/2dEadiD

--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: http://amzn.to/2dEadiD

--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: http://amzn.to/2dEadiD

--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.