DATA Step, Macro, Functions and more

filename

Reply
Contributor
Posts: 51

filename

Hi All

I am trying to read all log files in a directory but to avoid one log file (test.log)

How can I achive this?

I'm trying to do this by filename

filename filename ("c:\temp\*.log")

Super User
Super User
Posts: 8,111

Re: filename

Posted in reply to SASSLICK001

Here is the general form.  Fill in the rest of the data step for how you want and to actually read the log files.

data want ;

   length filename $200 ;

   infile 'c:\temp\*.log' filename=filename .... ;

   input @;

   if scan(filename,-1,'\')='temp.log' then delete ;

  ....

run;

Super User
Posts: 10,778

Re: filename

Posted in reply to SASSLICK001

infile dummy filevar=fname end=last;

do until(last);

input .;

output;

end;

Ask a Question
Discussion stats
  • 2 replies
  • 248 views
  • 0 likes
  • 3 in conversation