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


Hi,

How would I add  bullet points mentioned in one cell in RTF using proc report.


•        Protocol required data collection / testing (9)

•        Study visit early or late (9)

•        System not implanted per protocol (1)

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

Hi

You can use the inline formatting functions to achieve what you are after. For that you need to set the ESCAPECHAR= option for ODS. You can find more information about the available inline formatting functions here: SAS(R) 9.4 Output Delivery System: User's Guide, Third Edition. The sample below use the {NEWLINE} and {UNICODE} functions. Please consider the length of this additional text in the variable that is used for reporting. The SPLIT= option is for spliting column header text.

Find below sample code.

data x;
  infile cards dlm="," ;
  input pt text : $60. ;
  cards;
1,Protocol required data collection / testing (9)
1,Study visit early or late (9)
1,System not implanted per protocol (1)
;

data x1;
  length temp $ 1024;
 
set x;
  retain temp;
  temp = catx("^{newline}", temp, catx(" ", "^{unicode 25cf}",text) );
run;

ods escapechar="^";

proc report data=x1 nowd  split="/";
 
column pt temp;
  define pt / display;
 
define temp / display;
run;

View solution in original post

5 REPLIES 5
Cynthia_sas
SAS Super FREQ

Hi:

  What does your data look like. Whether you can get all 3 lines into 1 cell is possible. Getting a bullet or indicator is possible using different characters and different fonts -- depending, of course, on your destination. You have not specified the destination. You have not shown the data and you haven't shown any code that you have tried. But the structure of any PROC REPORT code will very much depend on the structure of the data. So, what does your data look like? What code have you tried? What is your destination of interest?

cynthia

BOBSAS
Calcite | Level 5

Here is the sample code and desired output. I used retain to bring the values to 1 row with '/' default split character. but when I used split="/". I am expecting all three text values one below other in final output.

data x;

input pt text $5-61;

cards;

1 •        Protocol required data collection / testing (9)

1 •        Study visit early or late (9)

1 •        System not implanted per protocol (1)

;

data x1;

length temp $200;

  set x;

  retain temp;

  by pt;

  if first.pt then temp=strip(text);

  else temp=strip(temp)||'/'||strip(text);

  if last.pt;

run;

ods rtf file ="C:\Documents and Settings\Desktop\test.rtf";

proc report data=x1 nowd  split="/";

  column pt temp;

  define pt/display;

  define temp/display;

run;

ods rtf close;

Desired output:

1

•        Protocol required data collection / testing (9)

•        Study visit early or late (9)

•        System not implanted per protocol (1)

BrunoMueller
SAS Super FREQ

Hi

You can use the inline formatting functions to achieve what you are after. For that you need to set the ESCAPECHAR= option for ODS. You can find more information about the available inline formatting functions here: SAS(R) 9.4 Output Delivery System: User's Guide, Third Edition. The sample below use the {NEWLINE} and {UNICODE} functions. Please consider the length of this additional text in the variable that is used for reporting. The SPLIT= option is for spliting column header text.

Find below sample code.

data x;
  infile cards dlm="," ;
  input pt text : $60. ;
  cards;
1,Protocol required data collection / testing (9)
1,Study visit early or late (9)
1,System not implanted per protocol (1)
;

data x1;
  length temp $ 1024;
 
set x;
  retain temp;
  temp = catx("^{newline}", temp, catx(" ", "^{unicode 25cf}",text) );
run;

ods escapechar="^";

proc report data=x1 nowd  split="/";
 
column pt temp;
  define pt / display;
 
define temp / display;
run;

BOBSAS
Calcite | Level 5

That worked. Thanks for your help.

BTW ^{newline} is taking my strings to next line whenever it see ^ and ^{unicode 25cf} is giving *(Bullet). Am I right?

BrunoMueller
SAS Super FREQ

Yes, you are right, check out the other Inline Formatting Function, as described in the doc.

Bruno

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 2349 views
  • 0 likes
  • 3 in conversation