Just to avoid the obvious question, you have tried using the LOCATE and
INSERT commands? If not this is an easy to use construct.
No, I have to admit that I haven't .. In order to use LOCATE, I have to
transpose my data:
REC1 = A]W]1]5]15
REC2 = B]X]2]6]25
REC3 = C]Y]3]7]100
REC4 = D]Z]4]8]11
Chuck,
I agree with Stuart - using a work file would speed things up.
Here's a quick code outline to help (I use UniData, and haven't
tried to run this, so YMMV):
OPEN MYFILE TO F.MYFILE ELSE STOP
OPEN WORKFILE TO F.WORK ELSE STOP
EXECUTE CLEARFILE DATA WORKFILE
READ REC FROM F.MYFILE,MYREC ELSE
GET.LIST MYLIST.OUT.
- Original Message -
From: Chuck Mongiovi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 27, 2004 8:28 AM
Subject: RE: [U2] merge sort
Just to avoid the obvious question, you have tried using the LOCATE and
INSERT commands? If not this is an easy to use
]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 27, 2004 9:46 AM
Subject: Re: [U2] merge sort
Try this for an easy sorted list assuming field 6 is the field to sort on:
0001: PA
0002: SELECT MYFILE SAVING EVAL @RECORD6:'|':@ID
0003: SAVE.LIST MYLIST
0004: SH -c 'sort SAVEDLISTS/MYLIST SAVEDLISTS
] Behalf Of Rosenberg Ben
Sent: Friday, July 23, 2004 6:34 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [U2] merge sort
EXECUTE MERGE.LIST 0 UNION 0 TO 0
will sort and de-dupe the current select list.
-Original Message-
From: Chuck Mongiovi
Does anyone know where I can get code for a
generic
]
Subject: RE: [U2] merge sort
I want a merge sort for data in BASIC, not lists.
For example (] is an @VM)
REC1 = A]B]C]D]15
REC2 = A]B]C]D]25
REC3 = A]B]C]D]100
REC4 = A]B]C]D]11
I want to sort by multi-value #5 .. The sorting isn't the issue .. It's when
DCOUNT(REC,@AM) gets large that the whole
]
[mailto:[EMAIL PROTECTED] Behalf Of Charlie Rubeor
Sent: Monday, July 26, 2004 10:46 AM
To: [EMAIL PROTECTED]
Subject: RE: [U2] merge sort
Do you need this for a unix platform? This would not qualify as a generic
BASIC merge/sort, but you could shell to the unix sort command for this sort
of stuff
On Mon, 26 Jul 2004 09:03:38 -0400, you wrote:
I want a merge sort for data in BASIC, not lists.
For example (] is an @VM)
REC1 = A]B]C]D]15
REC2 = A]B]C]D]25
REC3 = A]B]C]D]100
REC4 = A]B]C]D]11
I want to sort by multi-value #5 .. The sorting isn't the issue .. It's when
DCOUNT(REC,@AM) gets
: Re: [U2] merge sort
On Mon, 26 Jul 2004 09:03:38 -0400, you wrote:
I want a merge sort for data in BASIC, not lists.
For example (] is an @VM)
REC1 = A]B]C]D]15
REC2 = A]B]C]D]25
REC3 = A]B]C]D]100
REC4 = A]B]C]D]11
I want to sort by multi-value #5 .. The sorting isn't the issue .. It's
when
: Monday, 26 July 2004 23:04
To: [EMAIL PROTECTED]
Subject: RE: [U2] merge sort
I want a merge sort for data in BASIC, not lists.
For example (] is an @VM)
REC1 = A]B]C]D]15
REC2 = A]B]C]D]25
REC3 = A]B]C]D]100
REC4 = A]B]C]D]11
I want to sort by multi-value #5 .. The sorting isn't
Chuck, if what you wanted was to look at the code to see how it's done this
won't help but.
AD for MERGE.LIST
I've used MERGE.LIST which is very effective. I've written programs which
sort and merge many subsets just by executing this utilities and then doing
the good ol' READLIST.
SELECT
EXECUTE MERGE.LIST 0 UNION 0 TO 0
will sort and de-dupe the current select list.
-Original Message-
From: Chuck Mongiovi
Does anyone know where I can get code for a
generic BASIC Merge SORT routine?
-Chuck
---
The information contained in this e-mail message may be
12 matches
Mail list logo