I am facing the same problem, labels not appearing in proc ,I tried proc options option=label; and option label;
proc options option=label;
run;
option label;
proc format;
value agegrp 0 - 30 = '0 to 30'
31 - 50 = '31 to 50'
51 - 70 = '50 to 70'
71 - high = '71 and older';
value $party 'D' = 'Democrat'
'R' = 'Republican';
value $likert '1' = 'Strongly Disagree'
'2' = 'Disagree'
'3' = 'No Opinion'
'4' = 'Agree'
'5' = 'Strongly Agree';
run;
data Voter;
input Age Party : $1. (Ques1-Ques4)($1. + 1);
label Ques1 = 'The president is doing a good job'
Ques2 = 'Congress is doing a good job'
Ques3 = 'Taxes are too high'
Ques4 = 'Government should cut spending';
format Age agegrp.
Party $party.
Ques1-Ques4 $likert.;
datalines;
23 D 1 1 2 2
45 R 5 5 4 1
67 D 2 4 3 3
39 R 4 4 4 4
19 D 2 1 2 1
75 D 3 3 2 3
57 R 4 3 4 4
;
title "Listing of Voter";
proc print data=Voter;
run;
Any help/suggestion ,I would be so grateful.
If you don't actually tell PROC PRINT to use the labels as the column headers it will continue to use the names.
proc print data=Voter LABEL;
Whether you change the labels to use during PROC by also using LABEL statements or not.
PROC PRINT will use the variable names by default. If you want it to use the labels then add the LABEL option to the PROC PRINT statement.
Thanks for the response ,I tried with label in proc print
title "Listing of Voter";
proc print data=Voter;
label Ques1 = 'The president is doing a good job'
Ques2 = 'Congress is doing a good job'
Ques3 = 'Taxes are too high'
Ques4 = 'Government should cut spending';
run;
Still I get the variable names.
If you don't actually tell PROC PRINT to use the labels as the column headers it will continue to use the names.
proc print data=Voter LABEL;
Whether you change the labels to use during PROC by also using LABEL statements or not.
thanks ,it worked
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.