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).

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1113 views
  • 0 likes
  • 3 in conversation