<?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 Re: Format and Informat differ b/w Results Viewer (proc contents) and Explorer (VIEWTABLE: Work.data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Format-and-Informat-differ-b-w-Results-Viewer-proc-contents-and/m-p/370922#M275837</link>
    <description>&lt;P&gt;proc contents report includes colomn of varyable type, therefore the format is just the length of the variable unless defined explicitly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;variable1 is caharacter type. Viewtable assigns $ as prefix to length to say it is char type.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;variable2 is numeric. If format/informat are not defined, proc contents will display blank attribute,&lt;/P&gt;
&lt;P&gt;while viewtable displayes the default attributes.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jun 2017 13:36:56 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2017-06-27T13:36:56Z</dc:date>
    <item>
      <title>Format and Informat differ b/w Results Viewer (proc contents) and Explorer (VIEWTABLE: Work.dataset)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-and-Informat-differ-b-w-Results-Viewer-proc-contents-and/m-p/370903#M275835</link>
      <description>&lt;P&gt;Hello SAS Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using SAS 9.4 (English). For my dataset, I am seeing different attributes for Format and Informat for some variables according to whether I look at the attributes in the Results Viewer (after running proc contents)&amp;nbsp;or the Explorer (the column attributes of VIEWTABLE: Work.dataset). Here are two examples:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;variable1:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Results Viewer: Format = 8., Informat = 8.&lt;/LI&gt;&lt;LI&gt;Explorer: Format = $8., Informat = $8.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;variable2:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Results Viewer: Format = (it is blank), Informat = (it is blank)&lt;/LI&gt;&lt;LI&gt;Explorer: Format = BEST12., Informat = 12.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone please explain why this could be happening?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tristan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 13:05:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-and-Informat-differ-b-w-Results-Viewer-proc-contents-and/m-p/370903#M275835</guid>
      <dc:creator>TristanJ</dc:creator>
      <dc:date>2017-06-27T13:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: Format and Informat differ b/w Results Viewer (proc contents) and Explorer (VIEWTABLE: Work.data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-and-Informat-differ-b-w-Results-Viewer-proc-contents-and/m-p/370915#M275836</link>
      <description>&lt;P&gt;Permanently attached FORMAT or INFORMAT are not required for variables in SAS datasets. If there is no format attached to numeric variable SAS will print it using BEST12. &amp;nbsp;If there is no format attached to a character variable then SAS will print it using $w. where W is the length of the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x ;
  length var1 $8 var2 8 ;
  format var3 5. ;
  informat var4 $12. ;
run;
proc contents data=x ; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9902iC253257A3A0987FC/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;&lt;/P&gt;
&lt;P&gt;It looks like the VIEWTABLE is trying populate the empty values with values that represent what format you want to attach to replicate the default SAS behavior. Not sure why it uses 5. for the INFORMAT for VAR3, but if you are using list mode input (eg INPUT var1 var2 var3 var4; ) then SAS will ignore the widths of the INFORMATs that are attached to the variables anyway and adjust the width to the width of the actual value in the input stream.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 13:27:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-and-Informat-differ-b-w-Results-Viewer-proc-contents-and/m-p/370915#M275836</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-27T13:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Format and Informat differ b/w Results Viewer (proc contents) and Explorer (VIEWTABLE: Work.data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-and-Informat-differ-b-w-Results-Viewer-proc-contents-and/m-p/370922#M275837</link>
      <description>&lt;P&gt;proc contents report includes colomn of varyable type, therefore the format is just the length of the variable unless defined explicitly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;variable1 is caharacter type. Viewtable assigns $ as prefix to length to say it is char type.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;variable2 is numeric. If format/informat are not defined, proc contents will display blank attribute,&lt;/P&gt;
&lt;P&gt;while viewtable displayes the default attributes.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 13:36:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-and-Informat-differ-b-w-Results-Viewer-proc-contents-and/m-p/370922#M275837</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-06-27T13:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Format and Informat differ b/w Results Viewer (proc contents) and Explorer (VIEWTABLE: Work.data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-and-Informat-differ-b-w-Results-Viewer-proc-contents-and/m-p/370928#M275838</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your quick reply. I appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tristan&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 13:43:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-and-Informat-differ-b-w-Results-Viewer-proc-contents-and/m-p/370928#M275838</guid>
      <dc:creator>TristanJ</dc:creator>
      <dc:date>2017-06-27T13:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Format and Informat differ b/w Results Viewer (proc contents) and Explorer (VIEWTABLE: Work.data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-and-Informat-differ-b-w-Results-Viewer-proc-contents-and/m-p/370930#M275839</link>
      <description>Shmuel,&lt;BR /&gt;&lt;BR /&gt;Thank you for your reply. It, along with Tom's reply, is helpful.&lt;BR /&gt;&lt;BR /&gt;Tristan</description>
      <pubDate>Tue, 27 Jun 2017 13:44:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-and-Informat-differ-b-w-Results-Viewer-proc-contents-and/m-p/370930#M275839</guid>
      <dc:creator>TristanJ</dc:creator>
      <dc:date>2017-06-27T13:44:48Z</dc:date>
    </item>
  </channel>
</rss>

