BookmarkSubscribeRSS Feed
pp2014
Fluorite | Level 6

I am trying to save the .csv file  with the same name using following data _NULL_.  But my system hangs up when I use the following statements.  I am using SAS 9.2    Can anybody help me in finding a solution?

 

 


filename exl dde 'excel|system';
options noxwait noxsync;
x "'C:\Program Files\Microsoft Office\Office15\EXCEL.EXE' C:\Temp\test.csv";
data _NULL_;
x=sleep(5);
run;
data _null_;
file exl;
put '[SAVE()]';
put '[CLOSE()]';
run;
data _null_;
file exl;
put '[QUIT()]';
run;

6 REPLIES 6
Tom
Super User Tom
Super User

What are you actually trying to do?

And why are you trying to use DDE?  DDE is not really supported and there are lots of known issues with it.

pp2014
Fluorite | Level 6

I am trying to save .csv file to read it back into SAS using PROC IMPORT.  The reason I am doing this is that it gives me INVALID string error if I try to read the file directly using PROC IMPORT.  If I save the file and then use PROC IMPORT, I don't get that error.

 

Is there any other way I can save the file.  Please let me know.

 

Thanks

Kurt_Bremser
Super User

Post the log from the failed import step.

Also post the test.csv, so we can play around with it to see what causes the invalid string error.

Most probably you have an encoding difference between the file and SAS; if you have SAS DBCS installed, you can use the encoding= option for the infile.

Tom
Super User Tom
Super User

What ENCODING is your SAS session using?  What ENCODING is the CSV file using?

If the CSV file does not include encoding information in it then you can tell SAS what encoding to use.

filename myfile 'myfile.csv' encoding=utf8 ;
proc import datafile=myfile ....

 

Reeza
Super User

This code won't do anything. It should open the csv file, then close and quit but there's nothing actually done in the code. 

 

What is your definition of 'hanging'? Most likely it's waiting for instructions once you hit Save. Click over to Excel and see what's happening.

ballardw
Super User

There are several programs out there that if they are running they interfere with DDE. My person experience is with Cisco Jabber. If the SERVICE (not the program but the Service reported by Task Manger) is running then whatever it does to interfere with DDE means that none of the DDE statements are able to execute.

 

 

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!

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