This solved my problem.

Thanks for all the suggestions.

Al

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bob Woodward
Sent: Monday, November 07, 2005 6:23 PM
To: [email protected]
Subject: RE: [U2] Sort help needed

The problem is your "ELSE POS=0" statement.  You need something like
this:
LOCATE PART.NBR IN RECORD<14> BY "AL" SETTING POS ELSE
   INSERT...
END

In a "THEN" condition, the value is already in RECORD<14>.  You only
need to do an INSERT when it's not found.  When it's not found, POS will
contain the position that the new value should be in so just use it.
Don't override the value by setting it to zero.

BobW

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:owner-u2-
> [EMAIL PROTECTED] On Behalf Of Al DeWitt
> Sent: Monday, November 07, 2005 3:27 PM
> To: [email protected]
> Subject: [U2] Sort help needed
> 
> Environment: UniData - Pick Flavor
> 
> 
> 
> I'm trying to build a multi-value field in part number order.
> 
> 
> 
> I begin with LOCATE PART.NBR IN RECORD<14> BY "AL" SETTING POS ELSE
POS
> = 0
> 
> 
> 
> The first time through RECORD<14> is empty.  The second time
RECORD<14>
> has one value.  If PART.NBR is of greater value than what is now in
> RECORD<14> then I want PART.NBR to be the second value, if it is of
> lesser value than I want PART.NBR to be inserted before the value in
> RECORD<14>.
> 
> 
> 
> I will then do a second LOCATE to see where PART.NBR is stored
> (RECORD<14,x>) and use that position to insert data into associated
> attributes.
> 
> 
> 
> My problem is that I haven't done this in a while and when I did it
was
> in Universe.  So not only am I suffering a senior moment I'm dealing
> with a language barrier.
> 
> 
> 
> Any help would be greatly appreciated.
> 
> 
> 
> Thanks.
> 
> 
> 
> Al DeWitt
> 
> Stylmark, Inc.
> -------
> u2-users mailing list
> [email protected]
> To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to