- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Can i know how to convert excel files to xpt files. We have got some internal requirement. Thank you. There are few excel files with multiple tabs, and there is a limitation of SAS in our organisation that we will not be able to import excel files, we have only privilege to import csv files. can i know a best solution for this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello
You have few excel files and you cannot import them using SAS.
Then one approach would be save the excel sheets individually as csv and follow your solution.
You have other option of using tools like python or R and convert your files to csv and then follow your solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
That's probably a licensing issue but I thought XLSX libname support had moved to Base...you can get VBS scripts to convert workbooks and all sheets to CSV assuming they're well formed. If they're not, you may need Excel macros or some other method to convert those to CSV. Lots of solutions online for this approach..assuming you're on Windows and can run VBS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
As the final xpt files need to be sent to client and they are requesting us to use only SAS for this, is there any solution for this apart from vba script or groupdocs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello @Ravindra_
You have put forth the following two constraints in your posts
(1)There is a limitation of SAS in our organisation that we will not be able to import excel files
(2)As the final xpt files need to be sent to client and they are requesting us to use only SAS for this.
The plausible approach would be to export the excel to csv (preferably from excel itself) and then use SAS to import the data (csv file) and then create a transport file(xpt). This approach will satisfy both of your constraints.
In my view the suggestion by @Reeza needs to be considered. That simplifies the entire process. You may need to convince the decision makers in your company to implement this suggestion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
After that import these csv file via PROC IMPORT or Data Step, and you can change sas dataset into XPT fille by
xport engine of libname .
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Oh. you could issue OS command to execute Reeza's VBA in SAS .
Like:
x 'your os command here to execute vba' ;
filename x pipe 'your os command here to execute vba';
data _null_;
call system('your os command here to execute vba');
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content