<?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 Read in data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115552#M259298</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I modify this snippet of code such that it reads the name as "John Doe"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data foo;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input name $ age score;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;John Doe 23 25&lt;/P&gt;&lt;P&gt;Mike 23 26&lt;/P&gt;&lt;P&gt;Meow 1 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anca.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Oct 2013 23:10:59 GMT</pubDate>
    <dc:creator>AncaTilea</dc:creator>
    <dc:date>2013-10-17T23:10:59Z</dc:date>
    <item>
      <title>Read in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115552#M259298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I modify this snippet of code such that it reads the name as "John Doe"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data foo;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input name $ age score;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;John Doe 23 25&lt;/P&gt;&lt;P&gt;Mike 23 26&lt;/P&gt;&lt;P&gt;Meow 1 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anca.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 23:10:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115552#M259298</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-10-17T23:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Read in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115553#M259299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="809401" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;: here is one possibility:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat name $50.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input @;&lt;/P&gt;&lt;P&gt;&amp;nbsp; _infile_=substr(_infile_,1,anydigit(_infile_)-1)||"&amp;nbsp; "||substr(_infile_,anydigit(_infile_));&lt;/P&gt;&lt;P&gt;&amp;nbsp; input name &amp;amp; age score;&lt;/P&gt;&lt;P&gt;&amp;nbsp; datalines;&lt;/P&gt;&lt;P&gt;John Doe 23 25&lt;/P&gt;&lt;P&gt;Mike 23 26&lt;/P&gt;&lt;P&gt;Meow 1 4&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 23:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115553#M259299</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-10-17T23:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Read in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115554#M259300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;This is the code if you want to read the name (first and last) into one variable&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data foo;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input name $ 1-8 age score;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;datalines;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;John Doe 23 25&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Mike&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 23 26&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Meow&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 4&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 00:04:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115554#M259300</guid>
      <dc:creator>lekha</dc:creator>
      <dc:date>2013-10-18T00:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Read in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115555#M259301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lekha,&lt;/P&gt;&lt;P&gt;You have modified the way the data was given.&lt;/P&gt;&lt;P&gt;I needed for that specific data records,you aligned the age and score so that name takes up to 8 characters.&lt;/P&gt;&lt;P&gt;Thanks by &lt;A __default_attr="149594" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; had the solution I was hoping for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anca.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 00:29:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115555#M259301</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-10-18T00:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Read in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115556#M259302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How elegant!&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it's not too much trouble, would you mind describing the _INFILE_ line in the code...?&lt;/P&gt;&lt;P&gt;Anca.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 00:29:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115556#M259302</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-10-18T00:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Read in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115557#M259303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An alternative would be :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data foo;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;length name $24;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input @;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;nLen = anydigit(_infile_) - 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input name $varying24. nLen age score;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;drop nLen;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;John Doe 23 25&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Mike 23 26&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Meow 1 4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 00:44:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115557#M259303</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-10-18T00:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Read in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115558#M259304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very nice, &lt;A __default_attr="2746" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This code I can understand.&lt;/P&gt;&lt;P&gt;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;I would give you &lt;EM&gt;Correct Answer.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anca.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 00:47:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115558#M259304</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-10-18T00:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Read in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115559#M259305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="809401" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;: Feel free to give pgstats the correct answer .. I've already got far more points than I know what to do with.&amp;nbsp; However, here is the answer to your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_infile_, as I understand it, is an automatic system variable that is created whenever one uses an input statement and, if one continues to read the same record, the _infile_ variable is what is read, rather than the actual data record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As such, using an input @ statement, without inputting any specific variable(s), one can modify the _infile_ variable and, upon using another input statement, they are actually applying it to the _infile_ variable.&amp;nbsp; Thus, what my suggested code was doing, was simply adding an extra space before the first number that existed in the record.&amp;nbsp; That way, your data could be read as if it had been properly formatted, i.e., with at least two spaces before a variable if the &amp;amp; modifier were used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Art&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 01:26:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115559#M259305</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-10-18T01:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Read in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115560#M259306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here to save Drop statement,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data foo;&lt;/P&gt;&lt;P&gt;length name $24;&lt;/P&gt;&lt;P&gt;input @;&lt;/P&gt;&lt;P&gt;_n_ = anydigit(_infile_) - 1;&lt;/P&gt;&lt;P&gt;input name $varying24. _n_ age score;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;John Doe 23 25&lt;/P&gt;&lt;P&gt;Mike 23 26&lt;/P&gt;&lt;P&gt;Meow 1 4&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 01:31:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115560#M259306</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-10-18T01:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Read in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115561#M259307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unrelated to this topic, I would like to THANK YOU for your (inspiring) presentation at MWSUG at the Expert Panel discussion (the bank robberies problem), I was very much looking forward to learn from the experts how did they tackle the problem, and with the exception of Art C, I was truly disappointed in the solution given: this data is too dirty!&lt;/P&gt;&lt;P&gt;And you made all that go away by showing the most elegant (possible) solution!&lt;/P&gt;&lt;P&gt;So I thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anca.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 11:04:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115561#M259307</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-10-18T11:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Read in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115562#M259308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;
&lt;P&gt;Anca tilea wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;(inspiring) presentation at MWSUG at the Expert Panel discussion (the bank robberies problem),&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a record of this most singular event?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 12:17:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115562#M259308</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-10-18T12:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Read in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115563#M259309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="809401" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; and DN: MWSUG was supposed to publish a summary of the discussion, but I haven't seen anything as yet.&amp;nbsp; They did post the question and data at: &lt;A href="http://www.mwsug.org/2013/expertspanel.html" title="http://www.mwsug.org/2013/expertspanel.html"&gt;MidWest SAS Users Group - Experts Panel&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My paper and powerpoint can be found at: &lt;A href="http://www.sascommunity.org/wiki/Expert_Panel_Solution_MWSUG_2013-Tabachneck" title="http://www.sascommunity.org/wiki/Expert_Panel_Solution_MWSUG_2013-Tabachneck"&gt;Expert Panel Solution MWSUG 2013-Tabachneck - sasCommunity&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 13:11:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-data/m-p/115563#M259309</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-10-18T13:11:56Z</dc:date>
    </item>
  </channel>
</rss>

