There is a comment in the code saying it is "generated" code. Do you know who/what generated the code? Are you using some point and click interface to import the CSV file? Perhaps via SAS/Studio interface?
Not sure what is causing the error, but there it no need to use IMPORT to read a CSV file. They are just text files and it is trivial to write your own data step to read a CSV file. Do you know what is in the file? If not then run a little step to look at the first few lines and check.
FILENAME REFFILE '/folders/myfolders/MICROENEM2018/DADOS/MICRODADOS_ENEM_2018.csv';
data _null_;
infile reffile obs=10;
input;
list;
run;
The file is 3gb of data about a test. I have already opened it but its too hard to search for the information I want as there are too many columns, separated only by ";". There are some input files that were with this big file that would load some labeling but they didn't work, probably because I placed the files in the wrong location. So, I tried to open the file directly, as it was stated in some instructions on how to see the data, in the hope that it would be more organized, but I got that error.
The code was probably generated by the institution that provided the data.
I am using SAS University Edition and Oracle Virtual Box to open SAS Studio in the chrome browser.
I don't know if I could properly answer your questions as I don't understand much about SAS but I hope you can help me.
Thanks
Write a data step, according to the column description you got with the file. If you did not get one, return to sender with request for such.
A data step to read a csv file is very basic SAS technique; writing one and getting it to work is a perfect learning experience, exactly what University Edition is meant for.
You will not have room to write anywhere new 3 gigabytes of data into a WORK dataset with SAS UE. The virtual machine does not have that much memory.
You could try writing the file to a folder on your real machine by using a permanent dataset instead of work dataset.
Something like this:
FILENAME REFFILE '/folders/myfolders/MICROENEM2018/DADOS/MICRODADOS_ENEM_2018.csv';
LIBNAME OUT '/folders/myfolders/';
PROC IMPORT DATAFILE=REFFILE DBMS=CSV
out=OUT.MICRODADOS_ENEM_2018 replace
;
GETNAMES=YES;
DELIMITER=';';
RUN;
Note that using PROC IMPORT will force SAS to guess what type of data is in each column and for character strings how long to make the variable. If you really have documentation about what variables are in the data then it would be much better to use that to write your own data step to read the data. Then you can control what the variables are named, whether they are numeric or character, the length of the character variables and whether any specidal informats are needed to read the data or special formats are desired for printing the data.
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!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.