<?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: How do you correctly put more than one variable in the same where statement? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795237#M255044</link>
    <description>Thank you for your reply! I removed the quotes, and I produced the table as well. I see the combinations that I want in the table, so I guess the WHERE statement wasn't the issue like I thought.</description>
    <pubDate>Wed, 09 Feb 2022 17:26:07 GMT</pubDate>
    <dc:creator>tainaj</dc:creator>
    <dc:date>2022-02-09T17:26:07Z</dc:date>
    <item>
      <title>How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795197#M255030</link>
      <description>&lt;P&gt;I tried to subset my data using WHERE and IF statements, so I can run a Proc Means statement from it, but the log is saying that there are no observations in the data set.&lt;/P&gt;&lt;P&gt;I am sure that there are other issues with my SAS code, but I believe that the where statement might be the biggest issue. The data I am using is publicly available. It is large so I can't attach it to this message, but it could be downloaded here: &lt;A href="https://osf.io/7h9ux/" target="_blank"&gt;https://osf.io/7h9ux/&lt;/A&gt; (Name is Race IAT 2016). I attached the codebook to this message just in case.&amp;nbsp; Please let me know if you need more information!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS code:&lt;/P&gt;&lt;P&gt;proc import out=work.IAT2016_raw&lt;BR /&gt;datafile="C:\Users\tjoseph6\Documents\My SAS Files\IAT2016.sav"&lt;BR /&gt;dbms=sav replace;&lt;BR /&gt;run;&lt;BR /&gt;data IAT2016;&lt;BR /&gt;set work.IAT2016_raw (keep=year birthyear sex_5 raceomb_002 D_biep_White_Good_all countrycit occupation_self politicalid_7);&lt;BR /&gt;Age=year-birthyear;&lt;BR /&gt;where countrycit eq 'US' &amp;amp; occupation_self in ('29-1000','31-1000') &amp;amp; sex_5 in (1,2);&lt;BR /&gt;if D_biep_White_Good_all ne .;&lt;BR /&gt;if politicalid_7 eq "." then delete;&lt;BR /&gt;if Age lt 16 then delete;&lt;BR /&gt;if raceomb_002 eq "." then delete;&lt;BR /&gt;label sex_5='Gender'&lt;BR /&gt;raceomb_002='Race'&lt;BR /&gt;D_biep_White_Good_all='Overall IAT D Score'&lt;BR /&gt;politicalid_7='Political Ideology Spectrum'&lt;BR /&gt;occupation_self='Occupation'&lt;BR /&gt;countrycit='Country';&lt;BR /&gt;run;&lt;BR /&gt;proc contents data=IAT2016;&lt;BR /&gt;run;&lt;BR /&gt;proc means data=IAT2016;&lt;BR /&gt;class occupation_self;&lt;BR /&gt;var D_biep_White_Good_all;&lt;BR /&gt;output out = Summary&lt;BR /&gt;mean =&lt;BR /&gt;n = / autoname;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOG:&lt;/P&gt;&lt;P&gt;43 proc import out=work.IAT2016_raw&lt;BR /&gt;44 datafile="C:\Users\tjoseph6\Documents\My SAS Files\IAT2016.sav"&lt;BR /&gt;45 dbms=sav replace;&lt;BR /&gt;46 run;&lt;/P&gt;&lt;P&gt;NOTE: Variable Name Change. D_biep.White_Good_all -&amp;gt; D_biep_White_Good_all&lt;BR /&gt;NOTE: Variable Name Change. D_biep.White_Good_36 -&amp;gt; D_biep_White_Good_36&lt;BR /&gt;NOTE: Variable Name Change. D_biep.White_Good_47 -&amp;gt; D_biep_White_Good_47&lt;BR /&gt;NOTE: One or more variables were converted because the data type is not supported by the V9 engine.&lt;BR /&gt;For more details, run with options MSGLEVEL=I.&lt;BR /&gt;NOTE: The import data set has 1051105 observations and 534 variables.&lt;BR /&gt;NOTE: WORK.IAT2016_RAW data set was successfully created.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;real time 1:05.95&lt;BR /&gt;cpu time 23.67 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;47 data IAT2016;&lt;BR /&gt;48 set work.IAT2016_raw (keep=year birthyear sex_5 raceomb_002 D_biep_White_Good_all countrycit&lt;BR /&gt;48 ! occupation_self politicalid_7);&lt;BR /&gt;49 Age=year-birthyear;&lt;BR /&gt;50 where countrycit eq 'US' &amp;amp; occupation_self in ('29-1000','31-1000') &amp;amp; sex_5 in (1,2);&lt;BR /&gt;51 if D_biep_White_Good_all ne .;&lt;BR /&gt;52 if politicalid_7 eq "." then delete;&lt;BR /&gt;53 if Age lt 16 then delete;&lt;BR /&gt;54 if raceomb_002 eq "." then delete;&lt;BR /&gt;55 label sex_5='Gender'&lt;BR /&gt;56 raceomb_002='Race'&lt;BR /&gt;57 D_biep_White_Good_all='Overall IAT D Score'&lt;BR /&gt;58 politicalid_7='Political Ideology Spectrum'&lt;BR /&gt;59 occupation_self='Occupation'&lt;BR /&gt;60 countrycit='Country';&lt;BR /&gt;61 run;&lt;/P&gt;&lt;P&gt;NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).&lt;BR /&gt;52:21 54:19&lt;BR /&gt;NOTE: There were 0 observations read from the data set WORK.IAT2016_RAW.&lt;BR /&gt;WHERE (countrycit='US') and occupation_self in ('29-1000', '31-1000') and sex_5 in (1, 2);&lt;BR /&gt;NOTE: The data set WORK.IAT2016 has 0 observations and 9 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 35.62 seconds&lt;BR /&gt;cpu time 8.03 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;62 proc contents data=IAT2016;&lt;BR /&gt;63 run;&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE CONTENTS used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;cpu time 0.04 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;64 proc means data=IAT2016;&lt;BR /&gt;65 class occupation_self;&lt;BR /&gt;66 var D_biep_White_Good_all;&lt;BR /&gt;67 output out = Summary&lt;BR /&gt;68 mean =&lt;BR /&gt;69 n = / autoname;&lt;BR /&gt;70 run;&lt;/P&gt;&lt;P&gt;NOTE: No observations in data set WORK.IAT2016.&lt;BR /&gt;NOTE: The data set WORK.SUMMARY has 0 observations and 5 variables.&lt;BR /&gt;NOTE: PROCEDURE MEANS used (Total process time):&lt;BR /&gt;real time 0.05 seconds&lt;BR /&gt;cpu time 0.04 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 15:49:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795197#M255030</guid>
      <dc:creator>tainaj</dc:creator>
      <dc:date>2022-02-09T15:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795202#M255031</link>
      <description>&lt;P&gt;Some of us refuse to download Excel files because they are a security risk. We also encourage not to visit unknown web sites.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I can't see your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't see any syntax errors in your WHERE statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where countrycit eq 'US' &amp;amp; occupation_self in ('29-1000','31-1000') &amp;amp; sex_5 in (1,2);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;this looks fine, so the problem is that you are not finding any matching records, and so the next step is for YOU to LOOK AT the data in data set &lt;SPAN&gt;work.IAT2016_raw&amp;nbsp;&lt;/SPAN&gt;with your own eyes, and see what the reason is for the mismatch.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 16:01:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795202#M255031</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-09T16:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795204#M255032</link>
      <description>&lt;P&gt;I apologize as I did not think of this, and the file downloads into a zip file but I still wasn't able to upload that because of the size. I'll try to see if compressing it myself will work somehow. I have looked at the original data multiple times. I also ran proc contents to look at the type as well. I even tried using other similar variables as well too but I still came up with the same result. The data that I tried to subset shows no observations so I can't really match it up to the original. Hopefully, I will be able to post the data somehow as I am at a complete loss.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 16:14:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795204#M255032</guid>
      <dc:creator>tainaj</dc:creator>
      <dc:date>2022-02-09T16:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795209#M255035</link>
      <description>&lt;P&gt;Show us a portion (say the first 20 rows, and only the variables in the WHERE statement) of the SAS data set (not the Excel file) by following &lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;these instructions&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UPDATE: Include the variables mentioned by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 16:28:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795209#M255035</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-09T16:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795210#M255036</link>
      <description>&lt;P&gt;This from your log indicates some misunderstanding of your data or code:&lt;/P&gt;
&lt;PRE&gt;52 if politicalid_7 eq "." then delete;
53 if Age lt 16 then delete;
54 if raceomb_002 eq "." then delete;&lt;/PRE&gt;
&lt;P&gt;The note associated with lines 52 and 54 are that the varaibles are numeric. So the . should not be in quotes.&lt;/P&gt;
&lt;P&gt;Or save some possible headaches with variable types and use: If missing(variable) then ....&amp;nbsp; The Missing function uses the correct interpretation for both numeric and character variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can check combinations of values that actually appear in your data with Proc Freq fairly easily.&lt;/P&gt;
&lt;PRE&gt;Proc freq data= work.IAT2016_raw;
   tables countrycit*occupation_sel*sex_5 / list missing;
run;&lt;/PRE&gt;
&lt;P&gt;This may make a long table but will show all the combinations, including missing values for the variables on your where statement. If you do not see the value combination you request on WHERE then that is your answer to the where issue.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 16:26:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795210#M255036</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-02-09T16:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795227#M255041</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-02-09 at 11.57.40.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68315i5FE5BB6130879262/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-02-09 at 11.57.40.png" alt="Screen Shot 2022-02-09 at 11.57.40.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-02-09 at 12.04.39.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68316iE4E4FD971B21479F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-02-09 at 12.04.39.png" alt="Screen Shot 2022-02-09 at 12.04.39.png" /&gt;&lt;/span&gt;Sorry for the delay! I had trouble with the steps. This is the output of the first 20 without the WHERE and IF statements.&amp;nbsp; I created the Age variable which is why the year and birthyear are added here as well. I posted the contents too just in case!&lt;/P&gt;
&lt;P&gt;Update: Also, I originally used raceomb_002 instead of raceomb in my original post by accident (both variables are in the dataset but there are no observations under raceomb_002). This did not change my output though when I changed it to the correct variable for Race.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 17:16:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795227#M255041</guid>
      <dc:creator>tainaj</dc:creator>
      <dc:date>2022-02-09T17:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795237#M255044</link>
      <description>Thank you for your reply! I removed the quotes, and I produced the table as well. I see the combinations that I want in the table, so I guess the WHERE statement wasn't the issue like I thought.</description>
      <pubDate>Wed, 09 Feb 2022 17:26:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795237#M255044</guid>
      <dc:creator>tainaj</dc:creator>
      <dc:date>2022-02-09T17:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795238#M255045</link>
      <description>&lt;P&gt;So, in these 20 records, are the conditions of the where statement met so that the record will be in the output data set? I pose this as a question for you to figure out and answer, given what you have showed us. Explain your answer.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 17:27:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795238#M255045</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-09T17:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795245#M255050</link>
      <description>&lt;P&gt;No not in the first 20, but I ran the frequency table that was written by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; and I found the combinations in which the conditions of the WHERE (along with the IF) statement would be met. What I need are individuals that identify as Male and Female that are US Citizens (shows as 1 in the output), and are either Healthcare - Nursing and Home Health Assistants or Healthcare - Diagnosing and Treating Practitioners (MD, Dentist, etc.). I find this combination in the frequency table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm going to try to run it with only the WHERE statements (so I will omit the IF statements) as I think that was the issue all along!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 17:39:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795245#M255050</guid>
      <dc:creator>tainaj</dc:creator>
      <dc:date>2022-02-09T17:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795247#M255052</link>
      <description>&lt;P&gt;It still says no observations. I am completely out of ideas. Please let me know if anyone has an idea or might have a clue about what is going wrong!&lt;/P&gt;
&lt;P&gt;Also, I can't compress the data further to upload here since the zip file is already at 157MB.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 17:52:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795247#M255052</guid>
      <dc:creator>tainaj</dc:creator>
      <dc:date>2022-02-09T17:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795254#M255058</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/400535"&gt;@tainaj&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;No not in the first 20, but I ran the frequency table that was written by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; and I found the combinations in which the conditions of the WHERE (along with the IF) statement would be met. What I need are individuals that identify as Male and Female that are US Citizens (shows as 1 in the output), and are either Healthcare - Nursing and Home Health Assistants or Healthcare - Diagnosing and Treating Practitioners (MD, Dentist, etc.). I find this combination in the frequency table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm going to try to run it with only the WHERE statements (so I will omit the IF statements) as I think that was the issue all along!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show us this output from PROC FREQ (part of it, so we can see records that should pass the WHERE statement)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;one of the reasons why we have very specific instructions that we would like you to follow to show us the data (and I guess we need more than 20 rows) is because of the formats applied to the variables in the WHERE statement. We still need you to provide the data (more than 20 rows, I guess) following the instructions given.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 18:00:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795254#M255058</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-09T18:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795264#M255060</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-02-09 at 13.01.15.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68327iA9964A7BC2E1AD7C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-02-09 at 13.01.15.png" alt="Screen Shot 2022-02-09 at 13.01.15.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-02-09 at 13.01.35.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68328iADD05EF947BBBAC6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-02-09 at 13.01.35.png" alt="Screen Shot 2022-02-09 at 13.01.35.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the results from the frequency table! Maybe I didn't follow the steps correctly if it didn't show what you needed to see. I downloaded the data2datastep from that instruction page, and I ran it. Then, I ran my data with the variables you stated to show. I'll copy and paste what I did in a second!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Update: here is the log statement showing what I ran below&lt;/P&gt;
&lt;P&gt;471 select memlabel&lt;BR /&gt;------&lt;BR /&gt;180&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;472 into :memlabel trimmed&lt;BR /&gt;473 from dictionary.tables&lt;BR /&gt;474 where libname="&amp;amp;lib"&lt;BR /&gt;WARNING: Apparent symbolic reference LIB not resolved.&lt;BR /&gt;475 and memname="&amp;amp;dsn"&lt;BR /&gt;WARNING: Apparent symbolic reference DSN not resolved.&lt;BR /&gt;476 ;&lt;/P&gt;
&lt;P&gt;WARNING: Apparent symbolic reference FMT not resolved.&lt;BR /&gt;WARNING: Argument 2 to macro function %QSUBSTR is out of range.&lt;BR /&gt;WARNING: Argument 3 to macro function %QSUBSTR is out of range.&lt;BR /&gt;477 %if %qsubstr(%superq(fmt),1,1)=Y %then %do;&lt;BR /&gt;478 select strip(catx(' ',Name,format))&lt;BR /&gt;479 into :fmtlist separated by ' '&lt;BR /&gt;480 from dictionary.columns&lt;BR /&gt;481 where libname="&amp;amp;lib"&lt;BR /&gt;482 and memname="&amp;amp;dsn"&lt;BR /&gt;483 and format is not null&lt;BR /&gt;484 and format not like '$%'&lt;BR /&gt;485 ;&lt;BR /&gt;486 %end;&lt;BR /&gt;487 %else %let fmtlist=;&lt;BR /&gt;488 quit;&lt;BR /&gt;489&lt;BR /&gt;490 %put _local_;&lt;BR /&gt;491&lt;BR /&gt;492 data _null_;&lt;BR /&gt;493 file "&amp;amp;file" dsd;&lt;BR /&gt;WARNING: Apparent symbolic reference FILE not resolved.&lt;BR /&gt;WARNING: Apparent symbolic reference FILE not resolved.&lt;BR /&gt;494 if _n_ =1 then do;&lt;BR /&gt;495 %if %superq(memlabel)= %then %do;&lt;BR /&gt;ERROR: Nesting of %IF statements in open code is not supported. %IF ignored.&lt;BR /&gt;ERROR: Skipping to next %END statement.&lt;BR /&gt;496 put "data &amp;amp;outlib..&amp;amp;dsn;";&lt;BR /&gt;WARNING: Apparent symbolic reference OUTLIB not resolved.&lt;BR /&gt;WARNING: Apparent symbolic reference DSN not resolved.&lt;BR /&gt;497 %end;&lt;BR /&gt;498 %else %do;&lt;BR /&gt;ERROR: The %ELSE statement is not valid in open code.&lt;BR /&gt;WARNING: Apparent symbolic reference OUTLIB not resolved.&lt;BR /&gt;WARNING: Apparent symbolic reference DSN not resolved.&lt;BR /&gt;499 put "data &amp;amp;outlib..&amp;amp;dsn(label=%tslit(%superq(memlabel)));";&lt;BR /&gt;WARNING: Apparent symbolic reference OUTLIB not resolved.&lt;BR /&gt;WARNING: Apparent symbolic reference DSN not resolved.&lt;BR /&gt;WARNING: Apparent symbolic reference MEMLABEL not resolved.&lt;BR /&gt;WARNING: Apparent symbolic reference OUTLIB not resolved.&lt;BR /&gt;WARNING: Apparent symbolic reference DSN not resolved.&lt;BR /&gt;ERROR: The %END statement is not valid in open code.&lt;BR /&gt;WARNING: Apparent symbolic reference INPUTLIST not resolved.&lt;BR /&gt;500 %end;&lt;BR /&gt;501 put @3 "infile datalines dsd truncover;";&lt;BR /&gt;502 put @3 "input %superq(inputlist);";&lt;BR /&gt;503 %if not (%superq(fmtlist)=) %then %do;&lt;BR /&gt;504 put @3 "format %superq(fmtlist);";&lt;BR /&gt;505 %end;&lt;BR /&gt;506 %if not (%superq(lbllist)=) %then %do;&lt;BR /&gt;WARNING: Apparent symbolic reference LBLLIST not resolved.&lt;BR /&gt;507 put @3 "label %superq(lbllist);";&lt;BR /&gt;508 %end;&lt;BR /&gt;509 put "datalines4;";&lt;BR /&gt;510 end;&lt;BR /&gt;511 set &amp;amp;lib..&amp;amp;dsn(obs=&amp;amp;obs) end=last;&lt;BR /&gt;-&lt;BR /&gt;22&lt;BR /&gt;200&lt;BR /&gt;WARNING: Apparent symbolic reference LIB not resolved.&lt;BR /&gt;WARNING: Apparent symbolic reference DSN not resolved.&lt;BR /&gt;511 set &amp;amp;lib..&amp;amp;dsn(obs=&amp;amp;obs) end=last;&lt;BR /&gt;-&lt;BR /&gt;22&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, ;, CUROBS, END,&lt;BR /&gt;INDSNAME, KEY, KEYRESET, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.&lt;/P&gt;
&lt;P&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/P&gt;
&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,&lt;BR /&gt;a numeric constant, a datetime constant, a missing value, bitstring, INPUT, PUT.&lt;/P&gt;
&lt;P&gt;ERROR: Undeclared array referenced: dsn.&lt;BR /&gt;WARNING: Apparent symbolic reference OBS not resolved.&lt;BR /&gt;511 set &amp;amp;lib..&amp;amp;dsn(obs=&amp;amp;obs) end=last;&lt;BR /&gt;---&lt;BR /&gt;22&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: +, =.&lt;/P&gt;
&lt;P&gt;ERROR: Variable dsn has not been declared as an array.&lt;BR /&gt;512 put &amp;amp;varlist @;&lt;BR /&gt;-&lt;BR /&gt;22&lt;BR /&gt;WARNING: Apparent symbolic reference VARLIST not resolved.&lt;BR /&gt;ERROR 22-322: Expecting a name.&lt;/P&gt;
&lt;P&gt;513 if last then do;&lt;BR /&gt;514 put;&lt;BR /&gt;515 put ';;;;';&lt;BR /&gt;516 end;&lt;BR /&gt;517 else put;&lt;BR /&gt;518 run;&lt;/P&gt;
&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.14 seconds&lt;BR /&gt;cpu time 0.11 seconds&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;ERROR: No matching %MACRO statement for this %MEND statement.&lt;BR /&gt;519 %mend;&lt;/P&gt;
&lt;P&gt;520 proc import out=work.IAT2016_raw&lt;BR /&gt;521 datafile="C:\Users\tjoseph6\Documents\My SAS Files\IAT2016.sav"&lt;BR /&gt;522 dbms=sav replace;&lt;BR /&gt;523 run;&lt;/P&gt;
&lt;P&gt;NOTE: Variable Name Change. D_biep.White_Good_all -&amp;gt; D_biep_White_Good_all&lt;BR /&gt;NOTE: Variable Name Change. D_biep.White_Good_36 -&amp;gt; D_biep_White_Good_36&lt;BR /&gt;NOTE: Variable Name Change. D_biep.White_Good_47 -&amp;gt; D_biep_White_Good_47&lt;BR /&gt;NOTE: One or more variables were converted because the data type is not supported by the V9 engine.&lt;BR /&gt;For more details, run with options MSGLEVEL=I.&lt;BR /&gt;NOTE: The import data set has 1051105 observations and 534 variables.&lt;BR /&gt;NOTE: WORK.IAT2016_RAW data set was successfully created.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;real time 1:14.25&lt;BR /&gt;cpu time 27.12 seconds&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;524 data IAT2016;&lt;BR /&gt;525 set work.IAT2016_raw (keep=year birthyear sex_5 raceomb D_biep_White_Good_all countrycit&lt;BR /&gt;525! occupation_self politicalid_7);&lt;BR /&gt;526 Age=year-birthyear;&lt;/P&gt;
&lt;P&gt;NOTE: Missing values were generated as a result of performing an operation on missing values.&lt;BR /&gt;Each place is given by: (Number of times) at (Line):(Column).&lt;BR /&gt;454843 at 526:9&lt;BR /&gt;NOTE: There were 1051105 observations read from the data set WORK.IAT2016_RAW.&lt;BR /&gt;NOTE: The data set WORK.IAT2016 has 1051105 observations and 9 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 39.02 seconds&lt;BR /&gt;cpu time 11.54 seconds&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;527 proc print data=IAT2016 (obs=20);&lt;BR /&gt;528 run;&lt;/P&gt;
&lt;P&gt;NOTE: There were 20 observations read from the data set WORK.IAT2016.&lt;BR /&gt;NOTE: PROCEDURE PRINT used (Total process time):&lt;BR /&gt;real time 0.07 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;529 proc import out=work.IAT2016_raw&lt;BR /&gt;530 datafile="C:\Users\tjoseph6\Documents\My SAS Files\IAT2016.sav"&lt;BR /&gt;531 dbms=sav replace;&lt;BR /&gt;532 run;&lt;/P&gt;
&lt;P&gt;NOTE: Variable Name Change. D_biep.White_Good_all -&amp;gt; D_biep_White_Good_all&lt;BR /&gt;NOTE: Variable Name Change. D_biep.White_Good_36 -&amp;gt; D_biep_White_Good_36&lt;BR /&gt;NOTE: Variable Name Change. D_biep.White_Good_47 -&amp;gt; D_biep_White_Good_47&lt;BR /&gt;NOTE: One or more variables were converted because the data type is not supported by the V9 engine.&lt;BR /&gt;For more details, run with options MSGLEVEL=I.&lt;BR /&gt;NOTE: The import data set has 1051105 observations and 534 variables.&lt;BR /&gt;NOTE: WORK.IAT2016_RAW data set was successfully created.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;real time 1:11.29&lt;BR /&gt;cpu time 27.11 seconds&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 18:30:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795264#M255060</guid>
      <dc:creator>tainaj</dc:creator>
      <dc:date>2022-02-09T18:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795265#M255061</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/400535"&gt;@tainaj&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thank you for your reply! I removed the quotes, and I produced the table as well. I see the combinations that I want in the table, so I guess the WHERE statement wasn't the issue like I thought.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You have a very possible issue with the actual value of your occupation variable vs the formatted value. The proc contents shows that you have a custom format assigned. So while proc print, freq or opening the table may show values like '29-1000' the actual value used with IN as you have written the code would use the unformatted value.&lt;/P&gt;
&lt;P&gt;Try this to use the formatted value.&lt;/P&gt;
&lt;PRE&gt;&amp;amp; put( occupation_self,$ocuppaa. ) in ('29-1000','31-1000') &lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Feb 2022 18:17:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795265#M255061</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-02-09T18:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795276#M255066</link>
      <description>I ran it with this change and it says there are no observations unfortunately: &lt;BR /&gt;612  proc import out=work.IAT2016_raw&lt;BR /&gt;613  datafile="C:\Users\tjoseph6\Documents\My SAS Files\IAT2016.sav"&lt;BR /&gt;614  dbms=sav replace;&lt;BR /&gt;615  run;&lt;BR /&gt;&lt;BR /&gt;NOTE:    Variable Name Change.  D_biep.White_Good_all -&amp;gt; D_biep_White_Good_all&lt;BR /&gt;NOTE:    Variable Name Change.  D_biep.White_Good_36 -&amp;gt; D_biep_White_Good_36&lt;BR /&gt;NOTE:    Variable Name Change.  D_biep.White_Good_47 -&amp;gt; D_biep_White_Good_47&lt;BR /&gt;NOTE: One or more variables were converted because the data type is not supported by the V9 engine.&lt;BR /&gt;      For more details, run with options MSGLEVEL=I.&lt;BR /&gt;NOTE: The import data set has 1051105 observations and 534 variables.&lt;BR /&gt;NOTE: WORK.IAT2016_RAW data set was successfully created.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;      real time           1:10.06&lt;BR /&gt;      cpu time            27.01 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;616  data IAT2016;&lt;BR /&gt;617  set work.IAT2016_raw (keep=year birthyear sex_5 raceomb D_biep_White_Good_all countrycit&lt;BR /&gt;617! occupation_self politicalid_7);&lt;BR /&gt;618  Age=year-birthyear;&lt;BR /&gt;619  where countrycit eq 'US' &amp;amp; put( occupation_self,$OCCUPAA. ) in ('29-1000','31-1000') &amp;amp; sex_5 in&lt;BR /&gt;619! (1,2);&lt;BR /&gt;620  if D_biep_White_Good_all ne .;&lt;BR /&gt;621  if politicalid_7 eq . then delete;&lt;BR /&gt;622  if Age lt 16 then delete;&lt;BR /&gt;623  if raceomb eq . then delete;&lt;BR /&gt;624  label sex_5='Gender'&lt;BR /&gt;625  raceomb='Race'&lt;BR /&gt;626  D_biep_White_Good_all='Overall IAT D Score'&lt;BR /&gt;627  politicalid_7='Political Ideology Spectrum'&lt;BR /&gt;628  occupation_self='Occupation'&lt;BR /&gt;629  countrycit='Country';&lt;BR /&gt;630  run;&lt;BR /&gt;&lt;BR /&gt;NOTE: There were 0 observations read from the data set WORK.IAT2016_RAW.&lt;BR /&gt;      WHERE (countrycit='US') and PUT(occupation_self, $OCCUPAA79.) in ('29-1000', '31-1000') and&lt;BR /&gt;      sex_5 in (1, 2);&lt;BR /&gt;NOTE: The data set WORK.IAT2016 has 0 observations and 9 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;      real time           39.06 seconds&lt;BR /&gt;      cpu time            9.03 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;631  proc contents data=IAT2016;&lt;BR /&gt;632  run;&lt;BR /&gt;&lt;BR /&gt;NOTE: PROCEDURE CONTENTS used (Total process time):&lt;BR /&gt;      real time           0.03 seconds&lt;BR /&gt;      cpu time            0.04 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;633  proc means data=IAT2016;&lt;BR /&gt;634       class occupation_self;&lt;BR /&gt;635       var D_biep_White_Good_all;&lt;BR /&gt;636       output out  = Summary&lt;BR /&gt;637              mean =&lt;BR /&gt;638              n    = / autoname;&lt;BR /&gt;639  format occupation_self $OCCUPAA.;&lt;BR /&gt;640    run;&lt;BR /&gt;&lt;BR /&gt;NOTE: No observations in data set WORK.IAT2016.&lt;BR /&gt;NOTE: The data set WORK.SUMMARY has 0 observations and 5 variables.&lt;BR /&gt;NOTE: PROCEDURE MEANS used (Total process time):&lt;BR /&gt;      real time           0.08 seconds&lt;BR /&gt;      cpu time            0.04 seconds&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Feb 2022 18:39:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795276#M255066</guid>
      <dc:creator>tainaj</dc:creator>
      <dc:date>2022-02-09T18:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795282#M255067</link>
      <description>&lt;P&gt;Now run the PROC FREQ again, but with this modification&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc freq data= work.IAT2016_raw;
   tables countrycit*occupation_sel*sex_5 / list missing;
   format occupation_sel sex_5;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and show us the records in the output that you think should pass the filter.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 18:50:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795282#M255067</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-09T18:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795294#M255069</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-02-09 at 13.55.42.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68334iC08FC383AB0DFC89/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-02-09 at 13.55.42.png" alt="Screen Shot 2022-02-09 at 13.55.42.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-02-09 at 13.55.53.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68333iD4D219B890F7A9EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-02-09 at 13.55.53.png" alt="Screen Shot 2022-02-09 at 13.55.53.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-02-09 at 13.52.07.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68335i54F34231ACE0CF92/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-02-09 at 13.52.07.png" alt="Screen Shot 2022-02-09 at 13.52.07.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I ran the proc frequency table that you provided, and these are the ones that fall under what I am looking for. I also printed the data up to 60 observations, and number 46 shows the observations that should fall under the WHERE and IF subsets I tried to run.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 19:03:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795294#M255069</guid>
      <dc:creator>tainaj</dc:creator>
      <dc:date>2022-02-09T19:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795305#M255074</link>
      <description>Does anyone have any idea as to why my WHERE and IF statements are causing it to show no observations?</description>
      <pubDate>Wed, 09 Feb 2022 19:43:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795305#M255074</guid>
      <dc:creator>tainaj</dc:creator>
      <dc:date>2022-02-09T19:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795308#M255077</link>
      <description>&lt;P&gt;I'm almost certain that the problem has to do with the formats applied to these variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I don't think you ran the PROC FREQ with the modifications I suggested. Did you? (If you did, show me the log for this PROC FREQ so I can see all the code of PROC FREQ in the log and all of the notes, warnings and error for PROC&amp;nbsp; FREQ)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you did run the code exactly as I provided it, then you will never get&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;sex_5 in (1,2)&lt;/FONT&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I urge you (for the third time) to provide the data using the instructions given, and then we should be able to determine the answer quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 20:04:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795308#M255077</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-09T20:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795311#M255079</link>
      <description>I truly do appreciate your help, but I copied and pasted the exact proc freq that you posted and that was the result I received. If you think there is something I am doing wrong please let me know. Also, I previously stated to please let me know if I am doing the instructions wrong as well, and I posted the log statement of what I did to show you in hopes of you letting me know if it was in fact the incorrect way of doing it. &lt;BR /&gt;I am by no means a SAS expert so I personally don't know exactly what the data2datastep does/did even after reading it in the instructions, but what I did is how I understood the instructions with my limited knowledge. I will try to provide the data a third time with the same instructions, but I apologize if I still do it wrong.</description>
      <pubDate>Wed, 09 Feb 2022 20:13:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795311#M255079</guid>
      <dc:creator>tainaj</dc:creator>
      <dc:date>2022-02-09T20:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correctly put more than one variable in the same where statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795312#M255080</link>
      <description>&lt;P&gt;So it looks like you are converting some SPSS data.&lt;/P&gt;
&lt;P&gt;From your earlier posting&amp;nbsp;&lt;SPAN&gt;occupation_self is a character variable of length 7 that has the format $OCCUPAA. permanently&amp;nbsp;attached.&amp;nbsp; The values you need to use in the WHERE or IF statements are the values actually stored in the variable, not the way those values print when the format is used to convert them.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also you posted images of what the output looks like from PROC FREQ.&amp;nbsp; So the strings displayed there are definitely longer than 7 bytes, so you are seeing the formatted values and not the real values.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PLUS you posted images of the output when sent to HTML (or some other "fancy" ODS output) instead of the output from the plain old text LISTING destination.&amp;nbsp; That can also be confusing because those ODS destinations to not properly display values that have leading spaces.&amp;nbsp; When you compare the values in your WHERE or IF statements leading spaces are significant.&amp;nbsp; So COUNTRYCIT is defined to be four bytes long.&amp;nbsp; Which means that these three values would all look the same in your ODS printout.&amp;nbsp; &amp;nbsp;Only the first one will match your WHERE condition.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;'US'
' US'
'  US'&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Feb 2022 20:14:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-correctly-put-more-than-one-variable-in-the-same/m-p/795312#M255080</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-02-09T20:14:51Z</dc:date>
    </item>
  </channel>
</rss>

