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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 5834 views
  • 2 likes
  • 2 in conversation