DATA Step, Macro, Functions and more

filename

Reply
Contributor
Posts: 50

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: 6,502

Re: filename

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: 9,682

Re: filename

infile dummy filevar=fname end=last;

do until(last);

input .;

output;

end;

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