<?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: Reading in delimited in-stream data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-delimited-in-stream-data/m-p/685930#M208068</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I actually did try using :$11 and that works, however, it does not make sense to me because the word 'Washington' only has 10 characters in it. I was wondering if there was another reason this syntax was not working for me.&lt;/P&gt;&lt;P&gt;-Kate&lt;/P&gt;</description>
    <pubDate>Wed, 23 Sep 2020 03:13:09 GMT</pubDate>
    <dc:creator>kateb409</dc:creator>
    <dc:date>2020-09-23T03:13:09Z</dc:date>
    <item>
      <title>Reading in delimited in-stream data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-delimited-in-stream-data/m-p/685921#M208063</link>
      <description>&lt;P&gt;Hi there!&lt;/P&gt;
&lt;P&gt;I am working in SAS On Demand version 9.4_m6 on Linux X64 operating system.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need help reading in some delimited in-stream data into SAS. This is the question on my homework and the provided in-stream data:&lt;/P&gt;
&lt;P&gt;I am running into the issue of capturing the full length of the state name 'Washington' in my results. I have tried using the dsd, missover, and truncover options and it did not help. This is the code I used:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data states;&lt;BR /&gt;infile datalines;&lt;BR /&gt;input state :$10.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;population :comma10. ;&lt;BR /&gt;datalines;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Washington 7,170,351&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Ohio 11,613,423&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Florida 21,299,325&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;proc print data = states;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And this is the result I get: the 'n' is cut off from 'Washington'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Please let me know if anyone has had this issue and knows how to fix it. Thanks!&lt;/P&gt;
&lt;P&gt;-Kate&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:17:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-delimited-in-stream-data/m-p/685921#M208063</guid>
      <dc:creator>kateb409</dc:creator>
      <dc:date>2020-12-10T15:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in delimited in-stream data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-delimited-in-stream-data/m-p/685925#M208065</link>
      <description>&lt;P&gt;Hi , Can you try expanding the&amp;nbsp;&lt;SPAN&gt;width of the informat from 10 to something like 12?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;input state :$12.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 02:26:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-delimited-in-stream-data/m-p/685925#M208065</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-09-23T02:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in delimited in-stream data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-delimited-in-stream-data/m-p/685928#M208066</link>
      <description>&lt;P&gt;That's odd.&amp;nbsp; The code works perfectly fine for me.&amp;nbsp; I'm on Windows, so maybe there's some difference there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try left justifying your data lines.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1600828320170.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49697iB2FA79826315FCC0/image-size/large?v=v2&amp;amp;px=999" role="button" title="jimbarbour_0-1600828320170.png" alt="jimbarbour_0-1600828320170.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Data lines should always be hard up to the left margin.&amp;nbsp; It shouldn't matter with a : modifier with a $10 informat, but let's try it.&amp;nbsp; If that doesn't work, change your definition to $11.&amp;nbsp; Again, it shouldn't matter, but if it's lopping off a character, let's give it more room.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 02:34:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-delimited-in-stream-data/m-p/685928#M208066</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-09-23T02:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in delimited in-stream data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-delimited-in-stream-data/m-p/685930#M208068</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I actually did try using :$11 and that works, however, it does not make sense to me because the word 'Washington' only has 10 characters in it. I was wondering if there was another reason this syntax was not working for me.&lt;/P&gt;&lt;P&gt;-Kate&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 03:13:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-delimited-in-stream-data/m-p/685930#M208068</guid>
      <dc:creator>kateb409</dc:creator>
      <dc:date>2020-09-23T03:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in delimited in-stream data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-delimited-in-stream-data/m-p/685932#M208070</link>
      <description>&lt;P&gt;The key thing here is something I can tell from your photographs that you don't actually mention in your problem description.&amp;nbsp; You are using SAS/Studio to edit and submit the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is nothing seriously wrong with the syntax of your data step (you don't need to the INFILE statement, you don't want to have leading spaces on your lines of data). So the issue is the content of your datalines.&amp;nbsp; When you have lines of code with TAB characters in them using SAS Display Manager the tabs are not submitted as part of the program.&amp;nbsp; &lt;STRONG&gt;But when you use SAS/Studio they are kept in the datalines and so will cause issues, especially when trying to read numeric values.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are a number of ways to fix this.&amp;nbsp; The best is to make sure not to include actual tabs in your programs. There are settings in the SAS editors to insert spaces when when you hit the tab key on your keyboard.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also use the EXPANDTABS option on an INFILE statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 03:44:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-delimited-in-stream-data/m-p/685932#M208070</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-09-23T03:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in delimited in-stream data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-delimited-in-stream-data/m-p/686056#M208117</link>
      <description>&lt;P&gt;Hey Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much for this! Both options worked. I knew it would end up being something extremely simple.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I apologize for not mentioning that I am using SAS Studio to edit and submit data. I will keep that in mind for next time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Kate&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 14:27:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-delimited-in-stream-data/m-p/686056#M208117</guid>
      <dc:creator>kateb409</dc:creator>
      <dc:date>2020-09-23T14:27:20Z</dc:date>
    </item>
  </channel>
</rss>

