<?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: Dummy Variables To Identify A Data Set Later in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Dummy-Variables-To-Identify-A-Data-Set-Later/m-p/402246#M66835</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/170214"&gt;@VincentLe&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Using data set options &lt;EM&gt;in=&lt;/EM&gt; or &lt;EM&gt;indsname=&lt;/EM&gt; are very valid options and both will work.&lt;/P&gt;
&lt;P&gt;As an alternative code as below should do the job as well.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table want as
    select *, 'ds1' as source
    from sashelp.class
    union corr all
    select *, 'ds2' as source
    from sashelp.class
    ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 09 Oct 2017 01:18:48 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2017-10-09T01:18:48Z</dc:date>
    <item>
      <title>Dummy Variables To Identify A Data Set Later</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Dummy-Variables-To-Identify-A-Data-Set-Later/m-p/402124#M66813</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Before I combine 2 data sets, NLSY79 and NLSY97 together, I want to create dummy variables indicating which data NLSY79 is and which NLSY97 is. How do I create these dummy variable for each of these data set? Any idea is appreciated. Have a great day!&lt;/P&gt;&lt;P&gt;Vincent.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Oct 2017 22:55:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Dummy-Variables-To-Identify-A-Data-Set-Later/m-p/402124#M66813</guid>
      <dc:creator>VincentLe</dc:creator>
      <dc:date>2017-10-07T22:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Dummy Variables To Identify A Data Set Later</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Dummy-Variables-To-Identify-A-Data-Set-Later/m-p/402126#M66814</link>
      <description>&lt;P&gt;It depends how you want to combine them - do you want to merge them or append them?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would be helpful if you could give samples of the input and output data sets...&lt;/P&gt;</description>
      <pubDate>Sat, 07 Oct 2017 23:55:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Dummy-Variables-To-Identify-A-Data-Set-Later/m-p/402126#M66814</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-10-07T23:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Dummy Variables To Identify A Data Set Later</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Dummy-Variables-To-Identify-A-Data-Set-Later/m-p/402128#M66815</link>
      <description>&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;Thank you for your response. I just want to append (stack) one on another.&lt;/P&gt;&lt;P&gt;Here is an example. The first input data set is NLSY79 that has 25 original variables. The second input data set is NLSY97 that has 25 original variables. So I would run: Data NLSY79andNLSY97; Set NLSY79 NLSY97;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output data is NLSY79andNLSY97.&lt;/P&gt;&lt;P&gt;However, after combining these 2 data sets, I'd like to&amp;nbsp;run a logistic model on both data set with a&amp;nbsp;interaction term to be added on NLSY97 only. So I need to give SAS a signal that add an interaction term on NLSY97 only and not on both. That is why I need dummy variables that identify NLSY97 before I combine it with NLSY79. But I don't know who to make those dummy variables on each data set.&lt;/P&gt;&lt;P&gt;I hope this make it clearer. If not, I can explain more.&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Oct 2017 00:12:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Dummy-Variables-To-Identify-A-Data-Set-Later/m-p/402128#M66815</guid>
      <dc:creator>VincentLe</dc:creator>
      <dc:date>2017-10-08T00:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dummy Variables To Identify A Data Set Later</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Dummy-Variables-To-Identify-A-Data-Set-Later/m-p/402129#M66816</link>
      <description>&lt;P&gt;INDSNAME option, example and documentation here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=lestmtsref&amp;amp;docsetTarget=p00hxg3x8lwivcn1f0e9axziw57y.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p00fwyxqcqptpcn10ivxt1r470q1" target="_blank"&gt;http://documentation.sas.com/?docsetId=lestmtsref&amp;amp;docsetTarget=p00hxg3x8lwivcn1f0e9axziw57y.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p00fwyxqcqptpcn10ivxt1r470q1&lt;/A&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/170214"&gt;@VincentLe&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;Before I combine 2 data sets, NLSY79 and NLSY97 together, I want to create dummy variables indicating which data NLSY79 is and which NLSY97 is. How do I create these dummy variable for each of these data set? Any idea is appreciated. Have a great day!&lt;/P&gt;
&lt;P&gt;Vincent.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Oct 2017 00:13:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Dummy-Variables-To-Identify-A-Data-Set-Later/m-p/402129#M66816</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-08T00:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Dummy Variables To Identify A Data Set Later</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Dummy-Variables-To-Identify-A-Data-Set-Later/m-p/402131#M66817</link>
      <description>&lt;P&gt;Thank for your link, but it doesn't tell me how to create dummy variables to identify data set later.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Oct 2017 00:23:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Dummy-Variables-To-Identify-A-Data-Set-Later/m-p/402131#M66817</guid>
      <dc:creator>VincentLe</dc:creator>
      <dc:date>2017-10-08T00:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dummy Variables To Identify A Data Set Later</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Dummy-Variables-To-Identify-A-Data-Set-Later/m-p/402133#M66818</link>
      <description>&lt;P&gt;Simplest would be to take your program, and add the pieces in &lt;FONT color="#ff0000"&gt;red&lt;/FONT&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;data NLSY79andNLSY97;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;set NLSY79 NLSY97 &lt;FONT color="#ff0000"&gt;(in=flag_these)&lt;/FONT&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#ff0000"&gt;from_NLSY97 = flag_these&lt;/FONT&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;run;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Oct 2017 01:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Dummy-Variables-To-Identify-A-Data-Set-Later/m-p/402133#M66818</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-10-08T01:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dummy Variables To Identify A Data Set Later</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Dummy-Variables-To-Identify-A-Data-Set-Later/m-p/402134#M66819</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/170214"&gt;@VincentLe&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank for your link, but it doesn't tell me how to create dummy variables to identify data set later.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Did your run the sample code and look at the output?&lt;/P&gt;</description>
      <pubDate>Sun, 08 Oct 2017 01:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Dummy-Variables-To-Identify-A-Data-Set-Later/m-p/402134#M66819</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-08T01:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dummy Variables To Identify A Data Set Later</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Dummy-Variables-To-Identify-A-Data-Set-Later/m-p/402246#M66835</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/170214"&gt;@VincentLe&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Using data set options &lt;EM&gt;in=&lt;/EM&gt; or &lt;EM&gt;indsname=&lt;/EM&gt; are very valid options and both will work.&lt;/P&gt;
&lt;P&gt;As an alternative code as below should do the job as well.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table want as
    select *, 'ds1' as source
    from sashelp.class
    union corr all
    select *, 'ds2' as source
    from sashelp.class
    ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Oct 2017 01:18:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Dummy-Variables-To-Identify-A-Data-Set-Later/m-p/402246#M66835</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-10-09T01:18:48Z</dc:date>
    </item>
  </channel>
</rss>

