33    %local dirindicator_en dirindicator_de encoding s dirfile xwait xsync xmin l_i_path;
 
   34    %let dirindicator_en=Directory of;
 
   35    %let dirindicator_de=Verzeichnis von;
 
   36    %let encoding=pcoem850;
 
   37    %let l_i_path = %sysfunc(translate(&i_path,\,/));
 
   40       create table &o_out (filename 
char(255));
 
   42    %IF &syserr NE 0 %THEN %GOTO errexit;
 
   44    %let xwait=%sysfunc(getoption(xwait));
 
   45    %let xsync=%sysfunc(getoption(xsync));
 
   46    %let xmin =%sysfunc(getoption(xmin));
 
   48    options noxwait xsync xmin;
 
   50    %let dirfile=%sysfunc(pathname(work))\___dir.txt;
 
   51    filename _dirfile 
"&dirfile" encoding=&encoding;
 
   53    %put &g_note.(SASUNIT): Directory search is: &i_path;
 
   55    %IF &i_recursive %then %let s=/S;
 
   57    %SYSEXEC(dir &s /a-d 
"&l_i_path" > 
"&dirfile");
 
   59    options &xwait &xsync &xmin;
 
   61    data &o_out (keep=filename changed);
 
   62       length dir filename $255 language $2;
 
   63       retain language 
"__" dir FilePos;
 
   64       infile _dirfile truncover;
 
   65       input line $char255. @;
 
   66       if index (line, 
"&dirindicator_en") or index (line, "&dirindicator_de") then do;
 
   67          if index (line, "&dirindicator_en") then do;
 
   68             dir = substr(line, index (line, "&dirindicator_en")+length("&dirindicator_en")+1);
 
   71             dir = substr(line, index (line, "&dirindicator_de")+length("&dirindicator_de")+1);
 
   74       if substr(line,1,1) ne ' ' then do;
 
   75          * Check for presence of AM/PM in time value, because you can specify AM/PM timeformat in German Windows *;
 
   76          if (language = "__") then do;
 
   77             Detect_AM_PM = upcase (scan (line, 3, " "));
 
   78             if (Detect_AM_PM in ("AM", "PM")) then do;
 
   79                Filenamepart = scan (line,5, " ");
 
   80                Filepos      = index (line, trim(Filenamepart));
 
   84                Filenamepart = scan (line,4, " ");
 
   85                Filepos      = index (line, trim(Filenamepart));
 
   89          if language='DE' then do;
 
  101          changed  = dhms (d, hour(t), minute(t), 0);
 
  102          format changed datetime20.;
 
  103          filename = translate(trim(dir) !! '/' !! substr (line,FilePos),'/','\');