BookmarkSubscribeRSS Feed
Luisgm082001
Calcite | Level 5
I dont know much about programming I am just trying to open a big file which had instructions to be opened in SAS, SPSS or R, i couldnt open the file directly
I am using SAS University edition
This is the error i got when trying to open the file directly:
 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 /* Generated Code (IMPORT) */
74 /* Source File: MICRODADOS_ENEM_2018.csv */
75 /* Source Path: /folders/myfolders/MICROENEM 2018/DADOS */
76 /* Code generated on: 19/11/19 12:57 */
77
78 %web_drop_table(WORK.IMPORT);
79
80
81 FILENAME REFFILE '/folders/myfolders/MICROENEM 2018/DADOS/MICRODADOS_ENEM_2018.csv';
82
83 PROC IMPORT DATAFILE=REFFILE
84 DBMS=CSV
85 OUT=WORK.IMPORT;
86 GETNAMES=YES;
87 RUN;
 
NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to
WORK.PARMS.PARMS.SLIST.
 
ERROR: An exception has been encountered.
Please contact technical support and provide them with the following traceback information:
 
The SAS task name is [IMPORT (]
Segmentation Violation
 
Traceback of the Exception:
 
 
ERROR: An exception has been encountered.
Please contact technical support and provide them with the following traceback information:
 
The SAS task name is [IMPORT (]
Segmentation Violation
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 2.38 seconds
cpu time 0.34 seconds
 
88
 
 
89 PROC CONTENTS DATA=WORK.IMPORT; RUN;
ERROR: File WORK.IMPORT.DATA does not exist.
 
NOTE: Statements not processed because of errors noted above.
NOTE: PROCEDURE CONTENTS used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
 
NOTE: The SAS System stopped processing this step because of errors.
90
91
92 %web_open_table(WORK.IMPORT);
93
94 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
106
 
4 REPLIES 4
Tom
Super User Tom
Super User

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;
Luisgm082001
Calcite | Level 5

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

 

 

Kurt_Bremser
Super User

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.

Tom
Super User Tom
Super User

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.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 2582 views
  • 0 likes
  • 3 in conversation