BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Q1983
Lapis Lazuli | Level 10

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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;

View solution in original post

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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;
Reeza
Super User

You have to add the LABELS option to PROC PRINT so it knows to use labels. 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

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
  • 2 replies
  • 4792 views
  • 1 like
  • 3 in conversation