BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
malena
Calcite | Level 5

I am trying to get a list of all SAS files (with path names) on a drive and I am using the code that was I found on here of someone trying to do what I need to do- but I it is not working- 

 

filename search pipe 'for /r U:\REPI\population\saspop %i in (*.sas7bdat) do @findstr /i /m "obs=max" "%i"';

 data search_results;
    infile search length=_len;
    input @1 filepath $varying512. _len;
run;

 

NOTE: The infile SEARCH is:
Unnamed Pipe Access Device,
PROCESS=for /r U:\REPI\population\saspop %i in (*.sas7bdat) do @findstr /i /m "obs=max" "%i",
RECFM=V,LRECL=256

NOTE: 0 records were read from the infile SEARCH.
NOTE: The data set WORK.SEARCH_RESULTS has 0 observations and 1 variables.
NOTE: DATA statement used (Total process time):
real time 9:31.21
cpu time 0.06 seconds

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
What is your OS? Did you try the PIPE command on it's own to ensure it runs? Otherwise, try the simpler approach here: https://support.sas.com/kb/45/805.html

View solution in original post

2 REPLIES 2
Reeza
Super User
What is your OS? Did you try the PIPE command on it's own to ensure it runs? Otherwise, try the simpler approach here: https://support.sas.com/kb/45/805.html
malena
Calcite | Level 5

thank you! that worked!!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1271 views
  • 0 likes
  • 2 in conversation