PARM Fname SortDate entry=main #@setvar hpcmdtrace true # SORTS a list of file names produced by the LISTFX command file. # Initialize vars here, issue file equations, etc. if '!entry' = 'main' then echo **Performing requested sort. Please wait... setvar _sfFile "!Fname" setvar _sfSrtDt !SortDate build $newpass;rec=-256,,v,ascii;disc=![FINFO(_sfFile, "eof")] xeq !hpfile !_sfFile, !_sfSrtDt;entry="ReAdSoRt" $null return #Read redirected file, write out requested date and fname, Sort new file #Use variables from 'calling' command file to 'screen' files before sort elseif '!entry' = 'ReAdSoRt' then setvar _sfeof finfo(hpstdin,'eof') setvar _sfLimit _sfEof while SETVAR(_sfeof, _sfeof-1) >= 0 do setvar _lfFL RTRIM(INPUT()) if !_lfSelExp then echo ![FINFO(_lfFL, _sfSrtDt)] !_lfFL >>$oldpass endif endwhile if _sfLimit > 1 then xeq sort.hpbin.sys "!_lfSortDir" <$oldpass >$newpass endif file listfilx=$oldpass;DEL #@setvar hpcmdtrace false return endif