<?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: What do these numbers mean in the input statement? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420030#M103332</link>
    <description>&lt;P&gt;Thanks RM6,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I get it but wouldn't this mean you would need to know the minimum &amp;amp; maximum length of the fields in order to write the correct range?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this used for alignment of data when presented?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not getting why it's required/used?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 11 Dec 2017 08:01:06 GMT</pubDate>
    <dc:creator>OscarBoots2</dc:creator>
    <dc:date>2017-12-11T08:01:06Z</dc:date>
    <item>
      <title>What do these numbers mean in the input statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420020#M103325</link>
      <description>&lt;P&gt;Hi Forum,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry I know the Subject isn't very clear but it's the best I can do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've seen these numbers from 'x' to 'y', but haven't seen a clear explanation of what they are for?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got this code from the Step-by-Step Programming with&lt;BR /&gt;Base SAS® Software guide.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data club2;&lt;BR /&gt;input #2 Team $ 1-6 #1 Name $ 6-23 IdNumber 1-4&lt;BR /&gt;#3 StartWeight 1-3 EndWeight 5-7;&lt;BR /&gt;datalines;&lt;BR /&gt;1023 David Shaw&lt;BR /&gt;red&lt;BR /&gt;189 165&lt;BR /&gt;1049 Amelia Serrano&lt;BR /&gt;yellow&lt;BR /&gt;145 124&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;Can someone tell me what do the '1-6', '6-23' etc numbers mean &amp;amp; what function do they perform?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 06:44:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420020#M103325</guid>
      <dc:creator>OscarBoots2</dc:creator>
      <dc:date>2017-12-11T06:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: What do these numbers mean in the input statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420023#M103327</link>
      <description>Look at the documentation of the input statement.</description>
      <pubDate>Mon, 11 Dec 2017 07:33:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420023#M103327</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2017-12-11T07:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: What do these numbers mean in the input statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420024#M103328</link>
      <description>&lt;P&gt;I have &amp;amp; then posted this question&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 07:34:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420024#M103328</guid>
      <dc:creator>OscarBoots2</dc:creator>
      <dc:date>2017-12-11T07:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: What do these numbers mean in the input statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420026#M103329</link>
      <description>&lt;P&gt;Your code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input #2 Team $ 1-6 
      #1 Name $ 6-23 IdNumber 1-4
      #3 StartWeight 1-3 EndWeight 5-7;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;means that your data is spread on 3 input rows: #1 #2 #3.&lt;/P&gt;
&lt;P&gt;I would prefer read rows in proper order: #1 first, then #2 and last #3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the $ sign means to read a character type data, e.g the &lt;STRONG&gt;NAME&lt;/STRONG&gt; is from position 6 to position 23.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;IDNUMBER&lt;/STRONG&gt; is numeric 4 digits from position 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 07:48:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420026#M103329</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-12-11T07:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: What do these numbers mean in the input statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420027#M103330</link>
      <description>&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;these numbers&amp;nbsp; after the variable names in input statement describes -from which position&amp;nbsp;&amp;nbsp; and to which position should this variable read that data from datalines.&lt;/P&gt;&lt;P&gt;in your example&lt;/P&gt;&lt;P&gt;# 2 &amp;nbsp;team $ 1-6&amp;nbsp; describes that data from second line(#2)&amp;nbsp; in datalines read from position 1 to 6 as team.&lt;/P&gt;&lt;P&gt;and so on..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 07:54:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420027#M103330</guid>
      <dc:creator>RM6</dc:creator>
      <dc:date>2017-12-11T07:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: What do these numbers mean in the input statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420030#M103332</link>
      <description>&lt;P&gt;Thanks RM6,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I get it but wouldn't this mean you would need to know the minimum &amp;amp; maximum length of the fields in order to write the correct range?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this used for alignment of data when presented?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not getting why it's required/used?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 08:01:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420030#M103332</guid>
      <dc:creator>OscarBoots2</dc:creator>
      <dc:date>2017-12-11T08:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: What do these numbers mean in the input statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420032#M103333</link>
      <description>well usually you should have a data dictionary of some sort which gives you these start position and end position.&lt;BR /&gt;&lt;BR /&gt;as you are trying to read data from multiple lines in to single line of data in to your dataset, it is pretty important to know what data goes to which variable.&lt;BR /&gt;</description>
      <pubDate>Mon, 11 Dec 2017 08:17:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420032#M103333</guid>
      <dc:creator>RM6</dc:creator>
      <dc:date>2017-12-11T08:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: What do these numbers mean in the input statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420033#M103334</link>
      <description>&lt;P&gt;Thanks RM6,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wasn't aware that I needed a DD to find this out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So is the purpose of these numbers for SAS to know when to add a new record (Row) using the values after the 'Datalines' statement?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 08:26:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420033#M103334</guid>
      <dc:creator>OscarBoots2</dc:creator>
      <dc:date>2017-12-11T08:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: What do these numbers mean in the input statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420035#M103335</link>
      <description>&lt;P&gt;There are, at least, to types of input data:&lt;/P&gt;
&lt;P&gt;1) Fixed length where each variable has its start position and end position the same along all input rows&lt;/P&gt;
&lt;P&gt;2) Variable length where except the first one all other may have different stsrt position and different length.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;In subh case you need define a chracter to serve as delimiter between the variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;See option&amp;nbsp;&lt;STRONG&gt;delimiter= (or dlm=) and dsd&lt;/STRONG&gt; in the&amp;nbsp;&lt;STRONG&gt;input&lt;/STRONG&gt; statement documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; In CSV files the comma is rthe delimiter brtween variables.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 09:00:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420035#M103335</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-12-11T09:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: What do these numbers mean in the input statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420249#M103399</link>
      <description>&lt;P&gt;I don't think I'm adding anything new, just saying the same thing using different words.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The INPUT statement is your instructions on how to read lines of incoming data.&amp;nbsp; So 1-6 says take the contents of columns 1 through 6, and make that the value of TEAM.&amp;nbsp; Similarly, take the contents of columns 6 through 23, and make that the value of NAME.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Surely the documentation has examples of this.&amp;nbsp; Perhaps those examples are not complicated by the use of #.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 19:14:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420249#M103399</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-12-11T19:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: What do these numbers mean in the input statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420297#M103421</link>
      <description>&lt;P&gt;Thanks Schmuel, RM6 &amp;amp; Astounding,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What if I ask the question "What happens if I don't use these numbers in my Input statement?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 22:31:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420297#M103421</guid>
      <dc:creator>OscarBoots2</dc:creator>
      <dc:date>2017-12-11T22:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: What do these numbers mean in the input statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420354#M103448</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;well you will not get the desired output you are looking for, if you remove the numbers. In your example you are trying to read name as "David Shaw" , lets say you want to remove the start and the end position then name will read only "David" as there is a space in between the Name variable can not read entire "David Shaw".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you have trouble finding the end position for the variables, or each time you receive a new data file end position changes&lt;/P&gt;&lt;P&gt;try this, in the below sample, you don't have to define the end position but you will atleast need the start position .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; club2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; #&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; @&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; Team &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;#&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; @&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; Name &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$30.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;@&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; IdNumber&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;#&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; @&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; StartWeight &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;@&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; EndWeight ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1023 David Shaw&lt;/P&gt;&lt;P&gt;red&lt;/P&gt;&lt;P&gt;189 165&lt;/P&gt;&lt;P&gt;1049 Amelia Serrano&lt;/P&gt;&lt;P&gt;yellow&lt;/P&gt;&lt;P&gt;145 124&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 03:52:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420354#M103448</guid>
      <dc:creator>RM6</dc:creator>
      <dc:date>2017-12-12T03:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: What do these numbers mean in the input statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420376#M103455</link>
      <description>&lt;P&gt;Make sure to post code using either Insert Code or Insert SAS Code buttons in the editor. Otherwise the forum software will try to turn you code into paragraphs.&amp;nbsp; This will mess up the formatting, which is critical if you are trying to read data by position.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are looking at your data file using a text editor make sure to use a fixed space font (like COURIER) so that the character positions line up.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are using the SAS program editor (under display Manager) you can ask it to insert a ruler line to make it easier to see the positions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also use a data step with the LIST statement to dump some lines to the SAS log.&amp;nbsp; For example this data step will dump the first 10 lines of the file referenced to the log.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  infile 'mytextfile' obs=10;
  input;
  list;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Dec 2017 06:49:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-do-these-numbers-mean-in-the-input-statement/m-p/420376#M103455</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-12-12T06:49:46Z</dc:date>
    </item>
  </channel>
</rss>

