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

I am working with LSAF at my company. When do proc tabulate in LSAF, We get results in the Results window, and I'm looking for a way to widen the width of the border table.


If the output is html / rtf / pdf, there is a way for it that it can be controlled by "cellwidth", but in the case of Results window, it was unknown, so let me ask you a question.
information source of control width when pdf / html:
https://www.sas.com/offices/asiapacific/japan/service/technical/faq/list/body/ba259.html 
https://communities.sas.com/t5/SAS-Procedures/specifying-column-width-for-proc-tabulate/td-p/101882

/*
https://www.sas.com/offices/asiapacific/japan/service/technical/faq/list/body/ba185.html
*/
PROC FORMAT;
  VALUE $genderf
        '1' = '男'
        '2' = '女'
;
  VALUE ynf
        1 = 'はい'
        2 = 'いいえ'
;
RUN;

DATA sample;
  INPUT group $ gender $ a1 @@;
  FORMAT gender genderf. a1 ynf.;
CARDS;
A  1 2   A 1 1
A  1 1   A 1 1
A  2 2   A 2 1
B  1 1   B 2 2
B  2 1   B 1 2
;
RUN;

PROC TABULATE DATA=sample;
  CLASS group gender a1;
  TABLES (group*(gender ALL)) ALL,a1*PCTN
  / MISSTEXT='0' PRINTMISS;
;
RUN;

Output of above code in SAS Studio

tabulate_sas_studio.png

Please tell me if there's a way for control column width (widening).Thank you for reading.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

@t_ar_taat wrote:

I am working with LSAF at my company. When do proc tabulate in LSAF, We get results in the Results window, and I'm looking for a way to widen the width of the border table.


If the output is html / rtf / pdf, there is a way for it that it can be controlled by "cellwidth", but in the case of Results window, it was unknown, so let me ask you a question.
information source of control width when pdf / html:
https://www.sas.com/offices/asiapacific/japan/service/technical/faq/list/body/ba259.html 
https://communities.sas.com/t5/SAS-Procedures/specifying-column-width-for-proc-tabulate/td-p/101882

/*
https://www.sas.com/offices/asiapacific/japan/service/technical/faq/list/body/ba185.html
*/
PROC FORMAT;
  VALUE $genderf
        '1' = '男'
        '2' = '女'
;
  VALUE ynf
        1 = 'はい'
        2 = 'いいえ'
;
RUN;

DATA sample;
  INPUT group $ gender $ a1 @@;
  FORMAT gender genderf. a1 ynf.;
CARDS;
A  1 2   A 1 1
A  1 1   A 1 1
A  2 2   A 2 1
B  1 1   B 2 2
B  2 1   B 1 2
;
RUN;

PROC TABULATE DATA=sample;
  CLASS group gender a1;
  TABLES (group*(gender ALL)) ALL,a1*PCTN
  / MISSTEXT='0' PRINTMISS;
;
RUN;

Output of above code in SAS Studio

tabulate_sas_studio.png

Please tell me if there's a way for control column width (widening).Thank you for reading.


You say you are trying to " widen the width of the border table." I don't know what that means as there is no "border" or "border table".

You can control cell width of column and row heading cells. See if this gives you a start:

PROC TABULATE DATA=sample;
  CLASS group gender a1;
  classlev a1 group/style=[cellwidth=5cm];
  TABLES (group*(gender ALL)) ALL,
        a1*PCTN
  / MISSTEXT='0' PRINTMISS;
;
RUN;

CLASSLEV sets properties for CLASS variables. In this case I make two of the class variables appear in wider cells.

If this doesn't work in LSAF then contact SAS Technical support.

View solution in original post

2 REPLIES 2
ballardw
Super User

@t_ar_taat wrote:

I am working with LSAF at my company. When do proc tabulate in LSAF, We get results in the Results window, and I'm looking for a way to widen the width of the border table.


If the output is html / rtf / pdf, there is a way for it that it can be controlled by "cellwidth", but in the case of Results window, it was unknown, so let me ask you a question.
information source of control width when pdf / html:
https://www.sas.com/offices/asiapacific/japan/service/technical/faq/list/body/ba259.html 
https://communities.sas.com/t5/SAS-Procedures/specifying-column-width-for-proc-tabulate/td-p/101882

/*
https://www.sas.com/offices/asiapacific/japan/service/technical/faq/list/body/ba185.html
*/
PROC FORMAT;
  VALUE $genderf
        '1' = '男'
        '2' = '女'
;
  VALUE ynf
        1 = 'はい'
        2 = 'いいえ'
;
RUN;

DATA sample;
  INPUT group $ gender $ a1 @@;
  FORMAT gender genderf. a1 ynf.;
CARDS;
A  1 2   A 1 1
A  1 1   A 1 1
A  2 2   A 2 1
B  1 1   B 2 2
B  2 1   B 1 2
;
RUN;

PROC TABULATE DATA=sample;
  CLASS group gender a1;
  TABLES (group*(gender ALL)) ALL,a1*PCTN
  / MISSTEXT='0' PRINTMISS;
;
RUN;

Output of above code in SAS Studio

tabulate_sas_studio.png

Please tell me if there's a way for control column width (widening).Thank you for reading.


You say you are trying to " widen the width of the border table." I don't know what that means as there is no "border" or "border table".

You can control cell width of column and row heading cells. See if this gives you a start:

PROC TABULATE DATA=sample;
  CLASS group gender a1;
  classlev a1 group/style=[cellwidth=5cm];
  TABLES (group*(gender ALL)) ALL,
        a1*PCTN
  / MISSTEXT='0' PRINTMISS;
;
RUN;

CLASSLEV sets properties for CLASS variables. In this case I make two of the class variables appear in wider cells.

If this doesn't work in LSAF then contact SAS Technical support.

t_ar_taat
Quartz | Level 8

ballardw, thank you for your comment.
It works in SAS Studio.
I think this will also nice in LSAF.
I add the picture of Results window after your code.

answer.jpg

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

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
  • 2 replies
  • 668 views
  • 0 likes
  • 2 in conversation