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

Hi everybody,

I got this code

 

filename fnames pipe "dir /ds/data star/* /b";

data fnames;
  infile fnames pad missover;
  input @1 filename $255.;
run;

 

It reads all the files in the directory and create a dataset with one record for each file in the directory.


The problem is the blank in the middle of the name of the directory, data star.
If I remove this blank (and put datastar instead of data star, for example) is OK.
With it, it reads a not correct path, /ds/data.
I can't remove the blank in the directory name so could I do to obtain the correct path?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Its a matter of quoting:

filename fnames pipe 'dir "/ds/data star" /b';

Put single quotes around the string, and use double quotes around the network path.

View solution in original post

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Its a matter of quoting:

filename fnames pipe 'dir "/ds/data star" /b';

Put single quotes around the string, and use double quotes around the network path.

Illodolaio
Calcite | Level 5

Thanks !

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!

Register now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 3484 views
  • 1 like
  • 2 in conversation