Re: [U2] Old Dog, New Tricks

2007-03-12 Thread brian
Or just use $OPTIONS EXTRA.DELIM.

This ensures that an empty element is still added with the correct delimiter.

Brian


In message [EMAIL PROTECTED], Allen E. 
Elwood [EMAIL PROTECTED] writes
You can always test,

IF TEMP = '' THEN TEMP = NULL

and likewise on the end that processes after the ARRAY is completed.

1~2~NULL~4~5~NULL~...

on the receiving end would be

IF ARRAYWHATEVER = NULL THEN ARRAYWHATEVER = 

If you're going to do that, use (I think) EREPLACE. I think it's that 
function, but there's certainly one to remove all occurrences of a 
particular text. The danger is that the letters NULL will be part of a 
value which then gets corrupted...

I always did

ARRAY := @FM : WHATEVER

and then at the end did

DEL ARRAY1

Cheers,
Wol
-- 
Anthony W. Youngman [EMAIL PROTECTED]
'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The man
lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
Visit the MaVerick web-site - http://www.maverick-dbms.org Open Source Pick
---
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] Old Dog, New Tricks

2007-03-11 Thread Anthony W. Youngman
In message [EMAIL PROTECTED], Allen E. 
Elwood [EMAIL PROTECTED] writes

You can always test,

IF TEMP = '' THEN TEMP = NULL

and likewise on the end that processes after the ARRAY is completed.

1~2~NULL~4~5~NULL~...

on the receiving end would be

IF ARRAYWHATEVER = NULL THEN ARRAYWHATEVER = 


If you're going to do that, use (I think) EREPLACE. I think it's that 
function, but there's certainly one to remove all occurrences of a 
particular text. The danger is that the letters NULL will be part of a 
value which then gets corrupted...


I always did

ARRAY := @FM : WHATEVER

and then at the end did

DEL ARRAY1

Cheers,
Wol
--
Anthony W. Youngman [EMAIL PROTECTED]
'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The man
lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
Visit the MaVerick web-site - http://www.maverick-dbms.org Open Source Pick
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Old Dog, New Tricks

2007-03-11 Thread MAJ Programming
Interesting concept, putting the delimiter in the 1 position then deleting
it. Makes the IF within the LOOP not needed.
- Original Message -
From: Anthony W. Youngman [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Sunday, March 11, 2007 5:12 PM
Subject: Re: [U2] Old Dog, New Tricks


 In message [EMAIL PROTECTED], Allen E.
 Elwood [EMAIL PROTECTED] writes
 You can always test,
 
 IF TEMP = '' THEN TEMP = NULL
 
 and likewise on the end that processes after the ARRAY is completed.
 
 1~2~NULL~4~5~NULL~...
 
 on the receiving end would be
 
 IF ARRAYWHATEVER = NULL THEN ARRAYWHATEVER = 

 If you're going to do that, use (I think) EREPLACE. I think it's that
 function, but there's certainly one to remove all occurrences of a
 particular text. The danger is that the letters NULL will be part of a
 value which then gets corrupted...

 I always did

 ARRAY := @FM : WHATEVER

 and then at the end did

 DEL ARRAY1

 Cheers,
 Wol
 --
 Anthony W. Youngman [EMAIL PROTECTED]
 'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
 thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The
man
 lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
 Visit the MaVerick web-site - http://www.maverick-dbms.org Open Source
Pick
 ---
 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/


[U2] Old Dog, New Tricks

2007-03-09 Thread Bjorn Behr
The only problem with using -1 is that it the value is null, it does not
append it. This could cause problems, esp. when doing this with dependant
rows.

Program Example:
001 ARRAY = 
002 FOR J = 1 TO 10
003IF (NOT(MOD(J,5))) THEN
004   TEMP = 
005END ELSE
006   TEMP = J
007END
008ARRAY-1 = TEMP
009 NEXT J
010 CRT ARRAY

Result:
1~2~3~4~6~7~8~9~

Regards
Bjorn Behr
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Old Dog, New Tricks

2007-03-09 Thread Ray Wurlod
In UniVerse, $OPTIONS EXTRA.DELIM

 - Original Message -
 From: Bjorn Behr [EMAIL PROTECTED]
 To: u2-users@listserver.u2ug.org
 Subject: [U2] Old Dog, New Tricks
 Date: Fri, 9 Mar 2007 10:47:32 +0200
 
 
 The only problem with using -1 is that it the value is null, it does not
 append it. This could cause problems, esp. when doing this with dependant
 rows.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] old dog, new tricks

2007-03-09 Thread gerry-u2ug
raise()  lower() are your friends 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Scott Ballinger
Sent: March 8, 2007 9:10 PM
To: u2-users@listserver.u2ug.org
Subject: [U2] old dog, new tricks

snip /

Also, I think UV is optimized for AMs vs VMs, so that it pays to CONVERT
@VM TO @AM IN XXX, do your thing, then CONVERT @VM TO @AM IN XXX back
when done if you need VMs.

snip /

/Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] old dog, new tricks

2007-03-09 Thread MAJ Programming
Is the internal methods behind REMOVE the same as EXTRACT (or ).

Again, about a year ago, I had an issue with an attributed xref rec of the
invoices for a customer that had grown to almost 150,000 invoices.

The original programmer used  with a counter and it took very long to
'age' that cust on an inquiry screen. (don't solve my A/R problems).

This was on a D3 box. So I utilized the REMOVE command and it went from
around 3 minutes to around 15 seconds.

BTW. To use REMOVE on D3, you need the OPTION $EXT command earlier.

I'm gonna try your LEN vs # to see if that makes sense. As an experienced
programmer though, I would have to see if it really matters on regular small
values instead of these monster values. I've used # a zillion times.

Thanks
Mark johnson
- Original Message -
From: Stevenson, Charles [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Friday, March 09, 2007 1:48 AM
Subject: RE: [U2] old dog, new tricks


 To add to Adrian's explanation, when a string is in memory, the first
 few bytes at that string's address is not actual data, but metadata
 about the string, including its length, so UV immediately knows where
 the string ends ( where the next string begins).
 Therefore -1 can make an immediate jump, rather than searching through
 the string counting attributes.

 This also implies that something like
 IF LEN( X ) THEN
 is faster than something like
 IF (X # '') THEN
 .

 You can also see why n,-1  n,m,-1 aren't particularly fast, since
 they aren't at the end of the srting.

 UV keeps similar metadata up front about the last attribute accessed, 
 the remove pointer.  That is what makes both REMOVE/REVREMOVE and
 EXTRACTs of sequential ns so fast.

 cds
 ---
 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] Old Dog, New Tricks

2007-03-09 Thread MAJ Programming
I've run into many sets of dissyncronized mv values because of this. Thus,
my brain now forces me to do a DCOUNT of the independent attribute to get
the current number of values and increment from there.

I've even seen this code

X1,-1=CHAR(253):FRED

that really screwed things up. No excuse for using a delimiter when
delimiters are implied.

My 1 cent
Mark Johnson
- Original Message -
From: Bjorn Behr [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Friday, March 09, 2007 3:47 AM
Subject: [U2] Old Dog, New Tricks


 The only problem with using -1 is that it the value is null, it does not
 append it. This could cause problems, esp. when doing this with dependant
 rows.

 Program Example:
 001 ARRAY = 
 002 FOR J = 1 TO 10
 003IF (NOT(MOD(J,5))) THEN
 004   TEMP = 
 005END ELSE
 006   TEMP = J
 007END
 008ARRAY-1 = TEMP
 009 NEXT J
 010 CRT ARRAY

 Result:
 1~2~3~4~6~7~8~9~

 Regards
 Bjorn Behr
 ---
 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] Old Dog, New Tricks

2007-03-09 Thread Allen E. Elwood
You can always test,

IF TEMP = '' THEN TEMP = NULL

and likewise on the end that processes after the ARRAY is completed.

1~2~NULL~4~5~NULL~...

on the receiving end would be

IF ARRAYWHATEVER = NULL THEN ARRAYWHATEVER = 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Bjorn Behr
Sent: Friday, March 09, 2007 00:48
To: u2-users@listserver.u2ug.org
Subject: [U2] Old Dog, New Tricks


The only problem with using -1 is that it the value is null, it does not
append it. This could cause problems, esp. when doing this with dependant
rows.

Program Example:
001 ARRAY = 
002 FOR J = 1 TO 10
003IF (NOT(MOD(J,5))) THEN
004   TEMP = 
005END ELSE
006   TEMP = J
007END
008ARRAY-1 = TEMP
009 NEXT J
010 CRT ARRAY

Result:
1~2~3~4~6~7~8~9~

Regards
Bjorn Behr
---
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] old dog, new tricks

2007-03-08 Thread Womack, Adrian
This is more of an old trick.

The reason that -1 is so much faster is because using -1 just
appends to an already existing string in memory. Where using n will
cause an entirely new string to be created and the old one thrown away
(to be eventually garbage collected). The process gets slower  slower
as each successive string becomes larger and larger.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Scott Ballinger
Sent: Friday, 9 March 2007 11:10 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] old dog, new tricks

Perhaps this is not a revelation to many of you, but I did not realize
how _much_ faster it is to append items to a large array using -1 vs.
an incrementing count, e.g. n. I was trying to speed up a program that
builds large arrays, and changed to the -1 style append.

Wow [can I say that? this is a linux box, not MS-Vista; is wow
copyrighted yet?], huge improvement! (UV 10.1.4 pick flavor, intel cpu).
Of course, when using -1 you need to check for nulls as appropriate,
but even adding after adding code to test for and handle appending a
null attribute this is still way faster.

Also, I think UV is optimized for AMs vs VMs, so that it pays to CONVERT
@VM TO @AM IN XXX, do your thing, then CONVERT @VM TO @AM IN XXX back
when done if you need VMs.

/Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006





DISCLAIMER:
Disclaimer.  This e-mail is private and confidential. If you are not the 
intended recipient, please advise us by return e-mail immediately, and delete 
the e-mail and any attachments without using or disclosing the contents in any 
way. The views expressed in this e-mail are those of the author, and do not 
represent those of this company unless this is clearly indicated. You should 
scan this e-mail and any attachments for viruses. This company accepts no 
liability for any direct or indirect damage or loss resulting from the use of 
any attachments to this e-mail.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] old dog, new tricks

2007-03-08 Thread MAJ Programming
This review came up a year ago. -1 is an append on the attribute level.
1,-1 is not as effecient as it doesn't know that the record is only one
attribute long.

I don't know about U2, but if I detect a very large appended item, say over
30,000 attributes, I use a DIM array and a counter. This is for exporting
HTML or large text files.

If you have OSWRITESEQ (I forget what it's called), you can write
appendingly. After all, what's the next step after building your large -1
array.

My 1 cent
Mark Johnson
- Original Message -
From: Womack, Adrian [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Thursday, March 08, 2007 10:40 PM
Subject: RE: [U2] old dog, new tricks


 This is more of an old trick.

 The reason that -1 is so much faster is because using -1 just
 appends to an already existing string in memory. Where using n will
 cause an entirely new string to be created and the old one thrown away
 (to be eventually garbage collected). The process gets slower  slower
 as each successive string becomes larger and larger.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Scott Ballinger
 Sent: Friday, 9 March 2007 11:10 AM
 To: u2-users@listserver.u2ug.org
 Subject: [U2] old dog, new tricks

 Perhaps this is not a revelation to many of you, but I did not realize
 how _much_ faster it is to append items to a large array using -1 vs.
 an incrementing count, e.g. n. I was trying to speed up a program that
 builds large arrays, and changed to the -1 style append.

 Wow [can I say that? this is a linux box, not MS-Vista; is wow
 copyrighted yet?], huge improvement! (UV 10.1.4 pick flavor, intel cpu).
 Of course, when using -1 you need to check for nulls as appropriate,
 but even adding after adding code to test for and handle appending a
 null attribute this is still way faster.

 Also, I think UV is optimized for AMs vs VMs, so that it pays to CONVERT
 @VM TO @AM IN XXX, do your thing, then CONVERT @VM TO @AM IN XXX back
 when done if you need VMs.

 /Scott Ballinger
 Pareto Corporation
 Edmonds WA USA
 206 713 6006





 DISCLAIMER:
 Disclaimer.  This e-mail is private and confidential. If you are not the
intended recipient, please advise us by return e-mail immediately, and
delete the e-mail and any attachments without using or disclosing the
contents in any way. The views expressed in this e-mail are those of the
author, and do not represent those of this company unless this is clearly
indicated. You should scan this e-mail and any attachments for viruses. This
company accepts no liability for any direct or indirect damage or loss
resulting from the use of any attachments to this e-mail.
 ---
 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] old dog, new tricks

2007-03-08 Thread Dave R
R77 dog better trick!

I too have had to build large arrays for text files and on a U2 db I
use the writeseq's. 

I have also used writev with a ,-1 this slows way down when are over
5000 atts, I think it gets hung up on all the writes, os I switched it
one att line with the text and wrote it to a hashed file, I then used a
qselect and a save list to resemble the rows, and a copy-list to move
the record. 30,000 rows in a blink!

My thinking was that the DC type file the frames are contiguous like
cataloged programs and large saved lists these are also optimized. I
think UD saves these in linked frames not contiguous files. But the
copy list still works. 

I have use this method on 250,000+ line/row email spam lists to reduce
a 6 hour process down to 16 minutes, including the dedup step.

Regards, 
Dave Raven 
e Fax (815)4259364
P.O. Box 17811, Irvine CA 92623-7811

-- MAJ Programming [EMAIL PROTECTED] wrote:
This review came up a year ago. -1 is an append on the attribute level.
1,-1 is not as efficient as it doesn't know that the record is only one
attribute long.

I don't know about U2, but if I detect a very large appended item, say over
30,000 attributes, I use a DIM array and a counter. This is for exporting
HTML or large text files.

If you have OSWRITESEQ (I forget what it's called), you can write
appendingly. After all, what's the next step after building your large -1
array.

My 1 cent
Mark Johnson
- Original Message -
From: Womack, Adrian [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Thursday, March 08, 2007 10:40 PM
Subject: RE: [U2] old dog, new tricks


 This is more of an old trick.

 The reason that -1 is so much faster is because using -1 just
 appends to an already existing string in memory. Where using n will
 cause an entirely new string to be created and the old one thrown away
 (to be eventually garbage collected). The process gets slower  slower
 as each successive string becomes larger and larger.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Scott Ballinger
 Sent: Friday, 9 March 2007 11:10 AM
 To: u2-users@listserver.u2ug.org
 Subject: [U2] old dog, new tricks

 Perhaps this is not a revelation to many of you, but I did not realize
 how _much_ faster it is to append items to a large array using -1 vs.
 an incrementing count, e.g. n. I was trying to speed up a program that
 builds large arrays, and changed to the -1 style append.

 Wow [can I say that? this is a linux box, not MS-Vista; is wow
 copyrighted yet?], huge improvement! (UV 10.1.4 pick flavor, intel cpu).
 Of course, when using -1 you need to check for nulls as appropriate,
 but even adding after adding code to test for and handle appending a
 null attribute this is still way faster.

 Also, I think UV is optimized for AMs vs VMs, so that it pays to CONVERT
 @VM TO @AM IN XXX, do your thing, then CONVERT @VM TO @AM IN XXX back
 when done if you need VMs.

 /Scott Ballinger
 Pareto Corporation
 Edmonds WA USA
 206 713 6006





 DISCLAIMER:
 Disclaimer.  This e-mail is private and confidential. If you are not the
intended recipient, please advise us by return e-mail immediately, and
delete the e-mail and any attachments without using or disclosing the
contents in any way. The views expressed in this e-mail are those of the
author, and do not represent those of this company unless this is clearly
indicated. You should scan this e-mail and any attachments for viruses.
This
company accepts no liability for any direct or indirect damage or loss
resulting from the use of any attachments to this e-mail.
 ---
 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/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] old dog, new tricks

2007-03-08 Thread Stevenson, Charles
To add to Adrian's explanation, when a string is in memory, the first
few bytes at that string's address is not actual data, but metadata
about the string, including its length, so UV immediately knows where
the string ends ( where the next string begins).
Therefore -1 can make an immediate jump, rather than searching through
the string counting attributes.

This also implies that something like
IF LEN( X ) THEN
is faster than something like
IF (X # '') THEN
.

You can also see why n,-1  n,m,-1 aren't particularly fast, since
they aren't at the end of the srting.

UV keeps similar metadata up front about the last attribute accessed, 
the remove pointer.  That is what makes both REMOVE/REVREMOVE and
EXTRACTs of sequential ns so fast.

cds
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/