hello everyone,
I am using mac and have stored my file on desktop under folder sasuniversityedition/myfolders and the myfolders is shared with my vmware.I wrote this code but still i am not able to run it correctly.I am getting 66 lines of error for this short code and the log windows is showing �g��M 1338 these things.
data demo;
infile "/folders/myfolders/mydata.docx";
input gender $ age height weight;
run;
title 'check infile on mac';
proc print data=demo;
run;
Any help will be appreciated.
You cannot read a docx file, it's not a text file. If the data is text, save it as a txt file and then work with that file.
DOCX is actually a zipped XML file that has a lot of components in it. Your path is specified correctly and if you're getting errors that don't say file not found it's finding the file. It's just not a file that can be worked with easily. I wouldn't recommend starting to learn SAS by doing this type of exercise (figuring out how to read a docx file).
@asuman wrote:
hello everyone,
I am using mac and have stored my file on desktop under folder sasuniversityedition/myfolders and the myfolders is shared with my vmware.I wrote this code but still i am not able to run it correctly.I am getting 66 lines of error for this short code and the log windows is showing �g��M 1338 these things.
data demo;
infile "/folders/myfolders/mydata.docx";
input gender $ age height weight;
run;
title 'check infile on mac';
proc print data=demo;
run;Any help will be appreciated.
You cannot read a docx file, it's not a text file. If the data is text, save it as a txt file and then work with that file.
DOCX is actually a zipped XML file that has a lot of components in it. Your path is specified correctly and if you're getting errors that don't say file not found it's finding the file. It's just not a file that can be worked with easily. I wouldn't recommend starting to learn SAS by doing this type of exercise (figuring out how to read a docx file).
@asuman wrote:
hello everyone,
I am using mac and have stored my file on desktop under folder sasuniversityedition/myfolders and the myfolders is shared with my vmware.I wrote this code but still i am not able to run it correctly.I am getting 66 lines of error for this short code and the log windows is showing �g��M 1338 these things.
data demo;
infile "/folders/myfolders/mydata.docx";
input gender $ age height weight;
run;
title 'check infile on mac';
proc print data=demo;
run;Any help will be appreciated.
Thanks its working.Is there any other file extension which i should know that is not working with sas.
That's a long list and it depends on what you're trying to do. It's not a matter of extension it's a matter of right tool and process.
For example, SAS TextMiner can read and process Word and PDF files, but they're unstructured data and you can't read those in a data step. They're proprietary formats that are locked down. Most of the common data sources will work, ie text files, database connections, XLSX files.
@asuman wrote:
Thanks its working.Is there any other file extension which i should know that is not working with sas.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.