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!!

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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