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

Hi Everyone,

I have a single dataset, based on a where condition I am dividing that dataset into multiple views and then I am printing the output in a single page as shown in the figure.

%DO Loop for Multiple conditions;

  proc report data=Abc(where=(variable="&Some_condition")) style(header)=[just=c fontsize=0.15in] style(column)=[just=l fontsize=0.12in] style(REPORT)= [width=100%] nowd;

  column(codeval decod);

  define codeval/"Code Value" left flow width=20;

  define decod/"Code Text" left flow width=20;

  run;

%END;

But the width is not uniform through out. It is changing everytime. Am I missing something. Please help me out.


pdf.JPG
1 ACCEPTED SOLUTION

Accepted Solutions
Vince28_Statcan
Quartz | Level 8

Base SAS(R) 9.3 Procedures Guide, Second Edition

The width= option in define statement does not apply to outputs other than traditional monospace output.

See Base SAS(R) 9.3 Procedures Guide, Second Edition

For an example of how to use

define age / style(column)=[cellwidth=1in];

define sex / style(column)=[width=10%];

styles options to specify width for other ODS destinations than monospace.

Hope this helps!

Vincent

View solution in original post

4 REPLIES 4
Vince28_Statcan
Quartz | Level 8

Base SAS(R) 9.3 Procedures Guide, Second Edition

The width= option in define statement does not apply to outputs other than traditional monospace output.

See Base SAS(R) 9.3 Procedures Guide, Second Edition

For an example of how to use

define age / style(column)=[cellwidth=1in];

define sex / style(column)=[width=10%];

styles options to specify width for other ODS destinations than monospace.

Hope this helps!

Vincent

AshokDatti
Calcite | Level 5

Hi Vince,

Thank You for your response. I tried giving 50% for both the variables and this is my result.

pdf2.JPG

Vince28_Statcan
Quartz | Level 8

Hi Ashok,

I'm not going to lie here I'm not quite familiar with proc report. My guess however, based on the example in the second link is that if you were to set one as 50% and the total width as 100% in your proc report statement, that the leftover portion would be automatically adjusted to whatever is leftover - likely "almost 50% but there are fractions of % taken for borders and whatnot"

I suggest you try removing the width option from either define statement and if it doesn't fix it, I can try and dig more into this issue.

Vince

AshokDatti
Calcite | Level 5

Hey Vince,

Thank  You so much. I solved it. Actually along with those two variables, I am using a grouping variable too but I am not printing it onto the report. I think it is creating a problem. I have adjusted the width to 49.5% each and it worked.

Thanks,

Ashok

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2867 views
  • 1 like
  • 2 in conversation