Hi Shawn,

There is!

There was a thread not too long ago where I assisted Chuck Mongiovi with a
similar problem, this is the code that I suggested and that he debugged :)

His problem was that he wanted a 5 value string sorted by attribute, based
off of the 5th element of the string, and here's the solution he ended up
using.  HAVE FUN!

SORT.DATA = ""
SORT.INDEX = ""
SORT.COUNT = DCOUNT(REC,@AM)
*
FOR J = 1 TO SORT.COUNT
  LINE = REC<J>
  LOOK.FOR = LINE<1,5>
  LOCATE LOOK.FOR IN SORT.INDEX BY 'DR' SETTING FOUND ELSE NULL
  SORT.INDEX = INSERT(SORT.INDEX , FOUND, 0, 0, LOOK.FOR)
  SORT.DATA  = INSERT(SORT.DATA  , FOUND, 0, 0, LINE)
NEXT J

Hope this helps!

Allen E. Elwood
Senior Programmer Analyst
Direct (818) 361-5251
Fax    (818) 361-5251
Cell    (818) 359-8162
Home (818) 361-7217


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Shawn Waldie
Sent: Friday, August 20, 2004 08:46
To: [EMAIL PROTECTED]
Subject: [U2] [UD] Sorting


I have records that contains a mv list of dates, i.e.,
13200:@VM:13312:@VM:13176.  I need to store these values in ascending
order, so I: a) convert the VMs to AMs, b) perform a FORMLIST,
SAVE.LIST, SORT.LIST; and c) load the values back into the attribute.
There has to be a more efficient way.  Any suggestions?


TIA
************************************************
* Shawn Waldie                San Juan College *
* Programmer/Analyst         4601 College Blvd *
* Phone: (505)566-3072   Farmington, NM  87402 *
*      email: [EMAIL PROTECTED]       *
*                                              *
* HP-UX 11.11   UniData 6.0.4    Colleague R17 *
************************************************
-------
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