<?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: column and formatted inputs in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/column-and-formatted-inputs/m-p/703938#M26070</link>
    <description>Hi:&lt;BR /&gt;  Go to the documentation and read about the differences between column input and formatted input. With column input you can ONLY read character or numeric data in standard format. Your date is NOT in a standard format (has slashes), so it CANNOT be read except as a character string in the first program. That is the "side effect" of using column input. Either list input or formatted input, as you show could read the data with an informat. LISTING input won't work in this case because it looks like your data is not separated by a delimiter. So your only choice IF you want to read DOB as numeric is formatted input. If you look in the documentation on COLUMN input: &lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=n0lrz3gb7m9e4rn137op544ddg0v.htm&amp;amp;locale=en" target="_blank"&gt;https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=n0lrz3gb7m9e4rn137op544ddg0v.htm&amp;amp;locale=en&lt;/A&gt; you'll see that it specifically tell you that you can ONLY read standard numeric form with COLUMN based input.&lt;BR /&gt;Cynthia</description>
    <pubDate>Sun, 06 Dec 2020 18:30:44 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2020-12-06T18:30:44Z</dc:date>
    <item>
      <title>column and formatted inputs</title>
      <link>https://communities.sas.com/t5/New-SAS-User/column-and-formatted-inputs/m-p/703933#M26068</link>
      <description>&lt;P&gt;Column and formatted inputs to load a file are similar but different.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you load the following datasheet test.txt,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Name Sex DOB Weight&lt;/P&gt;
&lt;P&gt;12345678901234567890&lt;/P&gt;
&lt;P&gt;John&amp;nbsp; M08/10/202060&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For column input&lt;/P&gt;
&lt;P&gt;Data test.col;&lt;/P&gt;
&lt;P&gt;infile "path/test.txt";&lt;/P&gt;
&lt;P&gt;input&lt;/P&gt;
&lt;P&gt;name $1-5&lt;/P&gt;
&lt;P&gt;sex $6&lt;/P&gt;
&lt;P&gt;DOB $7-16&lt;/P&gt;
&lt;P&gt;Weight 17-18;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;you will get DOB in character. You can use input to convert the character to numeric of DOB before the calculation with DOB.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if you use formatted input:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data test.col;&lt;/P&gt;
&lt;P&gt;infile "path/test.txt";&lt;/P&gt;
&lt;P&gt;input&lt;/P&gt;
&lt;P&gt;@1&amp;nbsp;name $5.&lt;/P&gt;
&lt;P&gt;@6 sex $1.&lt;/P&gt;
&lt;P&gt;@7&amp;nbsp;DOB mmddyy10.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/153152"&gt;@17&lt;/a&gt;&amp;nbsp;Weight 2.;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;you will get the numeric DOB.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Dec 2020 17:05:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/column-and-formatted-inputs/m-p/703933#M26068</guid>
      <dc:creator>anming</dc:creator>
      <dc:date>2020-12-06T17:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: column and formatted inputs</title>
      <link>https://communities.sas.com/t5/New-SAS-User/column-and-formatted-inputs/m-p/703934#M26069</link>
      <description>&lt;P&gt;You cannot use any special informats when using column ranges.&amp;nbsp; But you can mix formatted input and column ranges in the same INPUT statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input
  name $1-5
  sex $6
  @7 DOB mmddyy10.
  Weight 17-18
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Dec 2020 17:17:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/column-and-formatted-inputs/m-p/703934#M26069</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-12-06T17:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: column and formatted inputs</title>
      <link>https://communities.sas.com/t5/New-SAS-User/column-and-formatted-inputs/m-p/703938#M26070</link>
      <description>Hi:&lt;BR /&gt;  Go to the documentation and read about the differences between column input and formatted input. With column input you can ONLY read character or numeric data in standard format. Your date is NOT in a standard format (has slashes), so it CANNOT be read except as a character string in the first program. That is the "side effect" of using column input. Either list input or formatted input, as you show could read the data with an informat. LISTING input won't work in this case because it looks like your data is not separated by a delimiter. So your only choice IF you want to read DOB as numeric is formatted input. If you look in the documentation on COLUMN input: &lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=n0lrz3gb7m9e4rn137op544ddg0v.htm&amp;amp;locale=en" target="_blank"&gt;https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=n0lrz3gb7m9e4rn137op544ddg0v.htm&amp;amp;locale=en&lt;/A&gt; you'll see that it specifically tell you that you can ONLY read standard numeric form with COLUMN based input.&lt;BR /&gt;Cynthia</description>
      <pubDate>Sun, 06 Dec 2020 18:30:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/column-and-formatted-inputs/m-p/703938#M26070</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-12-06T18:30:44Z</dc:date>
    </item>
  </channel>
</rss>

