<?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 Stuck on an Infile in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Stuck-on-an-Infile/m-p/86396#M24677</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; This is the raw data file that I am trying to infile:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;J. Mitchell&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Very Well done!&amp;nbsp; Rating:5&lt;/P&gt;&lt;P&gt;Amy Jung&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rating:4&lt;/P&gt;&lt;P&gt;Carl Heisman&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rating:4&lt;/P&gt;&lt;P&gt;Linda Deal&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Not enough give aways&amp;nbsp; Rating:3&lt;/P&gt;&lt;P&gt;Gabrielle Heron&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Nice! Rating:4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Not helpful at all Rating:2&lt;/P&gt;&lt;P&gt;Kyle Patterson&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Very good. Need more like it&amp;nbsp; Rating:5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see, there are a lot of variables that have different lengths.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the program that I have so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data seminar_ratings;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile 'G:\hw_data\seminar.dat';&lt;/P&gt;&lt;P&gt;&amp;nbsp; input Name &amp;amp; $ 1-17 @19 Comment &amp;amp; $28.&amp;nbsp; @'Rating:' Rating;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print data=seminar_ratings;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue that I am having is that the entries that have no comments are having the Ratings read in as comments.&lt;/P&gt;&lt;P&gt;I am really stuck as to what I should do so I have blank comments instead of the Ratings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could someone look at my code and let me know what I should do in this situation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Oct 2012 21:45:32 GMT</pubDate>
    <dc:creator>InfoAlisaA</dc:creator>
    <dc:date>2012-10-04T21:45:32Z</dc:date>
    <item>
      <title>Stuck on an Infile</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Stuck-on-an-Infile/m-p/86396#M24677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; This is the raw data file that I am trying to infile:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;J. Mitchell&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Very Well done!&amp;nbsp; Rating:5&lt;/P&gt;&lt;P&gt;Amy Jung&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rating:4&lt;/P&gt;&lt;P&gt;Carl Heisman&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rating:4&lt;/P&gt;&lt;P&gt;Linda Deal&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Not enough give aways&amp;nbsp; Rating:3&lt;/P&gt;&lt;P&gt;Gabrielle Heron&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Nice! Rating:4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Not helpful at all Rating:2&lt;/P&gt;&lt;P&gt;Kyle Patterson&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Very good. Need more like it&amp;nbsp; Rating:5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see, there are a lot of variables that have different lengths.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the program that I have so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data seminar_ratings;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile 'G:\hw_data\seminar.dat';&lt;/P&gt;&lt;P&gt;&amp;nbsp; input Name &amp;amp; $ 1-17 @19 Comment &amp;amp; $28.&amp;nbsp; @'Rating:' Rating;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print data=seminar_ratings;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue that I am having is that the entries that have no comments are having the Ratings read in as comments.&lt;/P&gt;&lt;P&gt;I am really stuck as to what I should do so I have blank comments instead of the Ratings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could someone look at my code and let me know what I should do in this situation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2012 21:45:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Stuck-on-an-Infile/m-p/86396#M24677</guid>
      <dc:creator>InfoAlisaA</dc:creator>
      <dc:date>2012-10-04T21:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Stuck on an Infile</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Stuck-on-an-Infile/m-p/86397#M24678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can correct it either when inputting or after the fact.&amp;nbsp; One way to do it after the fact might be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data seminar_ratings;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; infile 'G:\hw_data\seminar.dat';&lt;/P&gt;&lt;P&gt;&amp;nbsp; input Name &amp;amp; $ 1-17 @19 Comment &amp;amp; $28.&amp;nbsp; @'Rating:' Rating;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if index(comment,'Rating:') gt 0 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if index(comment,'Rating:') gt 2 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; comment=substr(comment,1,index(comment,'Rating:')-1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else call missing(comment);&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2012 22:59:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Stuck-on-an-Infile/m-p/86397#M24678</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-10-04T22:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Stuck on an Infile</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Stuck-on-an-Infile/m-p/86398#M24679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Arthur,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Thank you for the feedback on this.&lt;/P&gt;&lt;P&gt; Unfortunately, I have to do this without substr and indexes.&lt;/P&gt;&lt;P&gt; If you have another suggestion, that would be great!&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;Alisa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2012 01:25:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Stuck-on-an-Infile/m-p/86398#M24679</guid>
      <dc:creator>InfoAlisaA</dc:creator>
      <dc:date>2012-10-05T01:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Stuck on an Infile</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Stuck-on-an-Infile/m-p/86399#M24680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it a homework assignment?&amp;nbsp; Otherwise use the method that works and is clear.&lt;/P&gt;&lt;P&gt;If you can contact the person that created the file ask them to switch the location of the rating and the comment so that the variable information is at the end of the line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;J. Mitchell&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Very Well done!&amp;nbsp; Rating:5&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Amy Jung&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rating:4&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Carl Heisman&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rating:4&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Linda Deal&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Not enough give aways&amp;nbsp; Rating:3&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Gabrielle Heron&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Nice! Rating:4&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Not helpful at all Rating:2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Kyle Patterson&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Very good. Need more like it&amp;nbsp; Rating:5&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data want ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; infile 'xxx' truncover ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; input name $17. @;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; length rating 8 comment $100 word $100 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; do until (word in: (' ' , 'Rating:') ) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input word @ ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if word not in: (' ', 'Rating:') then comment=catx(' ',comment,word);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; input @1 @'Rating:' rating;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; drop word;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2012 14:14:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Stuck-on-an-Infile/m-p/86399#M24680</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-10-05T14:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Stuck on an Infile</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Stuck-on-an-Infile/m-p/86400#M24681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the data source file type? It may be that you can use or create a delimiter when saving the data such as in a CSV format which will allow better read control.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2012 17:14:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Stuck-on-an-Infile/m-p/86400#M24681</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-10-05T17:14:53Z</dc:date>
    </item>
  </channel>
</rss>

