libname pre "C:folder name";
%let ds1="File Name Has Space(s)";
/*File is .xlsx */
data old;
set pre.&ds1.;
/*Error here with the file name */
run;
I did a quick google search, I saw several that mentions Pipe, which I assume it doesn't really apply to me.
Thanks
EDIT: turns out its a .CSV file.
this helped.
If your file is .xlsx then the data step is not the way to go. Use PROC IMPORT instead. Do a Google search, thousands of examples out there 🙂
If your file is .xlsx then the data step is not the way to go. Use PROC IMPORT instead. Do a Google search, thousands of examples out there 🙂
@jerrylshen wrote:
libname pre "C:folder name"; %let ds1="File Name Has Space(s)"; /*File is .xlsx */ data old; set pre.&ds1.; /*Error here with the file name */ run;
I did a quick google search, I saw several that mentions Pipe, which I assume it doesn't really apply to me.
Thanks
Is the file a SAS dataset, like your last step is assuming. Or is it an XLSX file, like your comment says?
To use a dataset name that includes a space (why would you want to?) you need to set the VALIDMEMNAME option to extend and use a name literal.
options validmemname=extend ;
proc print data=pre."name with space"n ;
run;
To read from an XLSX file you can use PROC IMPORT or the XLSX libname engine.
libname pre xlsx 'name of the xlsx file';
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.