BookmarkSubscribeRSS Feed
ejbernklau
Fluorite | Level 6

I am simply trying to import a datafile into SAS.  Any file I previously used will load just fine.  However, when I try a recent file (saved as csv file in myfolders) I receive an error message.  Can anyone make a suggestion?  Following is the entire log:

 

OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

61        

62         /* Generated Code (IMPORT) */

63         /* Source File: sugglow.csv */

64         /* Source Path: /folders/myfolders */

65         /* Code generated on: 4/4/17, 1:01 PM */

66        

67         %web_drop_table(WORK.IMPORT);

68        

69        

70         FILENAME REFFILE '/folders/myfolders/sugglow.csv';

71        

72         PROC IMPORT DATAFILE=REFFILE

73         DBMS=CSV

74         OUT=WORK.IMPORT;

75         GETNAMES=YES;

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

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.05 seconds

       cpu time           0.04 seconds

      

77        

78         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.00 seconds

      

NOTE: The SAS System stopped processing this step because of errors.

79        

80        

81         %web_open_table(WORK.IMPORT);

82        

83         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

7 REPLIES 7
ballardw
Super User

Sometimes this message:

NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST i

 

indicates that possibly there is another SAS session running and using the default SASUSER library and locking it

If so make sure there is only one session active. You likely have to close down and restart.

 

This

Unable to sample external file, no data in first 5 records.

says that you should look at the data file, possily in something other than Excell and see if you have 5 or more blank rows at the top of the file.

If so delete the blanks down to the actual data or use the DATAROW option to indicate the first row with actual data.

ejbernklau
Fluorite | Level 6

Thank you for the tips.

 

Closed down everything and restarted.  The problem still occurred.

 

Checked data file and found no blank rows.  

I can use the same script with a file that I uploaded a couple months ago and it runs just fine.  Only the new files give this error.

 I uninstalled the virtualbox and the sas studio, re-installed and started from scratch.  No changes.  Only the older files work.  The only difference in the script is the file name.  

ballardw
Super User

If you can run the program on other files then the culprit is likely in the file itself. File encoding would be the first thing to check. If the file contains double-byte characters and you system isn't set up for them many odd things happen.

 

What did you do to check if the file contained blanks?

Or can you copy a few rows of data and attach it as a text file (txt extension not CSV, the forum may be doing things to csv files)

ejbernklau
Fluorite | Level 6

Your comments led me to try some different file types and that procedure revealed the problem (and fix):

 

 The file MUST be saved (converted) from Excel as WINDOWS COMMA SEPARATED (.csv).  If it is saved as the general format of COMMA SEPARATED VALUES (.csv) or MS-DOS COMMA SEPARATED (.csv) it will NOT load the data into SAS Studio.

 

Many thanks for your tips and I hope others can learn from this post and not suffer the same frustration!

ballardw
Super User

Isn't it wonderful that Microsoft, who wrote DOS and created MS-DOS csv file format felt it necessary to create a different and occasionally incompatible WINDOWS csv format?

 

You could mark your conversion note as the "accepted solution" so that someone encountering a similar problem may find that as a possible solution when searching the forum.

kwani27
Calcite | Level 5
thanks. I encountered similar issue and your post has helped in fixing it
Tom
Super User Tom
Super User

You must be using a Mac.  Excel hasn't figured out that Mac OS is now based on Unix and that text files should use LineFeed as the end of line character instead of the CarriageReturn character that the original mac operating system used.

 

You can fix this on the SAS side by adding TERMSTR=CR to the INFILE or FILENAME statement so that SAS knows to treat bare CarriageReturn as a the end of line.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 7 replies
  • 2736 views
  • 1 like
  • 4 in conversation