The SAS Output Delivery System and reporting techniques

Proc report question. How to include multiple bullet points into 1 cell

Accepted Solution Solved
Reply
Contributor
Posts: 24
Accepted Solution

Proc report question. How to include multiple bullet points into 1 cell


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.


Accepted Solutions
Solution
‎04-24-2015 08:01 AM
SAS Super FREQ
Posts: 683

Re: Proc report question. How to include multiple bullet points into 1 cell

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


All Replies
SAS Super FREQ
Posts: 8,743

Re: Proc report question. How to include multiple bullet points into 1 cell

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

Contributor
Posts: 24

Re: Proc report question. How to include multiple bullet points into 1 cell

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)

Solution
‎04-24-2015 08:01 AM
SAS Super FREQ
Posts: 683

Re: Proc report question. How to include multiple bullet points into 1 cell

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;

Contributor
Posts: 24

Re: Proc report question. How to include multiple bullet points into 1 cell

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?

SAS Super FREQ
Posts: 683

Re: Proc report question. How to include multiple bullet points into 1 cell

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

Bruno

☑ This topic is SOLVED.

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

Discussion stats
  • 5 replies
  • 713 views
  • 0 likes
  • 3 in conversation