Does anyone know a workaround to make excel files work in SAS when their is a bit discrepancy? My Microsoft office applications are 32 bit, and I have a downloaded version of SAS that I got for free while in school. The problem is that the SAS is 64 bit, and doesn't work with excel files. Is there an easy way to get around this?
If you have SAS 9.4 then you can read and write XLS and XLSX file directly.
Use PROC IMPORT.
proc import datafile='myfile.xlsx' out=mydataset dbms=xlsx ....
Or even a libname.
libname mydata xlsx 'myfile.xlsx';
proc copy inlib=mydata outlib=work; run;
Depending on your version not all features of XLSX are supported. You can download PCFileServer to get around these and use DBMS=EXCELCS. You also have the option of using SAS University Edition for free. Both should be under similar licence, only valid for learning purposes.
Related
I wish to write to Excel on my PC a "big" matrix of p rows and c columns, e.g.
3,000 rows and 20 columns. But it's not easy, and I'm wondering if I can simplify it by using a fixed number for rows and columns instead of:
array mat {&periods,&columns};
Right now, I'm on the free version of SAS called "SAS University Edition", which has only community help.
I would like to output it to Excel, but using VMWARE on a PC to get SAS Studio to run, you can't write directly to disk (although there is a myfolder).
I tried this, but got this error log:
proc export data=WORK.CPAPMONTE1
file= "/folders/myfolders/outfile1.xlsx"
DBMS=xlsx
;
run;
ERROR: XLSX file can not be created -> /folders/myfolders//outfile1.xlsx. Make sure the path name is correct and that you have
write permission.
ERROR: Too many variables for the output file
I figure that the 2nd error is just due to the first error, which has a // instead of a /
I have defined a special folder for my data in SAS University Edition as:
/folders/myfolders/CPAP1
but I haven't figured out how to point to there
You can write directly to disk, you need to set up a shared folder similar to myfolders and then you reference its as
/folders/myshortcuts/myname
The folder and shortcut must be exactly correct, and all need to be lower case as it's case sensitive. If you have myfolders set up, all you need to do is right click on the folder>Properties and you'll get the path to the folder. Use that in your export. A similar process can be used for the custom shared folder you set up.
SAS University Edition Help Center/FAQ
https://support.sas.com/software/products/university-edition/faq/main.htm
Your specific question - How do I create a folder shortcut to my existing SAS files?
https://support.sas.com/software/products/university-edition/faq/shared_folder_access_existing.htm
I am using a well known piece of code to read an excel work book into SAS. The SAS code is called from Excel and then proceeds to open the required SAS work book and read the data into a SAS data set. The problem that I have is that while the code is being read in, we can see how SAS runs through the data set.
Is there a way to hide this? I realise the excel work book needs to be opened, but I would prefer it to stay minimised so that I don't see all the jumping around the work book. Furthermore, if you click anywhere during the read in process, the process fails. I am not sure if hiding the work book will also fix this issue?
Using SAS 9.3 and Excel 2010 this worked for me, it's app.minimize (not apps.minimize()).
However, you still cannot work with your computer.
options noxwait noxsync;
x '"C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE"';
data _null_;
z=sleep(1);
run;
filename cmds dde 'excel|system';
data _null_;
file cmds;
put '[open("C:\_LOCALdata\air.xlsx")]';
x=sleep(1);
run;
data _null_;
file cmds;
put "[app.minimize()]";
x=sleep(2);
run;
I try to export my Oracle view data to Excel sheet using Oracle Data Integrator.
English text is exported good, but russian (cyrillic) is wrong!
Help me please, how can I configure datasources and encoding.
After export to excel data has cp1252 encoding, but there is no place where such encoding is configured!
Information:
Oracle DS use jdbc:oracle:thin and
NLS_LANG=AMERICAN_AMERICA.CL8MSWIN1251
(in windows registry and environment variables(same to database).
ODI starting with product.conf:
AddVMOption -Dfile.encoding=Cp1251
AddVMOption -Dsun.jnu.encoding=Cp1251
AddVMOption -Duser.language=ru
AddVMOption -Duser.country=RU
(and I see such values in Help-About-Properties.
Excel DS use jdbc:odbc and
charSet=cp1251
property.
Oracle 12c, ODI 12c.
If I execute simple java code with
-Dfile.encoding=Cp1251
option - russian language displays correct, but not over ODI...
I would be glad any advice!
I want to answer my own question.
May be it is obviously for anyone, but I found solution not fast...
I need to change Windows property Current language for non-unicode programs. from English to Russian.
So I even not need "AddVMOption -Dfile.encoding=Cp1251" options in ODI - they are set correct after changing property.
Hope this information to be helpful for someone.
I need to parse data from xlsx file. Currently I'm using Jakarta-POI (v. 3.11) to do that. It handles fine some xlsx but not all. I noticed that the files that are not parsed properly are "strict xlsx" files saved with Office 2013. To be more exact this files are compliant with ISO29500 not ECMA-376 the difference is that in ISO29500 file there are relationships with type:
http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument
and Jakarta-POI is looking for:
String CORE_DOCUMENT =
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"
Is there a way to make Jakarta-POI read this files?
OOXML Strict Converter for Office 2010 may help if you need to resave the docs using an older format.
Some of the purl namespaces are listed on http://pyxb.sourceforge.net/PyXB-1.2.2/bundles.html (Jethro's link above appears to no longer work).
The up to date XML schema files can be found at:
http://www.ecma-international.org/publications/standards/Ecma-376.htm
My system uses Apache-POI to manage some xls files. Now I've got almost 300 xls files, but it appears that they are in an old format so i got this exception:
The supplied spreadsheet seems to be Excel 5.0/7.0 (BIFF5) format. POI only supports BIFF8 format (from Excel versions 97/2000/XP/2003)
Is there a way to handle that or to automatically convert all those files to a biff8 format?
Go with converting it to OOXLS format, POI supports both BIFF8 and newer OOXLS. Download official Microsoft converter pack:
http://www.microsoft.com/en-us/download/details.aspx?id=3
Convert files by running excelcnv.exe -oice <input file> <output file>. You can try run it directly from your code as external program, or create some batch file. There is a good explanation from mrdivo at social msdn here.
EDIT
The download mentioned above from microsoft.com is no longer available as of 6/21/2018. However, excelcnv.exe is a standard part of some Microsoft Office installations. It has been confirmed to be deployed with Office 2014 and Office 2016, and possibly other versions. It can be found at:
C:\Program Files (x86)\Microsoft Office\root\Office16` (or `Office14`).
It seems apache-POI can't handle BIFF5 format.
You should try to use Java Excel API instead : http://jexcelapi.sourceforge.net/