BookmarkSubscribeRSS Feed
RupaM3
Calcite | Level 5

Hi,

I have been working on the listings and I see an issue with the justification of one of test results when precision of 7 is used.

Imagine the data for test results is as follows:

 

20.000

30.000

40.000

 

Output expected is :

20

30

40

 

Good news is output is as expected but not center justified. The following is the code used in Proc Report.

 

define xxx / center flow "xxx Dose "
style(column)=[cellwidth=6% asis=on]
style(header)=[just=center] format=7.0;

 

Is there an alternative where the data can be displayed in the center as the expected output?

Thanks in advance.

 

Regards,

RupaM

3 REPLIES 3
Reeza
Super User

Works fine for me with this example:

 

proc report data=sashelp.class nowd;
column name age weight;
define name /display;
define age / center display 'Age (yrs)';
define weight / right format=8.1;
run;

You'll need to provide more information to illustrate how this is not working for you.

 


@RupaM3 wrote:

Hi,

I have been working on the listings and I see an issue with the justification of one of test results when precision of 7 is used.

Imagine the data for test results is as follows:

 

20.000

30.000

40.000

 

Output expected is :

20

30

40

 

Good news is output is as expected but not center justified. The following is the code used in Proc Report.

 

define xxx / center flow "xxx Dose "
style(column)=[cellwidth=6% asis=on]
style(header)=[just=center] format=7.0;

 

Is there an alternative where the data can be displayed in the center as the expected output?

Thanks in advance.

 

Regards,

RupaM


 

RupaM3
Calcite | Level 5

Hi Reeza,

 

The data gets wrapped and the output is not center justified. Is this commonly expected? 

I have attached the screenshots of two conditions where Format wasn't applied and was applied.

Hope this helps.

Thanks,

 

Regards,

Rupa

 

 

Cynthia_sas
SAS Super FREQ

Hi: Please show ALL your code. Your output looks like RTF output with the JOURNAL style, but you do NOT show any RTF statements. And, without any DATA to use, it is impossible to replicate your results or try to see what you mean. You do NOT show your COLUMN statement and you seem to have the wrong idea about what goes in the DEFINE statement.

You have this:
define xxx / center flow "xxx Dose "
style(column)=[cellwidth=6% asis=on]
style(header)=[just=center] format=7.0;

CENTER and FLOW are LISTING only options. If you want the data cell values to be centered, I recommend against using the CENTER option here. I don't understand, based on the data you show, why you are using the FLOW option, at all. That is a LISTING only option and irrelevant for any destination that uses STYLE options.

 

However, the HEADER is just the string 'xxx Dose' and the column is the for the formatted data value -- why do you have ASIS=ON for the data column? Are you using the SPLIT= option in PROC REPORT to get the headers like Actual Time split on 2 lines? If you are trying to force the text string to split using cellwidth, this is the wrong technique.

 

  If you want the numbers in the data cells centered, you need to ALSO move just=c into the style override for the COLUMN too. Also, why are you specifying a % for cellwidth? That will force RTF to convert from percent to TWIPS (twentieths of a printer's point) which is less reliable that specifying the size in inches or centimeters or just leave it off and see what you get before you start fiddling with settings. I doubt you need ASIS=ON and you probably don't need the CELLWIDTH either.

Seeing ALL your code and having some test data would be the best way to enable others to help you.

Cynthia

 

Using this code, without FLOW or ASIS=ON or CELLWIDTH, I get centering for both the header and the data cells:

center_data_values.png

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