SAS Procedures

Help using Base SAS procedures
BookmarkSubscribeRSS Feed
shankar_kumar
Calcite | Level 5
Hi Everyone

I am working on SAS enterprise Guide in WINDOWS XP environment.

As part of my automation work, I need to convert some of the excel files (.xls, .xlsx) to .csv files due to some issues in handling .xls and .xlsx files directly.

Do you know any way in SAS using which I can convert file in one extension to another - of course as per the operating environment which in my case is XP?

Appreciate your co-operation.

Thanks
Shankar
3 REPLIES 3
Ksharp
Super User
That is easy.Assuming all your xls file in c:\temp
[pre]



filename csv pipe 'dir c:\temp\*.xls* /b';
data _null_;
file 'c:\rename.bat';
infile csv length=len;
input name $varying100. len;
str='rename '||strip(name)||' '||strip(scan(name,1,'.'))||'.csv';
put str;
run;
x 'c:\rename.bat';
x 'del c:\rename.bat';
run;
[/pre]

Ksharp
DouglasMartin
Calcite | Level 5
That is just going to rename them, not convert them.
Ksharp
Super User
Maybe you need to use Google to search some software which can convert xls into csv automatically.

Ksharp

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 3 replies
  • 2520 views
  • 0 likes
  • 3 in conversation