<?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: help in coding in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/help-in-coding/m-p/26525#M6068</link>
    <description>Thanks everyone for your help ! I really appreciate you guys.</description>
    <pubDate>Mon, 24 May 2010 23:40:53 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-05-24T23:40:53Z</dc:date>
    <item>
      <title>help in coding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-in-coding/m-p/26521#M6064</link>
      <description>I've a dataset similar to:&lt;BR /&gt;
A  B     C     D&lt;BR /&gt;
a1 b1 red       .&lt;BR /&gt;
a1 b1 blue     .&lt;BR /&gt;
a1 b1 gren     .&lt;BR /&gt;
a1 b1 yellow 123&lt;BR /&gt;
a1 b2  white  .&lt;BR /&gt;
a1 b2 red      .&lt;BR /&gt;
a1 b2 blue    .&lt;BR /&gt;
a1 b2 green 456&lt;BR /&gt;
a1 b2 white  .&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I am looking for output similar to :&lt;BR /&gt;
&lt;BR /&gt;
A  B     C     D&lt;BR /&gt;
a1 b1  red      123&lt;BR /&gt;
a1 b1  blue     123&lt;BR /&gt;
a1 b1  gren     123&lt;BR /&gt;
a1 b1  yellow  123&lt;BR /&gt;
a1 b2  white    456&lt;BR /&gt;
a1 b2  red       456&lt;BR /&gt;
a1 b2  blue     456&lt;BR /&gt;
a1 b2  green   456&lt;BR /&gt;
a1 b2  white   456&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Sun, 23 May 2010 21:27:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-in-coding/m-p/26521#M6064</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-05-23T21:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: help in coding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-in-coding/m-p/26522#M6065</link>
      <description>Consider using PROC SQL with a JOIN or use DATA step (with sorted input files) and the MERGE with a BY statement.  Check the SAS DOC or you can find useful reference material at the SAS support  &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website.&lt;BR /&gt;
&lt;BR /&gt;
Also, you need only post in one (1) forum for this type of query.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.

Message was edited by: sbb</description>
      <pubDate>Sun, 23 May 2010 22:02:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-in-coding/m-p/26522#M6065</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-05-23T22:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: help in coding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-in-coding/m-p/26523#M6066</link>
      <description>I think sbb has got the right idea here.&lt;BR /&gt;
It looks like each b group has the same d value , is it right?&lt;BR /&gt;
if it is. the code is&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data temp;&lt;BR /&gt;
input a $ b $ c $ d ;&lt;BR /&gt;
datalines;&lt;BR /&gt;
a1 b1 red .&lt;BR /&gt;
a1 b1 blue .&lt;BR /&gt;
a1 b1 gren .&lt;BR /&gt;
a1 b1 yellow 123&lt;BR /&gt;
a1 b2 white .&lt;BR /&gt;
a1 b2 red .&lt;BR /&gt;
a1 b2 blue .&lt;BR /&gt;
a1 b2 green 456&lt;BR /&gt;
a1 b2 white .&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
data index;&lt;BR /&gt;
  set temp;&lt;BR /&gt;
  if not missing(d);&lt;BR /&gt;
  keep b d;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=temp;&lt;BR /&gt;
by b;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=index;&lt;BR /&gt;
by b;&lt;BR /&gt;
run;&lt;BR /&gt;
data merged;&lt;BR /&gt;
  merge temp(drop = d) index;&lt;BR /&gt;
  by b;&lt;BR /&gt;
run;&lt;BR /&gt;
proc print;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Mon, 24 May 2010 11:43:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-in-coding/m-p/26523#M6066</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-05-24T11:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: help in coding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-in-coding/m-p/26524#M6067</link>
      <description>Hope codes below would help,&lt;BR /&gt;
&lt;BR /&gt;
data temp;&lt;BR /&gt;
  input a $ b $ c $ d ;&lt;BR /&gt;
  datalines;&lt;BR /&gt;
a1 b1 red .&lt;BR /&gt;
a1 b1 blue .&lt;BR /&gt;
a1 b1 gren .&lt;BR /&gt;
a1 b1 yellow 123&lt;BR /&gt;
a1 b2 white .&lt;BR /&gt;
a1 b2 red .&lt;BR /&gt;
a1 b2 blue .&lt;BR /&gt;
a1 b2 green 456&lt;BR /&gt;
a1 b2 white .&lt;BR /&gt;
;;;;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data= temp;&lt;BR /&gt;
  by a b descending d;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data want(drop=dd);&lt;BR /&gt;
  set temp;&lt;BR /&gt;
  by a b descending d;&lt;BR /&gt;
  retain dd;&lt;BR /&gt;
  if first.b then dd= d;&lt;BR /&gt;
  else d =dd;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 24 May 2010 19:55:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-in-coding/m-p/26524#M6067</guid>
      <dc:creator>P_J</dc:creator>
      <dc:date>2010-05-24T19:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: help in coding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-in-coding/m-p/26525#M6068</link>
      <description>Thanks everyone for your help ! I really appreciate you guys.</description>
      <pubDate>Mon, 24 May 2010 23:40:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-in-coding/m-p/26525#M6068</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-05-24T23:40:53Z</dc:date>
    </item>
  </channel>
</rss>

