<?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: which statement works in infile statement in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/which-statement-works-in-infile-statement/m-p/866269#M38303</link>
    <description>&lt;P&gt;The answer is there:&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n1xbr9r0s9veq0n137iftzxq4g7e.htm" target="_blank" rel="noopener"&gt;WHERE Statement&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You only have to&amp;nbsp;&lt;STRONG&gt;READ&lt;/STRONG&gt;.&lt;/P&gt;</description>
    <pubDate>Sat, 25 Mar 2023 08:28:22 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2023-03-25T08:28:22Z</dc:date>
    <item>
      <title>which statement works in infile statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/which-statement-works-in-infile-statement/m-p/866260#M38298</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
infile "/home/u35263349/if.txt";
input name$ city$ ;&lt;BR /&gt;if city='hyderabad' ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;1.which statement works&amp;nbsp; if statetment or where statement in infile statement read the external source data&lt;/P&gt;
&lt;P&gt;please find below attachment txt.file&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 05:34:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/which-statement-works-in-infile-statement/m-p/866260#M38298</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2023-03-25T05:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: which statement works in infile statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/which-statement-works-in-infile-statement/m-p/866261#M38299</link>
      <description>&lt;P&gt;If you run this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data a;
infile "/home/u35263349/if.txt";
input name$ city$ ;
run;&lt;/PRE&gt;
&lt;P&gt;You will see that the value in the data is read as "hyderaba". The length is 8 characters because when you&amp;nbsp; use Input city $; SAS defaults to reading 8 characters. You need to provide an informat longer than 8 OR tell SAS the variable should be longer. So you did not have the value long enough to match your If condition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This uses an informat to read City as a 10 character variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data a;
infile "/home/u35263349/if.txt";
input name$ city :$10. ;
run;
&lt;/PRE&gt;
&lt;P&gt;This sets the length of Name and City to 10 characters when read:&lt;/P&gt;
&lt;PRE&gt;data a;
infile "/home/u35263349/if.txt";
length name city $10;
input name$ city $ ;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 05:47:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/which-statement-works-in-infile-statement/m-p/866261#M38299</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-03-25T05:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: which statement works in infile statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/which-statement-works-in-infile-statement/m-p/866262#M38300</link>
      <description>You need IF, not WHERE.&lt;BR /&gt;The IF statement can be used by any DATA step.&lt;BR /&gt;The WHERE statement requires that the incoming data is already a SAS data set.  Since your source of incoming data is text and not a SAS data set, you cannot use WHERE.</description>
      <pubDate>Sat, 25 Mar 2023 07:11:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/which-statement-works-in-infile-statement/m-p/866262#M38300</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2023-03-25T07:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: which statement works in infile statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/which-statement-works-in-infile-statement/m-p/866263#M38301</link>
      <description>&lt;P&gt;which statement works in infile statement &lt;STRONG&gt;IF or where&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 07:18:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/which-statement-works-in-infile-statement/m-p/866263#M38301</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2023-03-25T07:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: which statement works in infile statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/which-statement-works-in-infile-statement/m-p/866264#M38302</link>
      <description>IF.&lt;BR /&gt;Not WHERE.</description>
      <pubDate>Sat, 25 Mar 2023 07:26:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/which-statement-works-in-infile-statement/m-p/866264#M38302</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2023-03-25T07:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: which statement works in infile statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/which-statement-works-in-infile-statement/m-p/866269#M38303</link>
      <description>&lt;P&gt;The answer is there:&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n1xbr9r0s9veq0n137iftzxq4g7e.htm" target="_blank" rel="noopener"&gt;WHERE Statement&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You only have to&amp;nbsp;&lt;STRONG&gt;READ&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 08:28:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/which-statement-works-in-infile-statement/m-p/866269#M38303</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-25T08:28:22Z</dc:date>
    </item>
  </channel>
</rss>

