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.

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!
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-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 2214 views
  • 1 like
  • 3 in conversation