<?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: SET STATEMENT in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102966#M28818</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess I should have also asked whether you mean you want the data appended or merged ... I wasnt clear from your description.&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Oct 2013 17:34:36 GMT</pubDate>
    <dc:creator>esjackso</dc:creator>
    <dc:date>2013-10-03T17:34:36Z</dc:date>
    <item>
      <title>SET STATEMENT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102963#M28815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;How can i combine these two datasets into a single step but giving me the same OUTPUT as when i do them seperately&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want1(keep=flag ID PLACEMENT);&lt;BR /&gt;set have(keep=ID&amp;nbsp; PLACEMENT);&lt;BR /&gt;if ("&amp;amp;start"D &amp;lt;=PLACEMENT &amp;lt;= "&amp;amp;end"D)&lt;BR /&gt;flag="IN";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want2(keep=flag ID REMOVAL);&lt;BR /&gt;set have(keep=ID REMOVAL);&lt;BR /&gt;if ("&amp;amp;start"D &amp;lt;=REMOVAL &amp;lt;= "&amp;amp;end"D)&lt;BR /&gt;flag="OUT";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally i want to set the PLACEMENT and REMOVAL under ONE variable and flag will be the identifier&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 17:11:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102963#M28815</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-10-03T17:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: SET STATEMENT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102964#M28816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does the method matter? Data step vs sql?&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 17:19:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102964#M28816</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-10-03T17:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: SET STATEMENT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102965#M28817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data step should be OK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 17:26:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102965#M28817</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-10-03T17:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: SET STATEMENT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102966#M28818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess I should have also asked whether you mean you want the data appended or merged ... I wasnt clear from your description.&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 17:34:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102966#M28818</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-10-03T17:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: SET STATEMENT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102967#M28819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. The Placement and REMOVAL data needs to be appended under a single variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 17:37:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102967#M28819</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-10-03T17:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: SET STATEMENT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102968#M28820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I dont have a easy way to test this but something like the following should work (may have to play with the variable name in the where statements and you might have to break the where into two separate statements ... ie .... and placement &amp;lt;= "&amp;amp;end"D &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data want (keep=flag id onevar);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length flag $3;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have (in=a rename=(placement=onevar) where=(&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;"&amp;amp;start"D &amp;lt;=PLACEMENT &amp;lt;= "&amp;amp;end"D&lt;/SPAN&gt;))&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; have (in=b &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;rename=(removal=onevar) where=(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;"&amp;amp;start"D &amp;lt;=removal &amp;lt;= "&amp;amp;end"D&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if a then flag = "IN";&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if b then flag = "OUT";&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Hopefully this at least puts you on the right track.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 17:45:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102968#M28820</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-10-03T17:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: SET STATEMENT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102969#M28821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am doing like this and both my output datasets have zero records..&lt;/P&gt;&lt;P&gt;i am not able to figure out where i am going wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data out(keep=flag id REMOVAL)&lt;/P&gt;&lt;P&gt;IN(keep=flag id&amp;nbsp; PLACEMENT);&lt;/P&gt;&lt;P&gt;set have(keep=id PLACEMENT REMOVAL value);&lt;/P&gt;&lt;P&gt;IF ("&amp;amp;start"D &amp;lt;= REMOVAL &amp;lt;= "&amp;amp;end"D) and value in('270' '2701' '2703' '27033') THEN DO;&lt;BR /&gt;FLAG="OUT";&lt;/P&gt;&lt;P&gt;OUTPUT out;&lt;BR /&gt;END;&lt;/P&gt;&lt;P&gt;IF ("&amp;amp;start"D &amp;lt;= PLACEMENT&amp;lt;= "&amp;amp;end"D) and FLO_MEAS_ID in('270' '2701' '2703' '27033') THEN DO;&lt;BR /&gt;FLAG="IN";&lt;/P&gt;&lt;P&gt;OUTPUT IN;&lt;BR /&gt;END;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 18:06:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102969#M28821</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-10-03T18:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: SET STATEMENT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102970#M28822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The smaller issue is the use of VALUE vs. FLO_MEAS_ID.&amp;nbsp; That might just be a typo in posting your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The bigger issue is that no observations satisfy the IF conditions.&amp;nbsp; You'll have to inspect your data to find out why.&amp;nbsp; A likely possibility is that REMOVAL and PLACEMENT contain datetime values, rather than date values.&amp;nbsp; If that's the case, you would have to apply the DATEPART function to them in order to compare them to dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 18:31:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102970#M28822</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-10-03T18:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: SET STATEMENT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102971#M28823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Astounding.&lt;/P&gt;&lt;P&gt;I forgot to put the datepart. and as u mentioned they are datetime values..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so very much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 18:37:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SET-STATEMENT/m-p/102971#M28823</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-10-03T18:37:45Z</dc:date>
    </item>
  </channel>
</rss>

