Desktop productivity for business analysts and programmers

How to display value label instead of actual value in output?

Reply
Contributor
Posts: 23

How to display value label instead of actual value in output?

[ Edited ]

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;

SAS Super FREQ
Posts: 806

Re: How to display value label instead of actual value in output?

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;

 

Ask a Question
Discussion stats
  • 1 reply
  • 448 views
  • 2 likes
  • 2 in conversation