BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
scb
Obsidian | Level 7 scb
Obsidian | Level 7

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ
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

1 REPLY 1
Cynthia_sas
SAS Super FREQ
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

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Save $200 when you sign up by March 14!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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