<?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: Data pull based on flag value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-pull-based-on-flag-value/m-p/579936#M164684</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data dat1;
 input id $ flag $ new zz;
 cards;
a Y 12 111
b  . 22 222/*see the correction for period in place of missing values*/
c  . 33 333/*see the correction for period in place of missing values*/
 ;
 run;


 proc sql; 
        create table pilot as 
select id, 'Y' as flag,new ,zz
     from dat1 
      	  where flag ne 'Y'; 
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 08 Aug 2019 16:32:55 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2019-08-08T16:32:55Z</dc:date>
    <item>
      <title>Data pull based on flag value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-pull-based-on-flag-value/m-p/579934#M164683</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to select all observations where flag is not equal to 'Y' in the previously and set those to Y in the current data pull. It felt like a simple logic, but I don't seem to be getting the right answer. Appreciate the help in helping me understand what am I doing wrong here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Input data provided in code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected output:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capturee.PNG" style="width: 374px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31595iCF56A0EA5CA6ADEC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capturee.PNG" alt="Capturee.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output received:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capturee.PNG" style="width: 373px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31594i82FAA2EA0AB6215A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capturee.PNG" alt="Capturee.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my code&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dat1;
 input id $ flag $ new zz;
 cards;
a Y 12 111
b   22 222
c   33 333
 ;
 run;


 proc sql; 
        create table pilot as 
select *, 'Y' as flag
     from dat1 
      	  where flag neq 'Y'; 
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 16:26:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-pull-based-on-flag-value/m-p/579934#M164683</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-08-08T16:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Data pull based on flag value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-pull-based-on-flag-value/m-p/579936#M164684</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data dat1;
 input id $ flag $ new zz;
 cards;
a Y 12 111
b  . 22 222/*see the correction for period in place of missing values*/
c  . 33 333/*see the correction for period in place of missing values*/
 ;
 run;


 proc sql; 
        create table pilot as 
select id, 'Y' as flag,new ,zz
     from dat1 
      	  where flag ne 'Y'; 
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Aug 2019 16:32:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-pull-based-on-flag-value/m-p/579936#M164684</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-08T16:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Data pull based on flag value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-pull-based-on-flag-value/m-p/579938#M164685</link>
      <description>That made it work but isn't char missing value represented by blank and not a '.'? flag is defined as a char here so why are we representing that as a period.</description>
      <pubDate>Thu, 08 Aug 2019 16:37:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-pull-based-on-flag-value/m-p/579938#M164685</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-08-08T16:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: Data pull based on flag value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-pull-based-on-flag-value/m-p/579939#M164686</link>
      <description>&lt;P&gt;Those values before being read are "RAW" data and not a SAS data set value. basically to read raw data instream with a list input you would need to have periods in punch raw cards data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS Your definition holds true for default missing values in a dataset&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 16:42:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-pull-based-on-flag-value/m-p/579939#M164686</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-08T16:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Data pull based on flag value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-pull-based-on-flag-value/m-p/579940#M164687</link>
      <description>&lt;P&gt;The thread could lead to discussion about "how to read raw data" which is out of scope for the stated objective, but I recommend reading those concepts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could read the same data &lt;STRONG&gt;as- is&lt;/STRONG&gt; with a formatted input&amp;nbsp; to see the difference&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dat1;
 input id $ @3 flag $1. new zz;
 cards;
a Y 12 111
b   22 222
c   33 333
 ;
 run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Aug 2019 16:45:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-pull-based-on-flag-value/m-p/579940#M164687</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-08T16:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Data pull based on flag value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-pull-based-on-flag-value/m-p/579943#M164688</link>
      <description>that makes sense. Thank you!&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Aug 2019 16:59:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-pull-based-on-flag-value/m-p/579943#M164688</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-08-08T16:59:22Z</dc:date>
    </item>
  </channel>
</rss>

