Monday, April 2, 2018

SAS: List files in directory




I will just leave this here so I can find it later...


* which data files are available?
* macro copied from http://documentation.sas.com/?docsetId=mcrolref&docsetTarget=n0js70lrkxo6uvn1fl4a5aafnlgt.htm&docsetVersion=9.4&locale=en;
* with BQ mods to write file list to a sas table ;

%macro list_files(dir,ext);
  %local filrf rc did memcnt name i;
  %let rc=%sysfunc(filename(filrf,&dir));
  %let did=%sysfunc(dopen(&filrf));     

   %if &did eq 0 %then %do;
    %put Directory &dir cannot be open or does not exist;
    %return;
  %end;

   data work.&ext._files;
   attrib folder  length=$128;
   attrib filename length=$64;

   %do i = 1 %to %sysfunc(dnum(&did));  

   %let name=%qsysfunc(dread(&did,&i));

      %if %qupcase(%qscan(&name,-1,.)) = %upcase(&ext) %then %do;
        %put &dir\&name;

           folder = "&dir";
           filename = "&name";
           output;


      %end;

      %else %if %qscan(&name,2,.) = %then %do;       

        %list_files(&dir\&name,&ext)

      %end;

   %end;

   run;

   %let rc=%sysfunc(dclose(&did));
   %let rc=%sysfunc(filename(filrf));    

%mend list_files;

%list_files(&RAWDATA_FOLDER, xlsx);
%list_files(&RAWDATA_FOLDER, txt);
%list_files(&RAWDATA_FOLDER, dat);


Friday, February 16, 2018

SAS: Directory separator character



SAS: Directory separator character


%* ------------------------------------ ;
%* Set Directory Separator Character    ;
%* ------------------------------------ ;
       
%if ( %upcase(&SYSSCP.) = WIN ) %then %do;
    %let WHICH_SLASH = \ ;
%end;

%else %do;
    %let WHICH_SLASH = / ;

%end;







Friday, February 9, 2018

SAS: Delete all work files without having to list them



SAS: Delete all work files without having to list them


proc datasets library=work kill nolist;
run;






Friday, January 19, 2018

d3.js: Removing unwanted lines on plots, including thru labels on y axis

d3.js: Removing unwanted lines on plots, including thru labels on y axis

BEFORE:




ADD THIS:




AFTER: