BookmarkSubscribeRSS Feed
knveraraju91
Barite | Level 11

For my question you asked for the report produced with the code;

 

I need to produce a report like this: File attached

my report file that was created by my code

 

Iused code: The output doesnot look same. Please help

 

OPTIONS nodate nonumber;
ods listing close;
ods escapechar="^";
title1 justify=right 'page ^{pageof}';
title2 "Table 14.3.1.1 Treatment-Emergent Adverse Event Frequency by Treatment -";

title3 "Number of Subjects Reporting the Event (% of Subjects Dosed) (Safety Population)";
footnote1 "Note: Adverse events (AEs) were coded with MedDRA Version 18.0.";
footnote2 "Program: /CA17139/sas_prg/stsas/tab/adam_tblae1a_auto.sas 16DEC2015 12:16";
footnote2 " %sysget(sas_execfilepath) &sysdate. &systime.";
options orientation=landscape formchar="|----|+|---+=|-/\<>*";

ods rtf file="C:\Users\vvemireddy\Desktop\ae_1.rtf" style=journal;
proc report data=four nowd headline headskip style(report)=[frame=void];
column grp aebodsys aedecod aetext cnt_pct4 ("JPZ" "_______________" cnt_pct1 cnt_pct2) cnt_pct3 cnt_pct5;
define grp/order noprint;
define aebodsys/order noprint;
define aedecod/display center noprint;
define aetext/ display 'Adverse Event' style(column)={asis=on cellspacing=.25pt just=left};
define cnt_pct1 / "300 mg" style(column)={cellspacing=.25pt just=left};
define cnt_pct2/ "900 mg" style(column)={cellspacing=.25pt just=left} ;
define cnt_pct3/ "400 mg Moxifloxacin" style(column)={cellspacing=.25pt just=left};
define cnt_pct4/"Plcebo" style(column)={cellspacing=.25pt just=left} ;
define cnt_pct5/"TOTAL" style(column)={cellspacing=.25pt just=left} ;
compute after grp/style={protectspecialchars=off};
n+1;
len=ifn(n=1,20,0);
dummy='\brdrt\brdrs';
line dummy $varying20. len;
endcomp;
run;
ods rtf close;

 

3 REPLIES 3
knveraraju91
Barite | Level 11

I need to have my output like the file attached. I attached the the code and output in my previous post. Thank you

Reeza
Super User

Without sample data we can't say what in your code isn't working.

ballardw
Super User

Please be explicit in stating what the issue with your current output compared with your desired.

I am guessing that you are not getting something to line up as desired but is purely a guess.

 

And since you do not show any statistics or compute statements then I am again guessing that the values for your cnt_pct1 etc. variables are character. In which case the internal space use between the () is going to be incorrect because they are not built correctly .

Also since you are using JUST=LEFT everywhere then values like 7 ( 12%) or 0 (  0%) will not align with values above like 47 ( 81%) because you told them to shift to the left removing the leading spaces.

 

Additionally ODS RTF and style=Journal (almost ALL styles actually) will use proportional fonts. That means that each character takes up different amounts of space and blanks do not take up anywhere near as much space as most charcters. So alignment by guessing how many spaces to insert will be a nightmare, if at all possible. If you create a modified style that defaults to using a monospace font,

such as Courier New, that might be possible.

 

Since that example desired output looks a LOT like old line-printer output, you could also try directing the output to LISTING and saving the file as Plain text. Print with a monospace font or open in wordprocessor program and set to a monospace font.

 

 

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