BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Annie_Fréchette
Obsidian | Level 7

Hi! I'm a beginner with SAS. I'm tryin to import some files. Last friday when  I finished my workday everything was fine. But today, I can't run my code! Worse, SAS keeps closing when I submit this few lines... (in blue, see the printscreen). Anyone can help me?  (I have SAS 9.4) Thank you very much!

Annie_Fréchette_0-1594039264380.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

Is this your private laptop or is it maintained by an IT department? If it's the latter then I'd probably contact the help desk of this IT department and have a chat with them first. May be there has been something deployed that doesn't only cause issues for you - or they could at least look if there are some log/dump files after the crash which they could investigate to get further information - like looking into a Windows Event log.

I'd still wait with re-installing SAS until you've got a bit a better understanding why is happening what's happening. You could also try an run some of the code that crashes in batch mode and see if this works.

 

View solution in original post

19 REPLIES 19
Lacona
Quartz | Level 8

I am no SAS specialist, but I can see, that you try to import a .his file and dbms=csv. 
Try to convert your .his in .csv or .xlsx and set dbms=accordingly.

And after checking your code again:
your import file is not starting with /folders/myfolders. Did you install SAS correctly with the connection to the folders/myfolders folder on your computer?

 

Annie_Fréchette
Obsidian | Level 7

Hi!

Could you explain how can I convert my .his? I'm not familiar with this format....

 

Not sure how SAS was install on my laptop, but again, everything was working two days ago, so can't figure why this isn't working anymore....

 

Thanks!:)

Oligolas
Barite | Level 11

Hi,

 

the code looks correct to me. I suspect some Errors in your csv data or either in the previous Statements ran by SAS.

I noticed that in the screenshot you post your SAS is not finished with running a step.

 

 

________________________

- Cheers -

Annie_Fréchette
Obsidian | Level 7

Hi!

I have not touched my data since last friday, so I struggle to understand what is happening and how could it suddenly be some errors in my data...

I open my program than  I run what I've outlined and then SAS crash.... I'm not sure what you mean by "your SAS is not finished with running a step." Sorry if it's evident, I'm really a beginner.

 

Thanks a lot!

 

 

Tom
Super User Tom
Super User

Please post the CODE you are running, not a photograph of your screen.  Use the Insert SAS Code button on the forum editor menu to get a pop-up window where you can post the code.

 

If SAS is closing try first making sure you do NOT have the ERRORABEND option turned on.  You might also just be having an issue with find format definitions, so make sure you don't have the FMTERR turned on.

option NOFMTERR NOERRORABEND ;
Annie_Fréchette
Obsidian | Level 7

Hi! I'm sorry I don't  don't see the SAS code button... but here is the code:

 

proc import datafile="C:\doctorat\Projet1-LFR\Données\lactanet\tip files\tipfilesoriginal\18580044.his"
out=f2
dbms=csv replace; getnames=no;
run;

 

 

Thanks,

Annie

 

Tom
Super User Tom
Super User

That code should not cause SAS to stop working.  But it might generate an error if the file is not found.  Make sure ERRORABEND option is turned off.

options noerrorabend ;
proc import
  datafile="C:\doctorat\Projet1-LFR\Données\lactanet\tip files\tipfilesoriginal\18580044.his"
  out=f2 dbms=csv replace
; 
  getnames=no;
run;
Annie_Fréchette
Obsidian | Level 7

hi Tom! I have just tried with your suggestion and it's still not working....

 

Annie

Tom
Super User Tom
Super User

"Not working" is not enough information to debug with.

Start a new SAS session and try it again.

Start a new SAS session and try to run anything. For example run this:

proc print data=sashelp.class;
run;
Annie_Fréchette
Obsidian | Level 7

Hi!

What I meant is that it is still doing the same thing as  my print screen. I have tried to start a new session and it gaves me the same bug. I've double checked the file location too.

I 've just run the sashelp.class and it went well (no error).

Tom
Super User Tom
Super User

But your original posting did not include any error message.

How large is the file you are trying to import?  Perhaps it is still trying to run?

Did you turn of the NOTES option?  Perhaps the step finished but did not print anything to the log to indicate that.  Can you run the proc print of SASHELP.CLASS after submitting the IMPORT step?

Also are you running on a PC? (I would assume so from the source filename). Perhaps your PC has run out of memory, or really disk space to support virtual memory, and it is just thrashing and taking a long time.

Annie_Fréchette
Obsidian | Level 7

Hi again,

What is in my original post is just a print screen of the log... I can't click on it and copy it, I can't do nothing and a few seconds later SAS shut down.

The file is 266 ko.

I'm workin on a laptop and 142 Go are available.  Here is an overview of what my data looks like.

 

Thanks again for you help.

 

 

Tom
Super User Tom
Super User

That is NOT a CSV file.  Looks like it might be a delimited file with TAB as the delimiter.

Try just reading the file instead of using PROC IMPORT.

For example this code will read the first 10 columns from each line into character variables with a maximum length of 50 bytes.

data test;
  infile "c:\......" dsd dlm='09'x truncover ;
  input (col1-col10) (:$50.);
run;
Annie_Fréchette
Obsidian | Level 7

I have tried your code and again after I click run, few seconds later, SAS is shutting down... If I check my performance disk in the meantime, it goes to 100%... Need to check that.... :S

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 19 replies
  • 3976 views
  • 1 like
  • 6 in conversation