<?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: SAS to SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/812292#M320482</link>
    <description>&lt;P&gt;Here a &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lepg/p1pa3hnpchkgf7n1etensx665yxr.htm#n0qswadggmd798n1vxc6n9dwb29x" target="_self"&gt;SAS Docu link&lt;/A&gt; that might be useful to you.&lt;/P&gt;</description>
    <pubDate>Tue, 10 May 2022 03:52:40 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2022-05-10T03:52:40Z</dc:date>
    <item>
      <title>SAS to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/812278#M320474</link>
      <description>Hi I am working on a large project where we want to migrate data from SAS to DataStage and need to convert SAS code to SQL for ease of reference.  My question is:&lt;BR /&gt;&lt;BR /&gt;How to write SQL to replace MERGE  for cases below:&lt;BR /&gt;Case 1:&lt;BR /&gt;Table A, no of var is M, no of row is N &lt;BR /&gt;Table B, no of var is O, no of rows is P&lt;BR /&gt;Merge A, B By 1 variable&lt;BR /&gt;&lt;BR /&gt;Case 2&lt;BR /&gt;Table A, no of var is M, no of rows is N&lt;BR /&gt;Table B, no of var is O, no of rows is P&lt;BR /&gt;Merge A, B By 2 variable&lt;BR /&gt;&lt;BR /&gt;Where M, N, O, P can be any numbers&lt;BR /&gt;&lt;BR /&gt;I find this very difficult please kindly advise&lt;BR /&gt;Your help would be much appreciated&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 May 2022 01:36:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/812278#M320474</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2022-05-10T01:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/812282#M320477</link>
      <description>&lt;P&gt;If they're just merges it's pretty straightforward.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there's functions in the SQL as well (data transformation) or other functions it can get more complicated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This book is a good reference:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/en/books/authors/kirk-paul-lafler.html" target="_blank"&gt;https://support.sas.com/en/books/authors/kirk-paul-lafler.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or try W3 school:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.w3schools.com/sql/" target="_blank"&gt;https://www.w3schools.com/sql/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that not all data step merges can be replicated in SQL, many to many merges in a data step will not align with a SQL merge for example.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 01:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/812282#M320477</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-05-10T01:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: SAS to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/812292#M320482</link>
      <description>&lt;P&gt;Here a &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lepg/p1pa3hnpchkgf7n1etensx665yxr.htm#n0qswadggmd798n1vxc6n9dwb29x" target="_self"&gt;SAS Docu link&lt;/A&gt; that might be useful to you.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 03:52:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/812292#M320482</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-05-10T03:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/812312#M320495</link>
      <description>&lt;P&gt;Does that mean I will have to write in SQL from sketch the logic of SAS merge on a case by case basis?&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 07:53:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/812312#M320495</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2022-05-10T07:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/812333#M320506</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/416388"&gt;@HeatherNewton&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Does that mean I will have to write in SQL from sketch the logic of SAS merge on a case by case basis?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes!&lt;/P&gt;
&lt;P&gt;And some of the additional sequential logic normally also being part of a SAS data step will be hard to translate into SQL / will require some PL/SQL or similar depending on the database you want to run your code.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 09:10:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/812333#M320506</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-05-10T09:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/812425#M320555</link>
      <description>&lt;P&gt;It depends on the complexity of your queries. If they're merges without anything it's pretty straightforward.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But other data step logic, like FIRST/LAST/BY group processing can be difficult to replicate in SQL. Lag is also typically a pain.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 15:19:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/812425#M320555</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-05-10T15:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/812480#M320579</link>
      <description>&lt;P&gt;Typically DataStage uses other relational databases for data storage. Which one will you be using? You will need to write SQL compatible with that database.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 19:51:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/812480#M320579</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-05-10T19:51:20Z</dc:date>
    </item>
  </channel>
</rss>

