BookmarkSubscribeRSS Feed
KubiK888
Calcite | Level 5

I am relabeling the specific values of two variables, when I general analytic outputs it's still showing the original numeric values rather than the relabeled string values. How can I show the value labels in output?

 

data WORK.JOINED6;

     set WORK.JOINED5;

     PROC FORMAT;

           VALUE arrival_fulln 1='EMS'

                                     2='PV'

                                     3='Other'

                                     -99='Missing';

 

           VALUE work_status_fulln 1='Canadian citizen'

                                           2='Permanent resident'

                                           3='Refugee'

                                           4='Temporary foreign worker'

                                           5='Worker permit holder'

                                           6='Student visa/study permit holder'

                                           7='Other'

                                           88='Prefer not to answer';

 

     PROC FREQ data= WORK.JOINED6;

           tables arrival_fulln*work_status_fulln / chisq;

 

     run;

1 REPLY 1
BrunoMueller
SAS Super FREQ

Hi

 

You have to tell Proc FREQ to actually use the formats you have just created.

 

A format definition is an indepent element and can be used with many different tables. The format name does not have to be the same as the column name. The FORMAT statement makes the association between a variable and the format to use.

 

Example:

 PROC FREQ data= WORK.JOINED6;
  tables arrival_fulln*work_status_fulln / chisq;
  FORMAT
    arrival_fulln arrival_fulln.
   work_status_fulln work_status_fulln.
  ;
run;

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 6038 views
  • 2 likes
  • 2 in conversation