<?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: switching the values of the columns in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/switching-the-values-of-the-columns/m-p/70701#M7073</link>
    <description>Hi &lt;BR /&gt;
&lt;BR /&gt;
The query wizard in EG generates SQL code. &lt;BR /&gt;
Writing logic in SQL where you need to do things on a "first" and "second" row is often tricky. Procedural languages like Base SAS are much better suited for this.&lt;BR /&gt;
&lt;BR /&gt;
So even with the best (SQL) query wizard it would be rather hard to set up this query.&lt;BR /&gt;
&lt;BR /&gt;
Why not use the possibilities EG gives you - which in this case would be the programming window.&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick</description>
    <pubDate>Sat, 28 May 2011 05:44:04 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2011-05-28T05:44:04Z</dc:date>
    <item>
      <title>switching the values of the columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/switching-the-values-of-the-columns/m-p/70698#M7070</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
33822730 12/27/2007 xyz Approval&lt;BR /&gt;
33822730 2/4/2009    xyz  Referral&lt;BR /&gt;
&lt;BR /&gt;
I have to switch the values of APPROVAL and REFERRAL depending on date.For each id the first date value should be approval and second date value should be Refferal,only if approval and refferal are present for perticular id.&lt;BR /&gt;
&lt;BR /&gt;
How can acheive this using EG.&lt;BR /&gt;
&lt;BR /&gt;
reddy</description>
      <pubDate>Fri, 27 May 2011 18:16:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/switching-the-values-of-the-columns/m-p/70698#M7070</guid>
      <dc:creator>reddy19</dc:creator>
      <dc:date>2011-05-27T18:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: switching the values of the columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/switching-the-values-of-the-columns/m-p/70699#M7071</link>
      <description>Hello Reddy19,&lt;BR /&gt;
&lt;BR /&gt;
This is a solution:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data i;&lt;BR /&gt;
  input id date ANYDTDTE10. field $ Status $ 25-32;&lt;BR /&gt;
  format date date7.;&lt;BR /&gt;
datalines;&lt;BR /&gt;
33822730 12/27/2007 xyz Approval&lt;BR /&gt;
33822730 2/3/2009   xyz        &lt;BR /&gt;
33822730 2/4/2009   xyz Referral&lt;BR /&gt;
33822730 2/5/2009   xyz &lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=i;&lt;BR /&gt;
  by id date;&lt;BR /&gt;
run;&lt;BR /&gt;
data r;&lt;BR /&gt;
  set i;&lt;BR /&gt;
  if FIRST.id and UPCASE(Status) in ("APPROVAL" "REFERRAL") then s="Referral";&lt;BR /&gt;
  else if UPCASE(Status) in ("APPROVAL" "REFERRAL") then s="Approval";&lt;BR /&gt;
  by id;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Fri, 27 May 2011 18:51:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/switching-the-values-of-the-columns/m-p/70699#M7071</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2011-05-27T18:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: switching the values of the columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/switching-the-values-of-the-columns/m-p/70700#M7072</link>
      <description>Through programming i will be able to do it.&lt;BR /&gt;
&lt;BR /&gt;
But using EG(point and click interface),i'm not able to figure it out...can you please suggest me how i could do this using EG.&lt;BR /&gt;
&lt;BR /&gt;
Thanks a lot,&lt;BR /&gt;
reddy</description>
      <pubDate>Fri, 27 May 2011 20:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/switching-the-values-of-the-columns/m-p/70700#M7072</guid>
      <dc:creator>reddy19</dc:creator>
      <dc:date>2011-05-27T20:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: switching the values of the columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/switching-the-values-of-the-columns/m-p/70701#M7073</link>
      <description>Hi &lt;BR /&gt;
&lt;BR /&gt;
The query wizard in EG generates SQL code. &lt;BR /&gt;
Writing logic in SQL where you need to do things on a "first" and "second" row is often tricky. Procedural languages like Base SAS are much better suited for this.&lt;BR /&gt;
&lt;BR /&gt;
So even with the best (SQL) query wizard it would be rather hard to set up this query.&lt;BR /&gt;
&lt;BR /&gt;
Why not use the possibilities EG gives you - which in this case would be the programming window.&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick</description>
      <pubDate>Sat, 28 May 2011 05:44:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/switching-the-values-of-the-columns/m-p/70701#M7073</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2011-05-28T05:44:04Z</dc:date>
    </item>
  </channel>
</rss>

