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: Call for Content

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!

Submit your idea!

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.

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
  • 1 reply
  • 5980 views
  • 2 likes
  • 2 in conversation