<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Autofit column width in proc print in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Autofit-column-width-in-proc-print/m-p/430926#M281657</link>
    <description>&lt;P&gt;&amp;nbsp;This issue happens on Jupyter Notebook using sas_kernel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc SQL inobs=20;&lt;BR /&gt;&lt;BR /&gt;    Select * from have;&lt;BR /&gt;
Quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The code above outputs a table in which data overlaps as in shown below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="overlap.JPG" style="width: 237px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18101iF739D7D248A2A400/image-size/large?v=v2&amp;amp;px=999" role="button" title="overlap.JPG" alt="overlap.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I would like to outfit every column to the max between the header length and the data length. I don't want to define this manually for every column.&lt;/P&gt;&lt;P&gt;How do I do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jan 2018 17:51:34 GMT</pubDate>
    <dc:creator>Autotelic</dc:creator>
    <dc:date>2018-01-25T17:51:34Z</dc:date>
    <item>
      <title>Autofit column width in proc print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Autofit-column-width-in-proc-print/m-p/430926#M281657</link>
      <description>&lt;P&gt;&amp;nbsp;This issue happens on Jupyter Notebook using sas_kernel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc SQL inobs=20;&lt;BR /&gt;&lt;BR /&gt;    Select * from have;&lt;BR /&gt;
Quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The code above outputs a table in which data overlaps as in shown below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="overlap.JPG" style="width: 237px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18101iF739D7D248A2A400/image-size/large?v=v2&amp;amp;px=999" role="button" title="overlap.JPG" alt="overlap.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I would like to outfit every column to the max between the header length and the data length. I don't want to define this manually for every column.&lt;/P&gt;&lt;P&gt;How do I do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 17:51:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Autofit-column-width-in-proc-print/m-p/430926#M281657</guid>
      <dc:creator>Autotelic</dc:creator>
      <dc:date>2018-01-25T17:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Autofit column width in proc print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Autofit-column-width-in-proc-print/m-p/430935#M281658</link>
      <description>&lt;P&gt;Try to increase OPTIONS&amp;nbsp; LineSize= ...;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 14:53:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Autofit-column-width-in-proc-print/m-p/430935#M281658</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-01-25T14:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Autofit column width in proc print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Autofit-column-width-in-proc-print/m-p/430949#M281659</link>
      <description>&lt;P&gt;What destination are you printing to? What application is that screen shot from?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When your code says cellwidth=1in then that is what you get, a cell of one inch width. You could take a pass through your data calculating the maximum number of characters per column, estimate a width using that information, stuff that into a bunch of macro variables and use those instead of literal 1in or similar values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BUT if you are writing to a spreadsheet then the width of a specific cell may well be controlled by something well before the cell you are looking at.&lt;/P&gt;
&lt;P&gt;Also if you are using a destination that actually has page widths such as RTF or PDF then your defined column widths may make the table split in some odd manner.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 15:23:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Autofit-column-width-in-proc-print/m-p/430949#M281659</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-01-25T15:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Autofit column width in proc print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Autofit-column-width-in-proc-print/m-p/430958#M281660</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;What destination are you printing to? What application is that screen shot from?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;I'm using jupyter notebook connected to SAS, but I'm hoping that isn't relevant.&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;When your code says cellwidth=1in then that is what you get, a cell of one inch width. You could take a pass through your data calculating the maximum number of characters per column, estimate a width using that information, stuff that into a bunch of macro variables and use those instead of literal 1in or similar values.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;I understand the implications of cellwidth=1in, I should have used another code. I've updated the question to remove this issue.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 15:32:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Autofit-column-width-in-proc-print/m-p/430958#M281660</guid>
      <dc:creator>Autotelic</dc:creator>
      <dc:date>2018-01-25T15:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Autofit column width in proc print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Autofit-column-width-in-proc-print/m-p/430974#M281661</link>
      <description>&lt;P&gt;I have zero experience with Jupyter but I suspect that has a big part in this appearance as I can't generate any output like that in HTML, Listing, RTF of PDF. Many years ago I did make similar output using the OVERPRINT options with PUT statements when writing to a printer or embedding codes in data to make a printer do that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It might help to provide a small data set and any other options you are using to see if any other Jupyter users have suggestions.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 16:12:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Autofit-column-width-in-proc-print/m-p/430974#M281661</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-01-25T16:12:52Z</dc:date>
    </item>
  </channel>
</rss>

