<?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: Proc Print ID when flag=1 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542519#M149910</link>
    <description>Look at the log! If you don't understand the log, post it here using the {i} icon to preserve formatting.</description>
    <pubDate>Tue, 12 Mar 2019 17:43:18 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2019-03-12T17:43:18Z</dc:date>
    <item>
      <title>Proc Print ID when flag=1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542494#M149898</link>
      <description>&lt;P&gt;Hi!&amp;nbsp; I'm trying to find the unique identifiers that correspond to when the flag variable I made=1.&amp;nbsp; I haven't been able to find a way to write a proc print of ID if flag=1? I basically want a list of the IDs when flag=1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample Data:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Flag&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Enterprise Guide will not allow this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=clean2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; where Flag=1;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 17:35:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542494#M149898</guid>
      <dc:creator>jmmedina25</dc:creator>
      <dc:date>2019-03-12T17:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Print ID when flag=1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542496#M149899</link>
      <description>&lt;P&gt;Are you seriously asking how to write a &lt;STRONG&gt;where statemen&lt;/STRONG&gt;t in proc print?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID            Flag ;
cards;
1                1
2                0
3                0
4                1
;
proc print;
where flag=1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Mar 2019 16:59:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542496#M149899</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-12T16:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Print ID when flag=1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542504#M149902</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=have;
   where flag=1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Mar 2019 17:11:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542504#M149902</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-03-12T17:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Print ID when flag=1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542513#M149905</link>
      <description>&lt;P&gt;No. I'm asking because I only want the ID to print (there are a dozen other variables) and this code will not run:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=clean2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; var ID;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; where flag=1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or even this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=clean2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; where flag=1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A 'where' statement is not compatible with the proc print command.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 17:32:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542513#M149905</guid>
      <dc:creator>jmmedina25</dc:creator>
      <dc:date>2019-03-12T17:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Print ID when flag=1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542514#M149906</link>
      <description>&lt;P&gt;This is in Enterprise Guide, which may be why.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 17:33:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542514#M149906</guid>
      <dc:creator>jmmedina25</dc:creator>
      <dc:date>2019-03-12T17:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Print ID when flag=1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542516#M149907</link>
      <description>&lt;P&gt;This code will not run in Enterprise Guide; not sure why?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 17:36:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542516#M149907</guid>
      <dc:creator>jmmedina25</dc:creator>
      <dc:date>2019-03-12T17:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Print ID when flag=1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542517#M149908</link>
      <description>&lt;P&gt;What does your log say?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 17:36:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542517#M149908</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-03-12T17:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Print ID when flag=1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542518#M149909</link>
      <description>&lt;P&gt;Both of these programs are perfectly fine, whether using EG or not.&amp;nbsp; Here are some issues to look for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is FLAG actually a character variable?&amp;nbsp; Then you would need to use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where flag="1";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does FLAG exist in CLEAN2 or was it created and then dropped?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 17:36:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542518#M149909</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-03-12T17:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Print ID when flag=1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542519#M149910</link>
      <description>Look at the log! If you don't understand the log, post it here using the {i} icon to preserve formatting.</description>
      <pubDate>Tue, 12 Mar 2019 17:43:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542519#M149910</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-03-12T17:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Print ID when flag=1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542521#M149911</link>
      <description>&lt;P&gt;Thank you, I actually just realized that for the flag variable I was running there were no flags that=1, they were all =0, therefore there was no output.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 17:45:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542521#M149911</guid>
      <dc:creator>jmmedina25</dc:creator>
      <dc:date>2019-03-12T17:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Print ID when flag=1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542522#M149912</link>
      <description>&lt;P&gt;Thanks, it wasn't working because there were no values of the flag variable that=1, they all =0.&amp;nbsp; Still confused why the code was red but whatever.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 17:47:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Print-ID-when-flag-1/m-p/542522#M149912</guid>
      <dc:creator>jmmedina25</dc:creator>
      <dc:date>2019-03-12T17:47:10Z</dc:date>
    </item>
  </channel>
</rss>

