[U2] [ud] Question on Alpha Sorting...
I have a need to sort people by LastName,FirstName. The issue is that we 'accept' data from lots of sources, some that are ProperCapped, some that are all lower, AND SOME THAT ARE ALL UPPER. I need to 'present' them correctly sorted, but show the data 'as it is' The record currently contains a MV list of the names 'as is' -- there could 500 names in the list. My way of handing it (now) is to open a New attribute that I put a 'ALL CAPS' version of the Name into, and then each insert, I so a LOCATE BY 'AL' into the new attribute, and insert the 'SORTNAME' into the new attribute, and the 'as TyPed NAme' as always - just now, we're not using the 'as typed' for the sort. My issue ... I've doubled the data being stored in order to accomplish this! Is there a more elegant, logical way to handle this issue besides having a 'SortName' attribute and an 'AsTyped' attribute in the record? Thanks for any thoughts for this Friday afternoon mind-tease! (Ah ... I miss D3's case insensitivity from time to time!!) David W. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] [ud] Question on Alpha Sorting...
Hmm...doing it programmatically...multi-dimensional array? DAVINCI,LEONARDO Doe,John Jesse,Sally becomes [1] [2] DAVINCI,LEONARDO DAVINCI,LEONARDO Doe,John DOE,JOHN Raphael,Sally RAPHAEL,SALLY And then you can sort by [2], but display [1]? That way it just stays in memory and the data stored in the database remains the same? On 8/24/07, David Wolverton <[EMAIL PROTECTED]> wrote: > I have a need to sort people by LastName,FirstName. > > The issue is that we 'accept' data from lots of sources, some that are > ProperCapped, some that are all lower, AND SOME THAT ARE ALL UPPER. > > I need to 'present' them correctly sorted, but show the data 'as it is' > > The record currently contains a MV list of the names 'as is' -- there could > 500 names in the list. > > My way of handing it (now) is to open a New attribute that I put a 'ALL > CAPS' version of the Name into, and then each insert, I so a LOCATE BY 'AL' > into the new attribute, and insert the 'SORTNAME' into the new attribute, > and the 'as TyPed NAme' as always - just now, we're not using the 'as typed' > for the sort. > > My issue ... I've doubled the data being stored in order to accomplish this! > Is there a more elegant, logical way to handle this issue besides having a > 'SortName' attribute and an 'AsTyped' attribute in the record? > > Thanks for any thoughts for this Friday afternoon mind-tease! (Ah ... I > miss D3's case insensitivity from time to time!!) > > > David W. > --- > u2-users mailing list > u2-users@listserver.u2ug.org > To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [ud] Question on Alpha Sorting...
I was just concerned about this record, as names get added individually -- I thought about doing an UPCASE on a memory version of the MultiValue list, but once that list gets to having 100 or 200 names on it, would the 'hit' for doing an UPCASE on an in-memory version be 'less than' the disk-access time for the larger item... Falls into the 'is there a better way' category of thinking. Like I said -- D3 has sorting WAY better than U2 in this area. (*Just* this one area, but in this case, it's all I'm talking about! ) > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of jjuser ud2 > Sent: Friday, August 24, 2007 2:47 PM > To: u2-users@listserver.u2ug.org > Subject: Re: [U2] [ud] Question on Alpha Sorting... > > Hmm...doing it programmatically...multi-dimensional array? > > DAVINCI,LEONARDO > Doe,John > Jesse,Sally > > becomes > [1] [2] > DAVINCI,LEONARDO DAVINCI,LEONARDO > Doe,John DOE,JOHN > Raphael,Sally RAPHAEL,SALLY > > And then you can sort by [2], but display [1]? That way it > just stays in memory and the data stored in the database > remains the same? --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [ud] Question on Alpha Sorting...
Duplicating data in the way you suggest is something I detest! The chance of mis-typing the name the second time is just too great and then there is all that extra disk space consumed. I would prefer to see the names, as typed, stored in one attribute. I would then use a virtual field (is that the right term in Unidata?) to extract the data in upper case. I am more familiar with Universe, and the corresponding data definition and I-descriptor would look like this: >ED DICT TEST.UV NAME.INPUT NAME.SORT SELECTed record name = "NAME.INPUT". 6 lines long. : P 0001: D 0002: 1 0003: 0004: Name (as input) 0005: 30L 0006: M Bottom at line 6. : N SELECTed record name = "NAME.SORT". This is a Type "I" Descriptor last compiled on 08/24/07 at 17:12. 20 lines long. : P7 0001: I 0002: SUBR('-OCONVS',NAME.INPUT,'MCU') 0003: 0004: Name (for sorting) 0005: 30L 0006: M 0007: : X I'm sure there must be an equivalent in Unidata and someone smarter than I can explain it better. Derek Falkner Kingston, Ontario, Canada -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Wolverton Sent: August 24, 2007 1:51 PM To: u2-users@listserver.u2ug.org Subject: [U2] [ud] Question on Alpha Sorting... I have a need to sort people by LastName,FirstName. The issue is that we 'accept' data from lots of sources, some that are ProperCapped, some that are all lower, AND SOME THAT ARE ALL UPPER. I need to 'present' them correctly sorted, but show the data 'as it is' The record currently contains a MV list of the names 'as is' -- there could 500 names in the list. My way of handing it (now) is to open a New attribute that I put a 'ALL CAPS' version of the Name into, and then each insert, I so a LOCATE BY 'AL' into the new attribute, and insert the 'SORTNAME' into the new attribute, and the 'as TyPed NAme' as always - just now, we're not using the 'as typed' for the sort. My issue ... I've doubled the data being stored in order to accomplish this! Is there a more elegant, logical way to handle this issue besides having a 'SortName' attribute and an 'AsTyped' attribute in the record? Thanks for any thoughts for this Friday afternoon mind-tease! (Ah ... I miss D3's case insensitivity from time to time!!) David W. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [ud] Question on Alpha Sorting...
I don't know if it's the same in UD, but in UV I'd just create a extra DICT item with an MCU in the output convert field, sort on that, but display the original. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Wolverton Sent: Friday, August 24, 2007 12:51 PM To: u2-users@listserver.u2ug.org Subject: [U2] [ud] Question on Alpha Sorting... I have a need to sort people by LastName,FirstName. The issue is that we 'accept' data from lots of sources, some that are ProperCapped, some that are all lower, AND SOME THAT ARE ALL UPPER. I need to 'present' them correctly sorted, but show the data 'as it is' The record currently contains a MV list of the names 'as is' -- there could 500 names in the list. My way of handing it (now) is to open a New attribute that I put a 'ALL CAPS' version of the Name into, and then each insert, I so a LOCATE BY 'AL' into the new attribute, and insert the 'SORTNAME' into the new attribute, and the 'as TyPed NAme' as always - just now, we're not using the 'as typed' for the sort. My issue ... I've doubled the data being stored in order to accomplish this! Is there a more elegant, logical way to handle this issue besides having a 'SortName' attribute and an 'AsTyped' attribute in the record? Thanks for any thoughts for this Friday afternoon mind-tease! (Ah ... I miss D3's case insensitivity from time to time!!) David W. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material not intended for Public use. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is strictly prohibited. If you received this communication in error, please notify the sender and delete the material from any and all computers or devices. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [ud] Question on Alpha Sorting...
Do you deal with multiple entries for a name? Something you might think of is an XREF file. Build it with a key of the UPCASE name, removing spaces, comma's, periods, @FM, @VM, etc. to make it basically letters (and maybe numbers). Then put the original value in an attribute and use the LOCATE on it to keep the printable versions of the name in sorted order. You could easily make the update of this XREF file into a subroutine that could be called from another program or as a main program that uses a SELECT.LIST, depending on your needs. From the numbers you've mentioned, it should be very fast and clean, provided you set up the subroutine cleanly. BobW -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Wolverton Sent: Friday, August 24, 2007 2:15 PM To: u2-users@listserver.u2ug.org Subject: RE: [U2] [ud] Question on Alpha Sorting... I was just concerned about this record, as names get added individually -- I thought about doing an UPCASE on a memory version of the MultiValue list, but once that list gets to having 100 or 200 names on it, would the 'hit' for doing an UPCASE on an in-memory version be 'less than' the disk-access time for the larger item... Falls into the 'is there a better way' category of thinking. Like I said -- D3 has sorting WAY better than U2 in this area. (*Just* this one area, but in this case, it's all I'm talking about! ) > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of jjuser ud2 > Sent: Friday, August 24, 2007 2:47 PM > To: u2-users@listserver.u2ug.org > Subject: Re: [U2] [ud] Question on Alpha Sorting... > > Hmm...doing it programmatically...multi-dimensional array? > > DAVINCI,LEONARDO > Doe,John > Jesse,Sally > > becomes > [1] [2] > DAVINCI,LEONARDO DAVINCI,LEONARDO > Doe,John DOE,JOHN > Raphael,Sally RAPHAEL,SALLY > > And then you can sort by [2], but display [1]? That way it > just stays in memory and the data stored in the database > remains the same? --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [ud] Question on Alpha Sorting...
David: Create a virtual dictionary that upper cases the name. Then you sort by the UCNAME but display the normal name. This works for me. Bill >-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On Behalf Of David >Wolverton >Sent: Friday, August 24, 2007 10:51 AM >To: u2-users@listserver.u2ug.org >Subject: [U2] [ud] Question on Alpha Sorting... > >I have a need to sort people by LastName,FirstName. > >The issue is that we 'accept' data from lots of sources, some that are >ProperCapped, some that are all lower, AND SOME THAT ARE ALL UPPER. > >I need to 'present' them correctly sorted, but show the data 'as it is' > >The record currently contains a MV list of the names 'as is' -- there could >500 names in the list. > >My way of handing it (now) is to open a New attribute that I put a 'ALL >CAPS' version of the Name into, and then each insert, I so a LOCATE BY 'AL' >into the new attribute, and insert the 'SORTNAME' into the new attribute, >and the 'as TyPed NAme' as always - just now, we're not using the 'as typed' >for the sort. > >My issue ... I've doubled the data being stored in order to accomplish this! >Is there a more elegant, logical way to handle this issue besides having a >'SortName' attribute and an 'AsTyped' attribute in the record? > >Thanks for any thoughts for this Friday afternoon mind-tease! (Ah ... I >miss D3's case insensitivity from time to time!!) > > >David W. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [ud] Question on Alpha Sorting...
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Wolverton Sent: Friday, August 24, 2007 12:51 PM To: u2-users@listserver.u2ug.org Subject: [U2] [ud] Question on Alpha Sorting... I have a need to sort people by LastName,FirstName. The issue is that we 'accept' data from lots of sources, some that are ProperCapped, some that are all lower, AND SOME THAT ARE ALL UPPER. I need to 'present' them correctly sorted, but show the data 'as it is' The record currently contains a MV list of the names 'as is' -- there could 500 names in the list. My way of handing it (now) is to open a New attribute that I put a 'ALL CAPS' version of the Name into, and then each insert, I so a LOCATE BY 'AL' into the new attribute, and insert the 'SORTNAME' into the new attribute, and the 'as TyPed NAme' as always - just now, we're not using the 'as typed' for the sort. My issue ... I've doubled the data being stored in order to accomplish this! Is there a more elegant, logical way to handle this issue besides having a 'SortName' attribute and an 'AsTyped' attribute in the record? Thanks for any thoughts for this Friday afternoon mind-tease! (Ah ... I miss D3's case insensitivity from time to time!!) David W. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material not intended for Public use. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is strictly prohibited. If you received this communication in error, please notify the sender and delete the material from any and all computers or devices. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [ud] Question on Alpha Sorting...
I don't know about UD but in UV isn't there a way to turn off the case sensitivity? Eric -Original Message- From: David Wolverton [mailto:[EMAIL PROTECTED] Sent: Friday, August 24, 2007 10:51 AM To: u2-users@listserver.u2ug.org Subject: [U2] [ud] Question on Alpha Sorting... I have a need to sort people by LastName,FirstName. The issue is that we 'accept' data from lots of sources, some that are ProperCapped, some that are all lower, AND SOME THAT ARE ALL UPPER. I need to 'present' them correctly sorted, but show the data 'as it is' The record currently contains a MV list of the names 'as is' -- there could 500 names in the list. My way of handing it (now) is to open a New attribute that I put a 'ALL CAPS' version of the Name into, and then each insert, I so a LOCATE BY 'AL' into the new attribute, and insert the 'SORTNAME' into the new attribute, and the 'as TyPed NAme' as always - just now, we're not using the 'as typed' for the sort. My issue ... I've doubled the data being stored in order to accomplish this! Is there a more elegant, logical way to handle this issue besides having a 'SortName' attribute and an 'AsTyped' attribute in the record? Thanks for any thoughts for this Friday afternoon mind-tease! (Ah ... I miss D3's case insensitivity from time to time!!) David W. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [ud] Question on Alpha Sorting...
The issue for me is that I am using the list of employees within a program - so Virtual Dictionaries are not an option - displaying the data. I certainly don't want to sort it on use each time, which means I need to do an insert BY "AL" -- but in order to do that I have to have the list ready on read, but I insert names into the list one at a time -- hence I throught I would have to maintain two attributes -- one 'as keyed' and one in 'sort case' -- my other choice is to UPCASE the 'as keyed' each time I have to do an insert. I guess that's my question: Which is better Write a record with two sets of data, one 'as typed' one strictly for sorting, so that on the next insert, I just create a sort version of the new name, and insert it in both lists. The downside here is the record is larger. OR Use UPCASE on each need to insert to build the 'insert array' as needed, find the insert position in that array, then insert the 'AsTyped'. The downside to me was having to UPCASE each time an insert is needed. I'm trying to figure out the lesser of the evils! > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Bill Haskett > Sent: Friday, August 24, 2007 5:48 PM > To: u2-users@listserver.u2ug.org > Subject: RE: [U2] [ud] Question on Alpha Sorting... > > David: > > Create a virtual dictionary that upper cases the name. Then > you sort by the UCNAME but display the normal name. This > works for me. > > Bill --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [ud] Question on Alpha Sorting...
I think I would want to encapsulate that logic in one place. Probably write a function or subr to be called from any pgm or referenced by a dictionary V-item. Store the names "as typed" in the data record, and NOT repeated as all-caps. Then maybe index the V-item upcased subroutine result. That would give the function something to check to prevent duplicates when inserting new names, assuming that is an issue. At any rate, the function would be a self-contained blackbox, consistent for all present & future use. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [ud] Question on Alpha Sorting...
My answer to "Which is better" would be "it depends". If you're looking for run-time performance and disk is not an issue, go with the first. Although having duplicate data leaves a bad taste in most of our mouths, the purpose of the computer is to do the "grunt work" for us. Sometimes elegance has to take a back seat. If disk space and records sizes are more important, the latter is a better answer. My 2 cents. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Wolverton Sent: Friday, August 24, 2007 8:03 PM To: u2-users@listserver.u2ug.org Subject: RE: [U2] [ud] Question on Alpha Sorting... The issue for me is that I am using the list of employees within a program - so Virtual Dictionaries are not an option - displaying the data. I certainly don't want to sort it on use each time, which means I need to do an insert BY "AL" -- but in order to do that I have to have the list ready on read, but I insert names into the list one at a time -- hence I throught I would have to maintain two attributes -- one 'as keyed' and one in 'sort case' -- my other choice is to UPCASE the 'as keyed' each time I have to do an insert. I guess that's my question: Which is better Write a record with two sets of data, one 'as typed' one strictly for sorting, so that on the next insert, I just create a sort version of the new name, and insert it in both lists. The downside here is the record is larger. OR Use UPCASE on each need to insert to build the 'insert array' as needed, find the insert position in that array, then insert the 'AsTyped'. The downside to me was having to UPCASE each time an insert is needed. I'm trying to figure out the lesser of the evils! > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Bill Haskett > Sent: Friday, August 24, 2007 5:48 PM > To: u2-users@listserver.u2ug.org > Subject: RE: [U2] [ud] Question on Alpha Sorting... > > David: > > Create a virtual dictionary that upper cases the name. Then > you sort by the UCNAME but display the normal name. This > works for me. > > Bill --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material not intended for Public use. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is strictly prohibited. If you received this communication in error, please notify the sender and delete the material from any and all computers or devices. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] [ud] Question on Alpha Sorting...
David, In terms of "which is better" for sorting inside a program, working with in-memory strings should be faster than writing to disk. And with less than a thousand names, it probably won't be noticeably faster whether you UPCASE() each time you insert, or maintain a separate UPCASE'd variable. I'm guessing that you'll also have an ID value associated with the name; that means LOCATE'ing on values. Field-marks in Universe (and I'm guessing in Unidata too) are optimized for traversing back and forth. Value-marks aren't, so when you INSERT a value after a LOCATE, the run-machine has to start at character one and find each value until it hits the specific value mark count. Ideally, you should be using field-mark delimited lists, but practically I don't think it would be noticeable. rex --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] [ud] Question on Alpha Sorting...
Somebody try timing it with 10K names and let us know the speed differences :) On 8/27/07, Rex Gozar <[EMAIL PROTECTED]> wrote: > David, > > In terms of "which is better" for sorting inside a program, working with > in-memory strings should be faster than writing to disk. And with less > than a thousand names, it probably won't be noticeably faster whether > you UPCASE() each time you insert, or maintain a separate UPCASE'd variable. > > I'm guessing that you'll also have an ID value associated with the name; > that means LOCATE'ing on values. Field-marks in Universe (and I'm > guessing in Unidata too) are optimized for traversing back and forth. > Value-marks aren't, so when you INSERT a value after a LOCATE, the > run-machine has to start at character one and find each value until it > hits the specific value mark count. Ideally, you should be using > field-mark delimited lists, but practically I don't think it would be > noticeable. > > rex > --- > u2-users mailing list > u2-users@listserver.u2ug.org > To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] [ud] Question on Alpha Sorting...
jjuser ud2 wrote: > Somebody try timing it with 10K names and let us know the speed differences :) Thanks for volunteering, jjuser! But seriously, David's email said he had 500 names, 1/20th of your suggested test sample. My point was that the user probably wouldn't perceive the difference either way he decides to implement it. And at 500 names, I'm assuming that he's not inserting a new name every minute of every day (of course, we all know what happens when we "assume".) rex --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [ud] Question on Alpha Sorting...
David, Doubtless you'll have coded this by now, but certainly in the situation you describe, I'd store just the 'as typed' case version of the list on disk, then immediately after read, I'd create an in memory 'all uppercase' version in one go - just UPCASE the whole attribute - and I'd probably RAISE it to because I like working with multi-attributed lists in preference to multi-valued. Then, for each insert into the list I'd LOCATE BY 'AL' the UPCASEd version of my new name in my UPCASEd complete list, SETTING an attribute index position and then INS before the relevant attribute in my UPCASEd list and before the relevant value in my 'as typed' array. The CPU overhead of UPCASEing the whole name list should not be much because it is a single pass through a string applying a simple transformation with no growth or shrinkage involved. The risks involved in maintaining 2 parallel lists on disk along with the messiness of that solution would be enough to rule that option out for me. Cheers, Ken David Wolverton wrote: > The issue for me is that I am using the list of employees within a > program - so Virtual Dictionaries are not an option - displaying the > data. I certainly don't want to sort it on use each time, which > means I need to do an insert BY "AL" -- but in order to do that I > have to have the list ready on read, but I insert names into the list > one at a time -- hence I throught I would have to maintain two > attributes -- one 'as keyed' and one in 'sort case' -- my other > choice is to UPCASE the 'as keyed' each time I have to do an insert. > > I guess that's my question: > > Which is better > > Write a record with two sets of data, one 'as typed' one strictly for > sorting, so that on the next insert, I just create a sort version of > the new name, and insert it in both lists. The downside here is the > record is larger. > OR > Use UPCASE on each need to insert to build the 'insert array' as > needed, find the insert position in that array, then insert the > 'AsTyped'. The downside to me was having to UPCASE each time an > insert is needed. > > I'm trying to figure out the lesser of the evils! --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [ud] Question on Alpha Sorting...
Yes - project finished - I ended up coding it to do the UPCASE on the fly by moving the current Attribute into a WorkVariable and UPCASEing the WorkVariable. Ultimately, it seemed better than 'permenantly' wasting the space on disk when we may never have to do another insert. I didn't do the doing RAISE on that WorkVariable, however, since it was a single attribute, I didn't think I would 'gain' much on the LOCATE -- but I'll have to do some testing along the way to see... Subject of a new email thread! How much speed gain is there on a LOCATE by attributes vs LOCATE within a Single Attribute by Value?? Thanks for all the feedback guys n gals! > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Ken Wallis > Sent: Tuesday, August 28, 2007 9:22 AM > To: u2-users@listserver.u2ug.org > Subject: RE: [U2] [ud] Question on Alpha Sorting... > > David, > > Doubtless you'll have coded this by now, but certainly in the > situation you describe, --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] [ud] Question on Alpha Sorting...
Could anyone elaborate on the "optimization" around Field-marks. A while back, I started avoiding traditional references to dynamic arrays (array) within loops because of the inefficiencies of having to traverse the array from the first character to the desired attribute during each iteration of the loop. I traditionally use a LOOP + REMOVE construct which seems to be much faster. Is there some sort of Unidata optimization related to Field marks/Attribute marks that I am not aware of as referenced by Rex in the comment below or is this just a Universe thing? Dan Eichholz Internet Production, Inc. 651-717-4323 [EMAIL PROTECTED] David, In terms of "which is better" for sorting inside a program, working with in-memory strings should be faster than writing to disk. And with less than a thousand names, it probably won't be noticeably faster whether you UPCASE() each time you insert, or maintain a separate UPCASE'd variable. I'm guessing that you'll also have an ID value associated with the name; that means LOCATE'ing on values. Field-marks in Universe (and I'm guessing in Unidata too) are optimized for traversing back and forth. Value-marks aren't, so when you INSERT a value after a LOCATE, the run-machine has to start at character one and find each value until it hits the specific value mark count. Ideally, you should be using field-mark delimited lists, but practically I don't think it would be noticeable. rex --- --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] [ud] Question on Alpha Sorting...
Hi Dan, I tried some experiments a few years ago and convinced myself that UniData does not have field hints as supported in UniVerse. This may have changed but I cannot recall seeing any announcement of this. Martin Phillips Ladybridge Systems Ltd 17b Coldstream Lane, Hardingstone, Northampton, NN4 6DB +44-(0)1604-709200 --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/