Hi,
I'm trying to import a csv file and then export a sas dataset as on output but I'm running into issues. Can anyone let me know where I'm going wrong? My code logic is as follows:
Import:
Proc Import out=xyz
datafile='c:\User\Folder\File_Abc.csv'
DBMS =csv replace;
run;
SAS Dataset export
Libname out 'c:\user\Desktop';
data out.test;
set xyz;
run;
I'm receiving an error saying "set is not allowed in the data statement".
Can anyone let me know how I export the sas dataset here? Thank you.
You need to close your quotation marks for both times you use it. Also, you had an extra semicolon in the proc import statement.
Proc Import out=xyz
datafile='c:\User\Folder\File_Abc.csv'
DBMS =csv replace;
run;
Libname out 'c:\user\Desktop';
data out.test;
set xyz;
run;
I apologize for the missing quotes and extra semi-colon in the post. However, the code has proper quotes and semi-colon but it still does throw up errors.
Post the full log from the code you're running.
@SteelersPitts wrote:
Hi,
I'm trying to import a csv file and then export a sas dataset as on output but I'm running into issues. Can anyone let me know where I'm going wrong? My code logic is as follows:
Import:
Proc Import out=xyz
datafile='c:\User\Folder\File_Abc.csv'
DBMS =csv replace;
run;
SAS Dataset export
Libname out 'c:\user\Desktop';
data out.test;
set xyz;
run;
I'm receiving an error saying "set is not allowed in the data statement".
Can anyone let me know how I export the sas dataset here? Thank you.
My bad! Code is working fine now. There was a missing semi-colon. Thanks everyone.
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 25. Read more here about why you should contribute and what is in it for you!
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.