BookmarkSubscribeRSS Feed
Xaizz
Calcite | Level 5

Thanks for wasting everyone who wasted their precious time looking at this post.
I am a starter of SAS Studio user.
I have faced the issue that the below picture had shown. error.PNG

 

At first, I have thought it might be my dataset in CSV problems, then I go try it with other CSV files that it can work in earlier time, and it still shows this error... Please tell me what should I do to solve this...


Once again, highly appreciated all the help given.

7 REPLIES 7
andreas_lds
Jade | Level 19

Reading the log may enlighten you.

Have you read the csv-file by using a data step or by proc import? Was the step successful?

Xaizz
Calcite | Level 5
Yeah, i tried both, the step is successful, but then when i try to edit the data, it comes out with this error... I tried with other files such xlsx as well, it also show this error... It this a bug that i should contact SAS for help?
andreas_lds
Jade | Level 19

Please post the log using the "insert code" button ... you can't read an excel-file using a data step, please note that there is a huge difference between xlsx and csv, the later is a proper file-format to store data, the other is, well, crap.

 

 

Kurt_Bremser
Super User

Please post the log of the step that reads the csv file. Post the complete log (code and messages). If lots of "Invalid data" messages appear, a few are sufficient so as to not clog up your post.

Use this button to paste the log contents into your post:

Bildschirmfoto 2020-04-07 um 08.32.59.jpg

Xaizz
Calcite | Level 5
PROC IMPORT FILE="/home/u58811045/Assignment.csv"
	OUT=WORK.ASSIGNMENT2
	DBMS=CSV
	replace;
	
RUN;

Capture1.PNG

 data work.assignment;
    infile "/home/u58811045/Assignment.csv"
	delimiter = ","
	missover 
	dsd
	firstobs=2;
 
	informat id best32. ;
	informat name $37. ;
	informat host_id best32. ;
	informat host_name $9. ;
	informat neighbourhood_group $14. ;
	informat neighbourhood $12. ;
	informat latitude best32. ;
	informat longitude best32. ;
	informat room_type $15. ;
	informat price best32. ;
	informat minimum_nights best32. ;
	informat number_of_reviews best32. ;
	informat last_review mmddyy10. ;
	informat reviews_per_month best32. ;
	informat calculated_host_listings_count best32. ;
	informat availability_365 best32. ;

	format id best12. ;
	format name $37. ;
	format host_id best12. ;
	format host_name $9. ;
	format neighbourhood_group $14. ;
	format neighbourhood $12. ;
	format latitude best12. ;
	format longitude best12. ;
	format room_type $15. ;
	format price best12. ;
	format minimum_nights best12. ;
	format number_of_reviews best12. ;
	format last_review mmddyy10. ;	
	format reviews_per_month best12. ;
	format calculated_host_listings_count best12. ;
	format availability_365 best12. ;
 
	input
	id
	name  $
	host_id
	host_name  $
	neighbourhood_group  $
	neighbourhood  $
	latitude
	longitude
	room_type  $
	price
	minimum_nights
	number_of_reviews
	last_review
	reviews_per_month
	calculated_host_listings_count
	availability_365;
	
run;

Capture2.PNG

But when i do this:

DATA work.assignment;
RUN;

It shows the same error again.

Kurt_Bremser
Super User

This

DATA work.assignment;
RUN;

will always create a totally void dataset; no variables, no observations.

Why? Because you did not tell the data step to read anything (via INFILE/INPUT or a SET, MERGE or UPDATE statement), or to create anything from scratch (by setting variable(s) to value(s), and using OUTPUT).

If a dataset WORK.ASSIGNMENT existed, with data in it, this step will overwrite it with no data.

 

PS Look at the log of just this step, and you will see it yourself. That's why there is a Maxim 2.

 

PPS and this also illustrates why it is so important to post code and log. Had you included this snippet in your initial post, the solution would have been obvious right there.

Xaizz
Calcite | Level 5
Ahhh... it works now!!!! Thank You Very Much!!!!

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 7 replies
  • 2053 views
  • 2 likes
  • 3 in conversation