BookmarkSubscribeRSS Feed
lgq6
Calcite | Level 5

SAS (9.4) crashes every time I try to import a csv file using routine code that works fine for other files. I receive a 'sas.exe has stopped working' (A problem caused the program to stop working correctly. Please close the program.).

 

I'm using:

 

PROC IMPORT

DATAFILE="filepath.csv"

out=main

dbms=csv

 replace;

GUESSINGROWS=30;

run;

 

Any suggestions are greatly appreciated!

 

 

 

2 REPLIES 2
ChrisHemedinger
Community Manager

Obviously, a crash should not happen so this is a defect...somewhere.  But to try and diagnose, check the Windows event log.  (Type "eventvwr" in your Windows command bar)

 

Navigate to Windows Logs->Application, and filter on Error.  Find the SAS.EXE entry that corresponds with your crash, and you might get some more details that can help with a SAS Tech Support ticket.

 

eventvwr.png

 

It might be worth opening your CSV file in an editor like Notepad++ to see if there are special characters that SAS is balking at.  Again, should not cause a crash...but if it's happening, I'm sure that you just want to get to the bottom of it.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
ballardw
Super User

@lgq6 wrote:

SAS (9.4) crashes every time I try to import a csv file using routine code that works fine for other files. I receive a 'sas.exe has stopped working' (A problem caused the program to stop working correctly. Please close the program.).

 

I'm using:

 

PROC IMPORT

DATAFILE="filepath.csv"

out=main

dbms=csv

 replace;

GUESSINGROWS=30;

run;

 

Any suggestions are greatly appreciated!

 

 

 


1) Run that import for one of the files that it works for.

2) copy the generated data step code from the log and paste into the editor (or use the F4 to recall last submitted code)

3) edit the data step INFILE statement to point to the problem file. If you copied from the log you may also have to remove line numbers at the start of each code line.

4) Save the program code

5) run the modified program

 

You may get some interesting errors.

 

In the future you may find that using an existing program to read a CSV file results in more consistent data, especially if compare the generated code against expected or defined variable behavior for the data interchange or source file descriptions.

 

My guess is the file is not actually CSV, possibly violating one or more conventions such as quotes around text with commas as part of the value.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 1897 views
  • 1 like
  • 3 in conversation