BookmarkSubscribeRSS Feed
thienvudl
Calcite | Level 5

Hello, can I use this SAS studio to analyze the data in French? I cannot vew my file xlsx. Thank you

13 REPLIES 13
thienvudl
Calcite | Level 5

When I choose 'View file as text' by clicking right onto the file xlsx 

Kurt_Bremser
Super User

@thienvudl wrote:

When I choose 'View file as text' by clicking right onto the file xlsx 


That's because a .xlsx file is a binary (zip algorithm) compressed archive of XML files. You can only view it with a spreadsheet program or import it into SAS to a dataset.

thienvudl
Calcite | Level 5

Could you please help me to fix these syntax errors: ERROR 22-322 + ERROR 76-322

 when executing

PROC CORRESP DATA=AFCM_liens 1+2.xlsx DIMENS=3 OUT=ACMburt MCA;

Tables R16__Genre R18_Niveau_de_formation R19_Formation_professionnelle___R22_R__gions; RUN;
 
Thank you very much
 
 

 

Reeza
Super User

1. First you need to import your data into SAS. You cannot work with an Excel file directly as you're trying to do (there are some ways, but in my experience they're not good in the long term). 

2. Then you reference your imported data set and use PROC CORR on that. 

 

Here are some video tutorials that may be helpful:

 

http://video.sas.com/#category/videos/sas-analytics-u/0

thienvudl
Calcite | Level 5

Hi Rezza, thank you for your reply. I've watched the tutorial video but it's about working with variables. In fact, I've already imported my xlsx file into SAS and execute some codes as shown in the previous question, but it did not work. ;( What should I do? Many sincere thanks

Reeza
Super User

Then post your exact code and log. 

Your code as posted seems to reference an XLSX file, if you have imported your data why aren't you referencing that data?

Kurt_Bremser
Super User

Always post the complete code of a failing step. Follow the instructions in https://communities.sas.com/t5/help/faqpage/faq-category-id/posting?nobounce for posting code; similarly, use the {i} button for logs. This is especially important, as the horizontal position of the error message helps in determining the offending piece of code.

ballardw
Super User

@thienvudl wrote:

Could you please help me to fix these syntax errors: ERROR 22-322 + ERROR 76-322

 when executing

PROC CORRESP DATA=AFCM_liens 1+2.xlsx DIMENS=3 OUT=ACMburt MCA;

Tables R16__Genre R18_Niveau_de_formation R19_Formation_professionnelle___R22_R__gions; RUN;
 
Thank you very much
 

 


PROC CORRESP DATA=AFCM_liens 1+2.xlsx DIMENS=3 OUT=ACMburt MCA;
                            ^
                            SPACE not allowed in SAS dataset name generally

 

My guess for the proximate cause of the error message. SAS dataset names are limited to letters, digits and the underscore character and must start with _ or letter. The period is used to separate a library name from the dataset that resides in the library.

 

xlsx files are right out.

thienvudl
Calcite | Level 5

Hello, thanks for your reply. But it is the name of my file (containing SPACE). Can I ask if the data of the excel file written in French with marks/accents/special letters 😉 will work well with SAS? Thank you

ballardw
Super User

@thienvudl wrote:

Hello, thanks for your reply. But it is the name of my file (containing SPACE). Can I ask if the data of the excel file written in French with marks/accents/special letters 😉 will work well with SAS? Thank you


Let us step back a moment.

Previously you said "In fact, I've already imported my xlsx file into SAS and execute some codes as shown in the previous question".

 

Please show the code you used to import the data into SAS. Several of the most common methods will not allow any character in the dataset name. None of them that I have used will generate an XLSX extension appearing name.

It is possible to create names with poor names using some options but then the data set name has to be referenced within quotes and followed by n: perhaps 'AFCM_liens 1+2'n.

 

Also, when posting code that generates errors copy the Code and the log errors and then paste into a code box opened using the forum {I} icon to preserve the format of the result. An ERROR 22-322 will have an accompanying _ under the offending text.

 

 

ChrisNZ
Tourmaline | Level 20

1- Import the excel file to create a SAS data set using proc import

2- Now you no longer need to use the excel file

3- Run proc corr on the SAS data set

Kurt_Bremser
Super User

@thienvudl wrote:

Hello, thanks for your reply. But it is the name of my file (containing SPACE). Can I ask if the data of the excel file written in French with marks/accents/special letters 😉 will work well with SAS? Thank you


The only time you have to deal with a stupid filename that contains funny characters is when yopu import the external file. In that step, you assign a valid SAS name (see https://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000998953.htm) to the resulting SAS dataset, so you will not have to do some complicated typing all the time when you refer to that dataset. From then on, you only work with the SAS dataset, and the original file is no longer needed.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 13 replies
  • 1327 views
  • 0 likes
  • 5 in conversation