<?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 statment and &amp;quot;in=&amp;quot; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334882#M75674</link>
    <description>&lt;P&gt;If you use a BY statement with multiple data sets in the SET statement then you're interleaving data sets not appending.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/basess/68381/HTML/default/viewer.htm#n16kf2ntmiovx8n1ifnby1b7lhyf.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/68381/HTML/default/viewer.htm#n16kf2ntmiovx8n1ifnby1b7lhyf.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/basess/68381/HTML/default/viewer.htm#n16kf2ntmiovx8n1ifnby1b7lhyf.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/68381/HTML/default/viewer.htm#n16kf2ntmiovx8n1ifnby1b7lhyf.htm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Feb 2017 10:47:50 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-02-22T10:47:50Z</dc:date>
    <item>
      <title>set statment and "in="</title>
      <link>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334874#M75668</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to combine 2 datasets without sorting them, just add a flag to identify where each row coming from.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have put together the following code but of course it won't work as (in=a) style syntax in not valid for set statement. A simple solution would be great and much appreciated&lt;/P&gt;
&lt;PRE&gt;	data output;
	set table_a  (in=a)  
	    table_b (in=b);
	
	format from $1.;
	if a then from='A' ; 
          else if b then from='B';

	run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;BR /&gt;Jack&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 10:37:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334874#M75668</guid>
      <dc:creator>J_CKY</dc:creator>
      <dc:date>2017-02-22T10:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: set statment and "in="</title>
      <link>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334875#M75669</link>
      <description>&lt;P&gt;I have added a line&lt;/P&gt;
&lt;PRE&gt;set ... ;

by ID;

format ... ;&lt;/PRE&gt;
&lt;P&gt;and it seems working fine.&amp;nbsp; But I am not sure if that works because of the dataset has been sorted or not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can someone give me a firm answer? Much appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Jack&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 10:41:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334875#M75669</guid>
      <dc:creator>J_CKY</dc:creator>
      <dc:date>2017-02-22T10:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: set statment and "in="</title>
      <link>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334876#M75670</link>
      <description>&lt;P&gt;INDSNAME option.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data want;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;set a b INDSNAME=_source;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;source=_source;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 10:41:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334876#M75670</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-22T10:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: set statment and "in="</title>
      <link>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334877#M75671</link>
      <description>&lt;P&gt;There's something else wrong with your code - IN is valid in SET.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would check your log carefully and ensure your data matches what you expect.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/ledsoptsref/69751/HTML/default/viewer.htm#n1p1o2dsuc465nn198ovwdrj9mvy.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/ledsoptsref/69751/HTML/default/viewer.htm#n1p1o2dsuc465nn198ovwdrj9mvy.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 10:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334877#M75671</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-22T10:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: set statment and "in="</title>
      <link>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334878#M75672</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't see any reason why your program shouldn't work (except maybe the use of&lt;/P&gt;
&lt;P&gt;the reserved word "FROM" for a variable id but that should not be a problem here).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran it without error.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 10:45:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334878#M75672</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2017-02-22T10:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: set statment and "in="</title>
      <link>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334881#M75673</link>
      <description>Thanks all, &lt;BR /&gt;&lt;BR /&gt;I think it works after I added the "by statement"&lt;BR /&gt;&lt;BR /&gt;May be that's all it needs. I will check again.</description>
      <pubDate>Wed, 22 Feb 2017 10:46:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334881#M75673</guid>
      <dc:creator>J_CKY</dc:creator>
      <dc:date>2017-02-22T10:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: set statment and "in="</title>
      <link>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334882#M75674</link>
      <description>&lt;P&gt;If you use a BY statement with multiple data sets in the SET statement then you're interleaving data sets not appending.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/basess/68381/HTML/default/viewer.htm#n16kf2ntmiovx8n1ifnby1b7lhyf.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/68381/HTML/default/viewer.htm#n16kf2ntmiovx8n1ifnby1b7lhyf.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/basess/68381/HTML/default/viewer.htm#n16kf2ntmiovx8n1ifnby1b7lhyf.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/68381/HTML/default/viewer.htm#n16kf2ntmiovx8n1ifnby1b7lhyf.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 10:47:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334882#M75674</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-22T10:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: set statment and "in="</title>
      <link>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334883#M75675</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; has the correct idea. &amp;nbsp;What Iwould ask is two questions:&lt;/P&gt;
&lt;P&gt;What does "combine two datasets", do you mean set one under the other as combine can mean various things.&lt;/P&gt;
&lt;P&gt;Also, what does your data actually contain which a) requires multiple datasets which are the same, and b) has some informatioon in the dataset name which is not in the data? &amp;nbsp;Sounds like a bad setup to start up with.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 10:48:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334883#M75675</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-02-22T10:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: set statment and "in="</title>
      <link>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334891#M75679</link>
      <description>&lt;P&gt;Thanks for all the input. I think it was just me wrote some crap code and failed the first time round.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 11:34:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/set-statment-and-quot-in-quot/m-p/334891#M75679</guid>
      <dc:creator>J_CKY</dc:creator>
      <dc:date>2017-02-22T11:34:31Z</dc:date>
    </item>
  </channel>
</rss>

