<?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: use &amp;quot;if&amp;quot; than &amp;quot;where&amp;quot; to select a certain type of variable in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/use-quot-if-quot-than-quot-where-quot-to-select-a-certain-type/m-p/440314#M4722</link>
    <description>&lt;P&gt;It works!&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May I understand why the "Set" command is needed here?&lt;/P&gt;&lt;P&gt;I thought I missed "then do;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
    <pubDate>Mon, 26 Feb 2018 19:35:56 GMT</pubDate>
    <dc:creator>jc3992</dc:creator>
    <dc:date>2018-02-26T19:35:56Z</dc:date>
    <item>
      <title>use "if" than "where" to select a certain type of variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/use-quot-if-quot-than-quot-where-quot-to-select-a-certain-type/m-p/440306#M4719</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 
 data style; 
 infile '/folders/myfolders/Artists.dat'; 
 input Name $ 1-21 Genre $ 23-40 Origin $42; 
 run; 
  
 data style; 
 if Genre = 'Impressionism' ; 
 run; 
 proc print data=style; 
 run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I used this code to try to print out only when "Genre= Impressionism"and the LOG is as below.&lt;/P&gt;&lt;P&gt;I wonder if anyone can help me modifying this to make it work out?&lt;/P&gt;&lt;P&gt;I did not see what has went wrong.&lt;/P&gt;&lt;P&gt;Thank you:)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 72         
 73          data style;
 74          infile '/folders/myfolders/Artists.dat';
 75          input Name $ 1-21 Genre $ 23-40 Origin $42;
 76          run;
 
 NOTE: The infile '/folders/myfolders/Artists.dat' is:
       Filename=/folders/myfolders/Artists.dat,
       Owner Name=sasdemo,Group Name=sas,
       Access Permission=-rw-rw-r--,
       Last Modified=09Feb2018:21:01:38,
       File Size (bytes)=306
 
 NOTE: 7 records were read from the infile '/folders/myfolders/Artists.dat'.
       The minimum record length was 42.
       The maximum record length was 42.
 NOTE: The data set WORK.STYLE has 7 observations and 3 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.01 seconds
       cpu time            0.01 seconds
       
 
 77         
 78          data style;
 79          if Genre = 'Impressionism' ;
 80          run;
 
 NOTE: Variable Genre is uninitialized.
 NOTE: The data set WORK.STYLE has 0 observations and 1 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 81          proc print data=style;
 82          run;
 
 NOTE: No observations in data set WORK.STYLE.
 NOTE: PROCEDURE PRINT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 83         
 84         
 85         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 98         &lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Feb 2018 19:21:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/use-quot-if-quot-than-quot-where-quot-to-select-a-certain-type/m-p/440306#M4719</guid>
      <dc:creator>jc3992</dc:creator>
      <dc:date>2018-02-26T19:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: use "if" than "where" to select a certain type of variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/use-quot-if-quot-than-quot-where-quot-to-select-a-certain-type/m-p/440307#M4720</link>
      <description>&lt;P&gt;You are missing set statement to read the input dataset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;style&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; 
 &lt;SPAN class="token statement"&gt;infile&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'/folders/myfolders/Artists.dat'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; 
 &lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; Name &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;-21&lt;/SPAN&gt; Genre &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;23&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;-40&lt;/SPAN&gt; Origin &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;42&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; 
 &lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; 
  
 &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;style&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;BR /&gt;set style;/*you missed this*/
 &lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; Genre &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'Impressionism'&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; 
 &lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; 
 &lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;print&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;style&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; 
 &lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Feb 2018 19:22:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/use-quot-if-quot-than-quot-where-quot-to-select-a-certain-type/m-p/440307#M4720</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-02-26T19:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: use "if" than "where" to select a certain type of variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/use-quot-if-quot-than-quot-where-quot-to-select-a-certain-type/m-p/440310#M4721</link>
      <description>&lt;P&gt;I thought of that.&lt;/P&gt;&lt;P&gt;Thank you I will give a try!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 19:26:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/use-quot-if-quot-than-quot-where-quot-to-select-a-certain-type/m-p/440310#M4721</guid>
      <dc:creator>jc3992</dc:creator>
      <dc:date>2018-02-26T19:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: use "if" than "where" to select a certain type of variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/use-quot-if-quot-than-quot-where-quot-to-select-a-certain-type/m-p/440314#M4722</link>
      <description>&lt;P&gt;It works!&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May I understand why the "Set" command is needed here?&lt;/P&gt;&lt;P&gt;I thought I missed "then do;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 19:35:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/use-quot-if-quot-than-quot-where-quot-to-select-a-certain-type/m-p/440314#M4722</guid>
      <dc:creator>jc3992</dc:creator>
      <dc:date>2018-02-26T19:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: use "if" than "where" to select a certain type of variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/use-quot-if-quot-than-quot-where-quot-to-select-a-certain-type/m-p/440316#M4723</link>
      <description>&lt;P&gt;In your 1st step, you read a raw(external data) data to create a dataset called style. In your 2nd step, your objective is/was to filter the dataset style using if or where. So, you need to use/read/ that dataset in some way. The set statement basically reads records of the style dataset and your if filters it and the data statement creates a new dataset style yet again&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 19:38:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/use-quot-if-quot-than-quot-where-quot-to-select-a-certain-type/m-p/440316#M4723</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-02-26T19:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: use "if" than "where" to select a certain type of variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/use-quot-if-quot-than-quot-where-quot-to-select-a-certain-type/m-p/440321#M4724</link>
      <description>&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;Now I understand what it means by "reading in the SAS data set" in my handout.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 19:54:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/use-quot-if-quot-than-quot-where-quot-to-select-a-certain-type/m-p/440321#M4724</guid>
      <dc:creator>jc3992</dc:creator>
      <dc:date>2018-02-26T19:54:30Z</dc:date>
    </item>
  </channel>
</rss>

