I have a routine that reads in data from a file, creates a bunch of stem variables, then calls the Windows SORT command to, um, sort them.
For reasons I can't fathom, it randomly gives me back fewer records than I put into it.
I would be delighted to be shown where in my code I'm doing something wrong. Here's a snip of the code:
<create stem variables called oline.<n>
oc = oline.0 /* Set number of records I want to SORT */
Address System 'SORT' With Input Stem oline. Output Stem sline.
If oc <> sline.0 Then Do
Say "AARGH, SORT has mangled the data again"
Say "Records in was "oc", records back from sort was "sline.0
I can run it again and again and again (and again) and eventually it will work - although it can take any number of attempts from 1 to 20 (or more, may more...) before number of input records equals the number of sorted records. The number returned by SORT seems to be random, it's definitely not the same each time,
Any ideas ? I can forward on the whole program if someone has the heart to look through it...
Thanks in advance
Nick Varley - firstname.lastname@example.org