<?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: Proc SQL and Merge in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-and-Merge/m-p/72842#M21115</link>
    <description>Why do you want to remove this message, It is only NOTE message,not WARNING or  ERROR message.&lt;BR /&gt;
If you do not want to see these NOTE message,you can try to use " options nonotes; "&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
    <pubDate>Tue, 07 Jun 2011 08:21:26 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2011-06-07T08:21:26Z</dc:date>
    <item>
      <title>Proc SQL and Merge</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-and-Merge/m-p/72837#M21110</link>
      <description>I want to create same output with these datalines by merge statment and Proc Sql ....&lt;BR /&gt;
&lt;BR /&gt;
While doing mergeing I get the note: The Merge statement has one dataset with repeats of By variable...with correct output and in Proc Sql it gives me cartesian product...&lt;BR /&gt;
&lt;BR /&gt;
is there any alternate way apart from these two..??? Please guide on this ..&lt;BR /&gt;
&lt;BR /&gt;
data abc;&lt;BR /&gt;
	input pt subj $ trt $;&lt;BR /&gt;
	&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 111-22 trt&lt;BR /&gt;
1 111-22 wew&lt;BR /&gt;
1 111-33 fgd&lt;BR /&gt;
2 111-22 bdb&lt;BR /&gt;
2 111-22 fgd&lt;BR /&gt;
2 111-33 dfg&lt;BR /&gt;
2 111-33 fsa&lt;BR /&gt;
2 111-33 bvb&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data xyz;&lt;BR /&gt;
	input pt subj $ vis ;&lt;BR /&gt;
	&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 111-22 2&lt;BR /&gt;
1 111-22 3&lt;BR /&gt;
1 111-33 2&lt;BR /&gt;
2 111-22 1&lt;BR /&gt;
2 111-22 1&lt;BR /&gt;
2 111-33 2&lt;BR /&gt;
2 111-33 7&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=abc nodup ;&lt;BR /&gt;
	by pt subj;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=xyz nodup;&lt;BR /&gt;
	by pt subj;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data lmn;&lt;BR /&gt;
	merge abc(in=a) xyz(in=b);&lt;BR /&gt;
	by pt subj ;&lt;BR /&gt;
	if a and b;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
**********************************Alternate method***********************************;&lt;BR /&gt;
proc sql;&lt;BR /&gt;
	select distinct abc.*,vis from abc inner join  xyz &lt;BR /&gt;
&lt;BR /&gt;
		on abc.pt=xyz.pt and abc.subj=xyz.subj group by abc.pt , abc.subj;&lt;BR /&gt;
quit;</description>
      <pubDate>Mon, 06 Jun 2011 11:32:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-and-Merge/m-p/72837#M21110</guid>
      <dc:creator>alwaz_searching</dc:creator>
      <dc:date>2011-06-06T11:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL and Merge</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-and-Merge/m-p/72838#M21111</link>
      <description>Hello Alwaz,&lt;BR /&gt;
&lt;BR /&gt;
It is not completely clear to me what would you like to achieve. If you write NODUPKEY instead of NODUP then duplicate by groups will be eliminated from ABC and XYZ and merge will not generate any warnings. Is it your intention?&lt;BR /&gt;
&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Mon, 06 Jun 2011 15:11:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-and-Merge/m-p/72838#M21111</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2011-06-06T15:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL and Merge</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-and-Merge/m-p/72839#M21112</link>
      <description>Ya, that's right but it 'll remove the third variable's values also....</description>
      <pubDate>Mon, 06 Jun 2011 16:41:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-and-Merge/m-p/72839#M21112</guid>
      <dc:creator>alwaz_searching</dc:creator>
      <dc:date>2011-06-06T16:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL and Merge</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-and-Merge/m-p/72840#M21113</link>
      <description>What ouput do you want to look like?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Tue, 07 Jun 2011 02:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-and-Merge/m-p/72840#M21113</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-06-07T02:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL and Merge</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-and-Merge/m-p/72841#M21114</link>
      <description>Below is the desired output but it comes with the usual note of the merge statement of repeats of by variable values in log.&lt;BR /&gt;
&lt;BR /&gt;
How can I remove it?&lt;BR /&gt;
&lt;BR /&gt;
pt               subj         trt           vis&lt;BR /&gt;
&lt;BR /&gt;
1	111-22	trt	2&lt;BR /&gt;
1	111-22	wew	3&lt;BR /&gt;
1	111-33	fgd	2&lt;BR /&gt;
2	111-22	bdb	1&lt;BR /&gt;
2	111-22	fgd	1&lt;BR /&gt;
2	111-33	dfg	2&lt;BR /&gt;
2	111-33	fsa	7&lt;BR /&gt;
2	111-33	bvb	7</description>
      <pubDate>Tue, 07 Jun 2011 06:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-and-Merge/m-p/72841#M21114</guid>
      <dc:creator>alwaz_searching</dc:creator>
      <dc:date>2011-06-07T06:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL and Merge</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-and-Merge/m-p/72842#M21115</link>
      <description>Why do you want to remove this message, It is only NOTE message,not WARNING or  ERROR message.&lt;BR /&gt;
If you do not want to see these NOTE message,you can try to use " options nonotes; "&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Tue, 07 Jun 2011 08:21:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-and-Merge/m-p/72842#M21115</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-06-07T08:21:26Z</dc:date>
    </item>
  </channel>
</rss>

