PARM fileset=./@ format=0 code=@ datea=@ datem=@ datec=@ entry=main # # Script to list files (via :listfile) based on name, filecode and date. # # fileset is the standard MPE or POSIX (./) fileset with wildcards. # # format is the standard lisfile format number or name. If a date is specified # and the format is 0 or 6 then the file's date/time is also displayed, else # the supplied format is used. # # The code default is "@" which means all filecodes can be selected; # otherwise, a filecode number or mnemonic is expected. # # The date values select files that have been accessed (dateA), or modified # (dateM), or created (dateC) since the supplied date value. Only one of datea, # datem, datec parameters can be used. date=@ means match all dates and is the # default. date=* or "today" means match files from today. Otherwise the date # syntax is: mm/dd[/yy[yy]] or mm-dd[-yy[yy]] # if '!entry' = 'main' then echo if "!code" = "@" then setvar _lf_seleq "" else setvar _lf_seleq ";seleq=[code=!code]" endif # deal with the date parms... if setvar(_lf_date,"!dateA!dateM!dateC") = "@@@" then # ignore date parms elseif "!dateA" <> "@" then if rht(_lf_date,2) <> "@@" then # dateA plus other dates echo Only ACCESS date is being checked; other dates ignored... echo endif setvar _lf_date "!dateA" setvar _lf_fi_date "accessed" setvar _lf_fi_time "fmtaccesstime" setvar _lf_verb "accessed" elseif "!dateM" <> "@" then if rht(_lf_date,1) <> "@" then # dateM plus other dates (already know that dateA='@') echo Only MODIFIED date is being checked; 'create' date ignored... echo endif setvar _lf_date "!dateM" setvar _lf_fi_date "moddate" setvar _lf_fi_time "fmtmodtime" setvar _lf_verb "modified" else # dateC= is not '@' and dateA='@' and dateM='@' setvar _lf_date "!dateC" setvar _lf_fi_date "created" setvar _lf_fi_time "fmtcreatetime" setvar _lf_verb "created" endif if _lf_date = "@@@" then # simple listfile works... continue listfile !fileset,!format !_lf_seleq deletevar _lf_@ return endif # continue processing the date specification if _lf_date = "*" or dwns(_lf_date) = "today" then setvar _lf_date hpyyyymmdd else # convert date from M-D-Y format to yyyymmdd format for finfo setvar _lf_dd rht("00"+word(_lf_date,"/-",2),2) setvar _lf_mm rht("00"+word(_lf_date,"/-"),2) if delimpos(_lf_date,"/-") = delimpos(_lf_date,"/-",-1) then # no year supplied setvar _lf_yyyy "!hpyyyy" else setvar _lf_yyyy word(_lf_date,"/-",-1) if len(_lf_yyyy) <> 4 then # prepend century if !_lf_yyyy <= hpsplityear then setvar _lf_yyyy decimal(![lft("!hpyyyy",2)]*100+!_lf_yyyy) else setvar _lf_yyyy decimal((![lft("!hpyyyy",2)]-1)*100+!_lf_yyyy) endif endif endif setvar _lf_date _lf_yyyy+_lf_mm+_lf_dd endif # convert date to integer format setvar _lf_date !_lf_date # now listfile the fileset to a temp file to do date compares errclear continue listfile !fileset,6 !_lf_seleq >lftmp if hpcierr = 0 then # read lftmp file and do date compares xeq !hpfile !fileset,!format,!code,!datea,!datem,!datec & entry=date_compare = & _lf_date then setvar _lf_match _lf_match + 1 if "!format" = "0" or "!format" = "6" then echo !_lf_fname ![rpt(' ',30-len(_lf_fname))] !_lf_verb & ![finfo(_lf_fname,"FMT"+_lf_fi_date)] & ![finfo(_lf_fname,_lf_fi_time)] else # user wants their specified format continue listfile !_lf_fname,!format endif endif endwhile echo echo !_lf_match out of !_lf_eof files match date. return endif