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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.