<?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: Using In=variable to create a permanent variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-In-variable-to-create-a-permanent-variable/m-p/571092#M161078</link>
    <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jul 2019 21:00:19 GMT</pubDate>
    <dc:creator>ChuksManuel</dc:creator>
    <dc:date>2019-07-03T21:00:19Z</dc:date>
    <item>
      <title>Using In=variable to create a permanent variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-In-variable-to-create-a-permanent-variable/m-p/571080#M161073</link>
      <description>&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two datasets A&amp;nbsp; and B. A is a baseline dataset and B is the death dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to merge using the "In= " to select only Ids that are in dataset A.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then also in the merge i want to create a flag using "in=" to determine that the patient died.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help will be appreciated.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data forty;
merge sleep2(in=x) three (in=y);
if in=x then died=y;
run;
proc print; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jul 2019 20:23:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-In-variable-to-create-a-permanent-variable/m-p/571080#M161073</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2019-07-03T20:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using In=variable to create a permanent variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-In-variable-to-create-a-permanent-variable/m-p/571084#M161076</link>
      <description>&lt;P&gt;data forty;&lt;BR /&gt;merge sleep2(in=x) three (in=y);&lt;/P&gt;&lt;P&gt;by id;&lt;BR /&gt;if in=x then died=y;&lt;BR /&gt;run;&lt;BR /&gt;proc print; run;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 20:27:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-In-variable-to-create-a-permanent-variable/m-p/571084#M161076</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2019-07-03T20:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using In=variable to create a permanent variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-In-variable-to-create-a-permanent-variable/m-p/571089#M161077</link>
      <description>&lt;P&gt;Some code like below should do.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  merge A(in=ina) B (in=inb);
  by id;
  /* only select rows with an ID in table A */
  if ina;
  /* set died_flg='Y' if a matching ID in table B */
  if inb then
    died_flg='Y';
  else died_flg='N';
run;

proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jul 2019 20:41:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-In-variable-to-create-a-permanent-variable/m-p/571089#M161077</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-07-03T20:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using In=variable to create a permanent variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-In-variable-to-create-a-permanent-variable/m-p/571092#M161078</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 21:00:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-In-variable-to-create-a-permanent-variable/m-p/571092#M161078</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2019-07-03T21:00:19Z</dc:date>
    </item>
  </channel>
</rss>

