Write and run SAS programs in your web browser

problem importing data into sas studio

Reply
New Contributor
Posts: 3

problem importing data into sas studio

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;

Super User
Posts: 11,101

Re: problem importing data into sas studio

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.

New Contributor
Posts: 3

Re: problem importing data into sas studio

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.  

Super User
Posts: 11,101

Re: problem importing data into sas studio

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)

New Contributor
Posts: 3

Re: problem importing data into sas studio

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!

Super User
Posts: 11,101

Re: problem importing data into sas studio

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.

Ask a Question
Discussion stats
  • 5 replies
  • 275 views
  • 0 likes
  • 2 in conversation