data baseball(keep= name team);
set sashelp.baseball;
if team = 'Cleveland';
run;
Sample output
Allanson, Andy Cleveland
Thornton, Andre Cleveland
Butler, Brett Cleveland
Jacoby, Brook Cleveland
Bando, Chris Cleveland
Castillo, Carmen Cleveland
Snyder, Cory Cleveland
Carter, Joe Cleveland
Franco, Julio Cleveland
Hall, Mel Cleveland
Tabler, Pat Cleveland
Bernazard, Tony Cleveland
PROC PRINT DATA = baseball noobs ;
var name team;
label team = 'My Team';
RUN;
The output is not changing the team name to 'My Team'. I researched this and I believe I am using correct syntax???
| Name | Team |
|---|---|
| Allanson, Andy | Cleveland |
| Thornton, Andre | Cleveland |
| Butler, Brett | Cleveland |
| Jacoby, Brook | Cleveland |
| Bando, Chris | Cleveland |
| Castillo, Carmen | Cleveland |
| Snyder, Cory | Cleveland |
| Carter, Joe | Cleveland |
| Franco, Julio | Cleveland |
| Hall, Mel | Cleveland |
| Tabler, Pat | Cleveland |
| Bernazard, Tony | Cleveland |
Add the label option in the proc print (and avoid coding in mixed/upper case):
proc print data=baseball noobs label; var name team; label team = 'My Team'; run;
Add the label option in the proc print (and avoid coding in mixed/upper case):
proc print data=baseball noobs label; var name team; label team = 'My Team'; run;
You have to add the LABELS option to PROC PRINT so it knows to use labels.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.