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;
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;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.