BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
hellohere
Pyrite | Level 9
	PROC IMPORT OUT=&outdata.
	     DATAFILE="C:\Users\Administrator\Desktop\&fn..log"
	   DBMS=CSV REPLACE;
	   GETNAMES=NO;
	   DATAROW=20;
	RUN;

I try to readin a text file, and success with datarow=20. But fail with datarow=30.

SAS does not give out details.

ERROR: Import unsuccessful.  See SAS Log for details.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds

Any limit on DATAROW?!

 

 

1 ACCEPTED SOLUTION
3 REPLIES 3
Tom
Super User Tom
Super User

Why are you using the DATAROW option?  That is saying you want to skip the first 19 (or 29) lines of the file instead of just the header line.  Are you sure the file had more than 29 lines?

 

Here is code to recreate your problem.  There are only 19 observations in SASHELP.CLASS so the CSV file will only have 20 lines in it.  So asking PROC IMPORT to start reading from line 30 will cause an error because there is no line 30.

filename csv temp;
proc export data=sashelp.class file=csv replace dbms=csv;
run;
proc import file=csv out=want replace dbms=csv;
  datarow=30;
run;
3124  proc import file=csv out=want replace dbms=csv;
3125    datarow=30;
3126  run;

Unable to sample external file, no data in first 5 records.
ERROR: Import unsuccessful.  See SAS Log for details.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds

 

hellohere
Pyrite | Level 9

The file has thousands of lines. It is created at real time, all columns are numbers with first 20s(not stable) lines with -nan(ind).

 

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!

How to Concatenate Values

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.

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
  • 3 replies
  • 670 views
  • 0 likes
  • 3 in conversation