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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 10538 views
  • 0 likes
  • 2 in conversation