DATA Step, Macro, Functions and more

analysis of data in FRENCH

Reply
Occasional Contributor
Posts: 10

analysis of data in FRENCH

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

Super User
Posts: 7,866

Re: analysis of data in FRENCH

Posted in reply to thienvudl

"I cannot vew my file xlsx"

 

What do you mean by that?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 10

Re: analysis of data in FRENCH

Posted in reply to KurtBremser

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

Super User
Posts: 7,866

Re: analysis of data in FRENCH

Posted in reply to thienvudl

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 10

Re: analysis of data in FRENCH

Posted in reply to KurtBremser

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
 
 

 

Super User
Posts: 19,878

Re: analysis of data in FRENCH

Posted in reply to thienvudl

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

Occasional Contributor
Posts: 10

Re: analysis of data in FRENCH

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

Super User
Posts: 19,878

Re: analysis of data in FRENCH

Posted in reply to thienvudl

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?

Super User
Posts: 7,866

Re: analysis of data in FRENCH

Posted in reply to thienvudl

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 11,343

Re: analysis of data in FRENCH

Posted in reply to thienvudl

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.

Occasional Contributor
Posts: 10

Re: analysis of data in FRENCH

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 Smiley Wink will work well with SAS? Thank you

Super User
Posts: 11,343

Re: analysis of data in FRENCH

Posted in reply to thienvudl

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 Smiley Wink 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.

 

 

PROC Star
Posts: 1,760

Re: analysis of data in FRENCH

Posted in reply to thienvudl

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

Super User
Posts: 7,866

Re: analysis of data in FRENCH

Posted in reply to thienvudl

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 Smiley Wink 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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 13 replies
  • 127 views
  • 0 likes
  • 5 in conversation