<?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: Input Statement Help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Help/m-p/515403#M139048</link>
    <description>&lt;P&gt;Thanks so much Reeza!!&lt;/P&gt;</description>
    <pubDate>Thu, 22 Nov 2018 17:09:23 GMT</pubDate>
    <dc:creator>christ0fr</dc:creator>
    <dc:date>2018-11-22T17:09:23Z</dc:date>
    <item>
      <title>Input Statement Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Help/m-p/515398#M139043</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to run some very simple code to read a file (attached). I expect 7 variables Q1 through 7 each with one one-digit number; however, the code below gives me a 7 digit number in Q1, the age in Q2, the IQ in Q3. I tried putting spaces between the Q1-Q7 data in the dat file, but then I get every variable with only one digit (i.e., AGE will be one digit with the second digit being placed in IQ). I'm a new SAS user working my way through exercises and this was one that I couldn't make work (even using a datalines statement instead of infile).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data D1;
	infile 'C:/Users/myname/Desktop/volunteer.txt';
	input	#1	@1	Q1-Q7	1.
			@9	AGE	2.
			@12	IQ	3.
			@16	NUMBER	2.
			@19	SEX    $1. ;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 16:32:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Help/m-p/515398#M139043</guid>
      <dc:creator>christ0fr</dc:creator>
      <dc:date>2018-11-22T16:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Input Statement Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Help/m-p/515400#M139045</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/247899"&gt;@christ0fr&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You just forgot the parentheses:&lt;/P&gt;
&lt;PRE&gt;input @1 &lt;FONT color="#FF0000"&gt;(&lt;/FONT&gt;Q1-Q7&lt;FONT color="#FF0000"&gt;) (&lt;/FONT&gt;1.&lt;FONT color="#FF0000"&gt;)&lt;/FONT&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Nov 2018 16:41:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Help/m-p/515400#M139045</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-11-22T16:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Input Statement Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Help/m-p/515401#M139046</link>
      <description>&lt;P&gt;Put brackets around the Q and format. I don't think you need the #1 either.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data D1;
	input   @1	&lt;FONT color="#800080"&gt;&lt;STRONG&gt;(Q1-Q7)	(1.)&lt;/STRONG&gt;&lt;/FONT&gt;
			@9	AGE	2.
			@12	IQ	3.
			@16	NUMBER	2.
			@19	SEX    $1. ;
cards;
2234243 22  98  1 M
3424325 20 105  2 M
3242424 32  90  3 F
3242323  9 119  4 F
3232143  8 101  5 F
3242242 24 104  6 M
;;;;

RUN;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/247899"&gt;@christ0fr&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to run some very simple code to read a file (attached). I expect 7 variables Q1 through 7 each with one one-digit number; however, the code below gives me a 7 digit number in Q1, the age in Q2, the IQ in Q3. I tried putting spaces between the Q1-Q7 data in the dat file, but then I get every variable with only one digit (i.e., AGE will be one digit with the second digit being placed in IQ). I'm a new SAS user working my way through exercises and this was one that I couldn't make work (even using a datalines statement instead of infile).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data D1;
	infile 'C:/Users/myname/Desktop/volunteer.txt';
	input	#1	@1	Q1-Q7	1.
			@9	AGE	2.
			@12	IQ	3.
			@16	NUMBER	2.
			@19	SEX    $1. ;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 16:42:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Help/m-p/515401#M139046</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-22T16:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Input Statement Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Help/m-p/515403#M139048</link>
      <description>&lt;P&gt;Thanks so much Reeza!!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 17:09:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Help/m-p/515403#M139048</guid>
      <dc:creator>christ0fr</dc:creator>
      <dc:date>2018-11-22T17:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Input Statement Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Help/m-p/515404#M139049</link>
      <description>Thanks FreelanceReinhard!</description>
      <pubDate>Thu, 22 Nov 2018 17:09:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Help/m-p/515404#M139049</guid>
      <dc:creator>christ0fr</dc:creator>
      <dc:date>2018-11-22T17:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Input Statement Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Help/m-p/515407#M139051</link>
      <description>&lt;P&gt;Array and input&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data D1;
array Q{7};
	input    Q{*} 1.
			@9	AGE	2.
			@12	IQ	3.
			@16	NUMBER	2.
			@19	SEX    $1. ;
cards;
2234243 22  98  1 M
3424325 20 105  2 M
3242424 32  90  3 F
3242323  9 119  4 F
3232143  8 101  5 F
3242242 24 104  6 M
;;;;

RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Nov 2018 17:31:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Help/m-p/515407#M139051</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-22T17:31:46Z</dc:date>
    </item>
  </channel>
</rss>

