PDA

View Full Version : Sort Command



Glennbo
8-Jun-2005, 03:43 PM
Not DFSort.exe, but the actual Dataflex command "SORT".

Has anybody used it to create a non-DOS386 protected mode sort utility?

I've been playing around with some code to see about replacing the DOS
command DFSort.exe with a console mode capable sort utility. Here's the
code I have so far, which seems to work, but isn't as slick as I'd like.
Has anybody here done something like this that's more prettier? <GGG>

Integer File_Number Counter
String TempName FileName
For Counter From 0 to 75
Move (Counter + 1) to File_Number
Filelist File_Number to TempName FileName
If Not FileName EQ "" Begin
Open File_Number
If File_Number NE 50 Sort File_Number
End
If FileName EQ "" Move "Skipping" to FileName
Close (Counter + 1)
Clearscreen
Gotoxy 10 10
Showln "Now Sorting: " FileName
Loop

--
_______ _____ ___ _____ ____
/ ___/ / / __/ |/ / |/ / _ )/ __ \
/ (_ / /__/ _// / / _ / /_/ /
\___/____/___/_/|_/_/|_/____/\____/
---------------------------------------------------------------------
Glennbo These go to eleven
Non-Linear Sound http://www.soundclick.com/glennbo
Hear My Music http://www.soundclick.com/jambits

Glennbo
8-Jun-2005, 04:27 PM
The entity known as Glennbo, posted:

> Not DFSort.exe, but the actual Dataflex command "SORT".

This is a little cleaner. Now I'd like to OOPsize it and get the
callback function going so I can display progress.

Integer File_Number
String TempName FileName
For File_Number From 1 to 76
Filelist File_Number to TempName FileName
If Not FileName EQ "" Begin
Clearscreen
Gotoxy 10 10
Showln "Now Sorting: " FileName
Open File_Number
If File_Number NE 50 Sort File_Number
Close File_Number
End
Loop

--
_______ _____ ___ _____ ____
/ ___/ / / __/ |/ / |/ / _ )/ __ \
/ (_ / /__/ _// / / _ / /_/ /
\___/____/___/_/|_/_/|_/____/\____/
---------------------------------------------------------------------
Glennbo These go to eleven
Non-Linear Sound http://www.soundclick.com/glennbo
Hear My Music http://www.soundclick.com/jambits

Vincent Oorsprong
9-Jun-2005, 07:02 AM
Glennbo,

I wrote a DataFlex version of dfsort a couple of years ago. Don't know if it
is somewhere on the net but I believe it should. If you can't find it I can
send you a version per private email.

--
Kind Regards,
Vincent Oorsprong
Data Access Europe BV
Lansinkesweg 4
7553 AE Hengelo
The Netherlands
Telephone: +31 (0)74 - 255 56 09
Fax: +31 (0)74 - 250 34 66
http://www.dataaccess.nl

Glennbo
9-Jun-2005, 08:50 AM
The entity known as Vincent Oorsprong, posted:

> Glennbo,
>
> I wrote a DataFlex version of dfsort a couple of years ago. Don't know
> if it is somewhere on the net but I believe it should. If you can't
> find it I can send you a version per private email.

Send it to me, if it's not too much trouble.

Thanks!

--
_______ _____ ___ _____ ____
/ ___/ / / __/ |/ / |/ / _ )/ __ \
/ (_ / /__/ _// / / _ / /_/ /
\___/____/___/_/|_/_/|_/____/\____/
---------------------------------------------------------------------
Glennbo These go to eleven
Non-Linear Sound http://www.soundclick.com/glennbo
Hear My Music http://www.soundclick.com/jambits

Glennbo
9-Jun-2005, 08:52 AM
The entity known as Glennbo, posted:

>> Glennbo,
>>
>> I wrote a DataFlex version of dfsort a couple of years ago. Don't know
>> if it is somewhere on the net but I believe it should. If you can't
>> find it I can send you a version per private email.
>
> Send it to me, if it's not too much trouble.
>
> Thanks!

Oops, I just noticed I still have my old email address in my posts.

This one is valid vdrums@cox.net

--
_______ _____ ___ _____ ____
/ ___/ / / __/ |/ / |/ / _ )/ __ \
/ (_ / /__/ _// / / _ / /_/ /
\___/____/___/_/|_/_/|_/____/\____/
---------------------------------------------------------------------
Glennbo These go to eleven
Non-Linear Sound http://www.soundclick.com/glennbo
Hear My Music http://www.soundclick.com/jambits

Raveen Ryan Sundram
13-Jun-2005, 09:58 PM
Hi,

Has anyone been able to execute a command in background? We are using
DataFlex for Linux 2.0, and I've been toying with the idea of parallel
sorting - meaning, to run multiple sort processes in the background.

Any success stories?

Regards,
Raveen Ryan Sundram


"Glennbo" <vdrums@cox.net> wrote in message
news:Xns96705A47DD896BrownShoesDontMakeIt@192.245. 64.240...
> The entity known as Glennbo, posted:
>
>>> Glennbo,
>>>
>>> I wrote a DataFlex version of dfsort a couple of years ago. Don't know
>>> if it is somewhere on the net but I believe it should. If you can't
>>> find it I can send you a version per private email.
>>
>> Send it to me, if it's not too much trouble.
>>
>> Thanks!
>
> Oops, I just noticed I still have my old email address in my posts.
>
> This one is valid vdrums@cox.net
>
> --
> _______ _____ ___ _____ ____
> / ___/ / / __/ |/ / |/ / _ )/ __ \
> / (_ / /__/ _// / / _ / /_/ /
> \___/____/___/_/|_/_/|_/____/\____/
> ---------------------------------------------------------------------
> Glennbo These go to eleven
> Non-Linear Sound http://www.soundclick.com/glennbo
> Hear My Music http://www.soundclick.com/jambits
>

Joerg Thuemmler
14-Jun-2005, 12:52 AM
Raveen,

i can't see any problem - you can nearly all send to background if
there's no keyboard input needed, log the output with ">" and if
certain input is needed you can use "<" therefore. But i don't see
much success as well. If your databases aren't very small, sorting
uses as much as cpu calculating power and ram it can get. If you
start twice the sortings will have to share, espacially the cpu
consumption, so i think you will get two slower sortings. But you
should test simply. I started

# dfsort 54 >log1 &
[1] 21334
# dfsort 54 >log2 &
[2] 53346

both running well. Important! You have to redirect stdout (and
stderr better too) because it will not run without a output terminal.

regards

joerg

Raveen Ryan Sundram wrote:
> Hi,
>
> Has anyone been able to execute a command in background? We are using
> DataFlex for Linux 2.0, and I've been toying with the idea of parallel
> sorting - meaning, to run multiple sort processes in the background.
>
> Any success stories?
>
> Regards,
> Raveen Ryan Sundram
>
>
> "Glennbo" <vdrums@cox.net> wrote in message
> news:Xns96705A47DD896BrownShoesDontMakeIt@192.245. 64.240...
>
>>The entity known as Glennbo, posted:
>>
>>
>>>>Glennbo,
>>>>
>>>>I wrote a DataFlex version of dfsort a couple of years ago. Don't know
>>>>if it is somewhere on the net but I believe it should. If you can't
>>>>find it I can send you a version per private email.
>>>
>>>Send it to me, if it's not too much trouble.
>>>
>>>Thanks!
>>
>>Oops, I just noticed I still have my old email address in my posts.
>>
>>This one is valid vdrums@cox.net
>>
>>--
>> _______ _____ ___ _____ ____
>>/ ___/ / / __/ |/ / |/ / _ )/ __ \
>>/ (_ / /__/ _// / / _ / /_/ /
>>\___/____/___/_/|_/_/|_/____/\____/
>>---------------------------------------------------------------------
>>Glennbo These go to eleven
>>Non-Linear Sound http://www.soundclick.com/glennbo
>>Hear My Music http://www.soundclick.com/jambits
>>
>
>
>

Vincent Oorsprong
14-Jun-2005, 12:54 AM
Raveen,

I wonder what you try to achieve. The sort process is/should be a table
exclusive operation. Starting the sort process in the background could speed
up the process if the disk and memory I/O and processor were not used to the
optimum but you can not continue working with the data. So what to gain with
this?

--
Kind Regards,
Vincent Oorsprong
Data Access Europe BV
Lansinkesweg 4
7553 AE Hengelo
The Netherlands
Telephone: +31 (0)74 - 255 56 09
Fax: +31 (0)74 - 250 34 66
http://www.dataaccess.nl

Joerg Thuemmler
15-Jun-2005, 12:20 AM
Vincent,

He tries to sort two or more tables parallel. As I told, I don't
think it much faster then to run them sequentielly, but why not to
do parallel. But there are maybe problems with indices related to
other datafiles?

joerg

Vincent Oorsprong wrote:
> Raveen,
>
> I wonder what you try to achieve. The sort process is/should be a table
> exclusive operation. Starting the sort process in the background could speed
> up the process if the disk and memory I/O and processor were not used to the
> optimum but you can not continue working with the data. So what to gain with
> this?
>

Raveen Ryan Sundram
15-Jun-2005, 04:38 PM
Our sorting time is really long as we have many large databases - 30-40% and
others are quite manageable. I was hoping that by running parallel sort
commands these databases would be sorted faster - some testing would be
required. Hence, user wait time would be reduced.

Thanks for the input.


"Joerg Thuemmler" <listen@vordruckleitverlag.de> wrote in message
news:fWjiynWcFHA.788@dacmail.dataaccess.com...
> Vincent,
>
> He tries to sort two or more tables parallel. As I told, I don't think it
> much faster then to run them sequentielly, but why not to do parallel. But
> there are maybe problems with indices related to other datafiles?
>
> joerg
>
> Vincent Oorsprong wrote:
>> Raveen,
>>
>> I wonder what you try to achieve. The sort process is/should be a table
>> exclusive operation. Starting the sort process in the background could
>> speed up the process if the disk and memory I/O and processor were not
>> used to the optimum but you can not continue working with the data. So
>> what to gain with this?
>>

Vincent Oorsprong
16-Jun-2005, 12:55 AM
Raveen,

You can of course sort from multiple pc's at the same time. The bottleneck
will be the disk and network I/O.

Also take a look at the memory configuration settings you can use for
dfsort/sort command. Swapping out to disk during sort is of course much
slower than when it all takes place in memory.

Another thing; If you have to sort regularly you should find out why it is
necessary so often. Many systems do (almost) never reindex. If reindex is
necessary because of failing systems (users) and you cannot solve this
problem you can look at using a client server database (PSQL, DB/2, MSSQL
etc) since reindexing on such systems is hardly never needed. If reindex is
needed because of database structure changes there is not much you can do
else than combine the updates instead of doing them more often (if
possible).

--
Kind Regards,
Vincent Oorsprong
Data Access Europe BV
Lansinkesweg 4
7553 AE Hengelo
The Netherlands
Telephone: +31 (0)74 - 255 56 09
Fax: +31 (0)74 - 250 34 66
http://www.dataaccess.nl