<?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: A question in input statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232139#M308366</link>
    <description>&lt;P&gt;Thank you very much for your time and attention! But the thing is that I cannot change the datalines. The datalines must remain unchanged as 123.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Oct 2015 22:21:38 GMT</pubDate>
    <dc:creator>liqi0318</dc:creator>
    <dc:date>2015-10-28T22:21:38Z</dc:date>
    <item>
      <title>A question in input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232135#M308364</link>
      <description>&lt;P&gt;Hi everybody! I encountered a question in the input statement. I want to create a dataset with one variable and three observations. Each observation is a single digit.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data step I wrote is the following:&lt;/P&gt;&lt;P&gt;data k;&lt;/P&gt;&lt;P&gt;input x 1.&amp;nbsp;@@;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;123&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Those three digits are next to each other and I want them to lie in three observations. When I ran the data step, it gave a data set with 80 observations and one variable x. The first three observations are 1, 2 and 3. The rest of the observations are all missing value. You could run it if you like. Could you be so kind to tell me why it happened? It should be a dataset with variable x and three observations.&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 21:47:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232135#M308364</guid>
      <dc:creator>liqi0318</dc:creator>
      <dc:date>2015-10-28T21:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: A question in input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232137#M308365</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a small modification of your code that should give you 3 observations of 1 variable. &amp;nbsp;I split the data into 3 lines and read it with a minor tweak..&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 k;
input x:1.;
datalines;
1
2
3
;
run;&lt;BR /&gt;&lt;BR /&gt;Proc print;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Here is a print for your reference...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
Obs	x
1	1
2	2
3	3&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps.... Good Luck...!!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 22:20:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232137#M308365</guid>
      <dc:creator>kannand</dc:creator>
      <dc:date>2015-10-28T22:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: A question in input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232139#M308366</link>
      <description>&lt;P&gt;Thank you very much for your time and attention! But the thing is that I cannot change the datalines. The datalines must remain unchanged as 123.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 22:21:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232139#M308366</guid>
      <dc:creator>liqi0318</dc:creator>
      <dc:date>2015-10-28T22:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: A question in input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232140#M308367</link>
      <description>&lt;P&gt;Is there a delimiter? and how long is the data?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 22:22:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232140#M308367</guid>
      <dc:creator>kannand</dc:creator>
      <dc:date>2015-10-28T22:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: A question in input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232141#M308368</link>
      <description>Thank you very much for your time and attention! But the thing is that I cannot change the datalines. The datalines must remain unchanged as 123.</description>
      <pubDate>Wed, 28 Oct 2015 22:22:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232141#M308368</guid>
      <dc:creator>liqi0318</dc:creator>
      <dc:date>2015-10-28T22:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: A question in input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232142#M308369</link>
      <description>No. The digits are just next to each other. The data contains 50 sigle digits which are next to each other. And I am confused at the outcome of my data step. It should work.</description>
      <pubDate>Wed, 28 Oct 2015 22:25:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232142#M308369</guid>
      <dc:creator>liqi0318</dc:creator>
      <dc:date>2015-10-28T22:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: A question in input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232143#M308370</link>
      <description>&lt;P&gt;SAS will pad the inline records ('CARDS') to 80 columns (actually a multiple of 80 if your text lines are longer than 80).&lt;/P&gt;
&lt;P&gt;You could add a line to skip the missing values.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if x=. then delete;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you could use PARMCARDS instead of CARDS (datalines). In line data generated this way is not padded to card image length.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options parmcards=tempdata;
filename tempdata temp;
parmcards;
123
;
data k;
  infile tempdata;
  input x 1. @@;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 22:28:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232143#M308370</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-10-28T22:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: A question in input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232145#M308371</link>
      <description>&lt;P&gt;If you always know how many you are reading then @ instead of @@&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data k;
   do i=1 to 3;
   input x 1. @;
   output;
   end;
   drop i;
datalines;
123
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Oct 2015 22:51:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232145#M308371</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-10-28T22:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: A question in input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232150#M308372</link>
      <description>Thanks a lot! But I still have a question. If this is the case, why I can't see another missing values if the data step is like this:&lt;BR /&gt;data k;&lt;BR /&gt;input x @@;&lt;BR /&gt;datalines;&lt;BR /&gt;1 2 3&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;Much appreciate your attention and time!</description>
      <pubDate>Wed, 28 Oct 2015 23:51:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232150#M308372</guid>
      <dc:creator>liqi0318</dc:creator>
      <dc:date>2015-10-28T23:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: A question in input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232153#M308373</link>
      <description>&lt;P&gt;1. You have introduced a space between the individual records in this scenario. I guess it is read as a delimited data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. You have also removed the variable type definition of x.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps the gurus here may add to it.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 01:44:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232153#M308373</guid>
      <dc:creator>kannand</dc:creator>
      <dc:date>2015-10-29T01:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: A question in input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232159#M308374</link>
      <description>&lt;P&gt;Yeah. That, I think, should be the reason. Thank you for your help! Much appreicate your attention!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 02:46:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232159#M308374</guid>
      <dc:creator>liqi0318</dc:creator>
      <dc:date>2015-10-29T02:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: A question in input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232725#M308375</link>
      <description>&lt;P&gt;try this&lt;/P&gt;
&lt;P&gt;data k;&lt;BR /&gt;input x1$;&lt;BR /&gt;do i = 1 to 3;&lt;BR /&gt;Dig1 = substr(x1,i,1);&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;drop i;&lt;BR /&gt;datalines;&lt;BR /&gt;123&lt;BR /&gt;456&lt;BR /&gt;675&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;Proc Print data = k;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2015 13:29:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232725#M308375</guid>
      <dc:creator>pearsoninst</dc:creator>
      <dc:date>2015-11-02T13:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: A question in input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232738#M308376</link>
      <description>Thank you very much for your help! The problem has been solved now!</description>
      <pubDate>Mon, 02 Nov 2015 14:19:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-question-in-input-statement/m-p/232738#M308376</guid>
      <dc:creator>liqi0318</dc:creator>
      <dc:date>2015-11-02T14:19:59Z</dc:date>
    </item>
  </channel>
</rss>

