The obvious answer being overlooked by everyone is.... Sort the list.

If the disk has a small number of files (say, less than 1,000), just write a
bubble sort and put the list in order yourself. If the number of files is
large, then you might have to write a more complex sort to do it
efficiently.

I'm not sure what "LISTFILE" you're using, but mine, for my 191 minidisk,
does produce a sorted list of files.

Also, I just read through the documentation for DMSOPDIR... Nowhere in the
documentation does it suggest or imply that it might return the list of
files in any specific order whatsoever. Where did you get the impression
that it should return them in sorted order?

-- 
   .~.    Robert P. Nix             Mayo Foundation
   /V\    RO-OE-5-55                200 First Street SW
  /( )\   507-284-0844              Rochester, MN 55905
  ^^-^^   ----- 
        "In theory, theory and practice are the same, but
         in practice, theory and practice are different."




On 1/27/08 2:04 AM, "Fox Blue" <[EMAIL PROTECTED]> wrote:

> Kris, 
> 
> Well it is a R/W minidisk. It is the 191 of the machine.
> 
> Yesterday, I was also playing around with the LISTFILE command. It seems
> that it retrieves the file names in the same unordered way.
> 
> Regarding to your proposal, I wanted to program a CMS module that should
> not
> become dependent on external REXX EXEC(s).
> 
> I think the documentation (CMS Application Development Guide SC24-6069-02
> )
> should reflect that the directory is not sorted. I was browsing through i
> t
> and could not find any hint on this issue. Also the CMS Callable Services
> 
> Reference (SC24-6072-02) should contain a usage note referring to this.
> 
> Thanks anyway for your proposal to overcome this problem.
> 
> BR Fox. 
> 
> 
> On Sat, 26 Jan 2008 20:11:25 +0100, Kris Buelens <[EMAIL PROTECTED]>
>  wrote:
> 
>> I have no experience with DMSGETDF...
>> Is this a R/W minidisk?  Only for R/O minidisks CMS keeps the FST's sort
> ed.
>> 
>> I would make the program call a REXX EXEC that in its turn executes a
>> PIPE that contains a LISTFILE and SORT stage.  The PIPE could pass the
>> sorted list of files in the stack where your program retrieves them.
>> Or, more elegant, your assembler program allocates a buffer large
>> enough to store the result of the LISTFILE, prepares the PIPE command
>> with the LISTFILE and SORT, the last stage would be a STORAGE stage to
>> write the result in your program's buffer.
>> 
>> Kris Buelens,
>> IBM Belgium, VM customer support
>> ========================
> =========================
> ========================

Reply via email to