DATA Step, Macro, Functions and more

proc print display label

Accepted Solution Solved
Reply
Contributor scb
Contributor
Posts: 69
Accepted Solution

proc print display label

Just want to know why the report created using code below could not display label names without _? Anyone can help? Thanks.

 


PROC PRINT DATA=MYDATA
BY BRANCH_CODE BRANCH_NAME;
ID BRANCH_CODE BRANCH_NAME;
SUM BRANCH_PROFIT;
LABEL BRANCH_CODE="BRANCH CODE";
LABEL BRANCH_NAME="BRANCH NAME";
LABEL BRANCH_PROFIT="BRANCH PROFIT";
FORMAT BRANCH_PROFIT DOLLAR16.2;
RUN;


Accepted Solutions
Solution
‎04-11-2017 07:00 AM
SAS Super FREQ
Posts: 8,868

Re: proc print display label

Hi:
Please read the PROC PRINT documentation, when you have a LABEL statement in your code, you need to tell PROC PRINT to USE the LABEL with the LABEL option in your PROC PRINT statement:
proc print data=mydata label;
or
proc print data=mydata split='_';

Either the LABEL or the SPLIT option tells PROC PRINT to use the LABEL for the data.

cynthia

View solution in original post


All Replies
Solution
‎04-11-2017 07:00 AM
SAS Super FREQ
Posts: 8,868

Re: proc print display label

Hi:
Please read the PROC PRINT documentation, when you have a LABEL statement in your code, you need to tell PROC PRINT to USE the LABEL with the LABEL option in your PROC PRINT statement:
proc print data=mydata label;
or
proc print data=mydata split='_';

Either the LABEL or the SPLIT option tells PROC PRINT to use the LABEL for the data.

cynthia
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 119 views
  • 0 likes
  • 2 in conversation