<?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 into data step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514446#M138736</link>
    <description>hi,expert~I have updated the question,please take a look</description>
    <pubDate>Mon, 19 Nov 2018 14:23:32 GMT</pubDate>
    <dc:creator>Geo-</dc:creator>
    <dc:date>2018-11-19T14:23:32Z</dc:date>
    <item>
      <title>proc sql into data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514109#M138616</link>
      <description>&lt;P&gt;Hi~Anyone who is good at sas&amp;nbsp; please&amp;nbsp; trun sql in &lt;SPAN&gt;data step.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;create table tableD nologging as
select a.acct,
b.app_dt,
case when a.acct in (select acct from tableC) then 1 else 0 end prom_ind
from tableA a
inner join tableB b
on a.application_no = b.application_no
where to_char(b.app_dt,'yyyymmdd') between '20150101' and '20150630'
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 23:18:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514109#M138616</guid>
      <dc:creator>Geo-</dc:creator>
      <dc:date>2018-11-19T23:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql into data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514112#M138617</link>
      <description>&lt;P&gt;Please provide examples (data steps with datalines) for tablea, tableb and tablec.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Nov 2018 07:30:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514112#M138617</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-17T07:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql into data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514113#M138618</link>
      <description>&lt;P&gt;hi expert,only looking for code the right with SAS data step&amp;nbsp;syntax is fine.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Nov 2018 08:07:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514113#M138618</guid>
      <dc:creator>Geo-</dc:creator>
      <dc:date>2018-11-17T08:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql into data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514114#M138619</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/184018"&gt;@Geo-&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;hi expert,only looking for code the right with SAS data step&amp;nbsp;syntax is fine.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Code is driven by the data. Help us to help you.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Nov 2018 08:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514114#M138619</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-17T08:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql into data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514116#M138620</link>
      <description>Why do you want to translate the code?&lt;BR /&gt;Any particular problem with existing one..?</description>
      <pubDate>Sat, 17 Nov 2018 11:29:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514116#M138620</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-11-17T11:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql into data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514120#M138623</link>
      <description>&lt;P&gt;Why do you want to change a working process into a possible POS.&lt;/P&gt;
&lt;P&gt;If it works leave it alone.&amp;nbsp; Why make a sports car run like a VW.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Nov 2018 13:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514120#M138623</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-11-17T13:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql into data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514170#M138631</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/122002"&gt;@VDD&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There may be many good reasons for converting proc sql code to&amp;nbsp;data step code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One of the most common is to take advantage of situations in which tables to be joined based on equality of&amp;nbsp;variables arise from&amp;nbsp;data sets&amp;nbsp;sorted on the respective join variables.&amp;nbsp; This would almost always be a speed enhancer for large data sets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data step might be the sports car.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Nov 2018 00:06:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514170#M138631</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-11-18T00:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql into data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514186#M138638</link>
      <description>&lt;P&gt;thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt; that makes since.&amp;nbsp; In the programming that I do I find myself using the datastep about 70 percent of the time and I never really know why I used it so much.&amp;nbsp; Others always ask me why I do it in the datastep when I could use a case statement but your answer must reflect inner knowledge that I just not aware of but spontaneously do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Nov 2018 04:26:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514186#M138638</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-11-18T04:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql into data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514244#M138662</link>
      <description>&lt;P&gt;You need to show the data.&lt;/P&gt;
&lt;P&gt;Are ACCT and APP_DT variables in TABLEA or TABLEB? Are TABLEA and TABLEB sorted by APPLICATION_NO?&amp;nbsp; How does relationship between ACCT and APPLICATION_NO work?&amp;nbsp; Is ACCT a unique key on TABLEC?&amp;nbsp; Does TABLEC have an index on ACCT?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Nov 2018 15:31:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514244#M138662</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-11-18T15:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql into data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514261#M138665</link>
      <description>&lt;P&gt;I would say, as a general rule, if the data sets are sorted advantageously, that most&amp;nbsp;data step code utilizing that order is likely to be faster than the equivalent proc sql.&amp;nbsp; That includes:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;MERGE (or SET) with BY statement (where the by is utilizing the physical record sequence instead of data set index on the by variable), which I mentioned earlier.&lt;/LI&gt;
&lt;LI&gt;LAG functions (which aren't even supported in proc sql).&lt;/LI&gt;
&lt;LI&gt;self-MERGEs to get lead values,&lt;BR /&gt;&amp;nbsp; e.g. &lt;STRONG&gt;&lt;EM&gt;MERGE have have (firstobs=2 keep=x rename=(x=xlead1));&lt;/EM&gt;&lt;/STRONG&gt;.&lt;/LI&gt;
&lt;LI&gt;rolling windows for time series (sometimes better than the time-series-oriented PROC EXPAND)&lt;/LI&gt;
&lt;LI&gt;interpolating observations.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edited addition:&amp;nbsp; Also, in cases where use of arrays are beneficial in data steps, I am not aware of an analogous coding structure in proc sql.&amp;nbsp; But my knowledge of proc sql is quite inferior to my knowledge of the data step, so it might be out there in&amp;nbsp;the documentation.&amp;nbsp; If it is, I'd welcome a pointer.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Nov 2018 17:30:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514261#M138665</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-11-18T17:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql into data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514446#M138736</link>
      <description>hi,expert~I have updated the question,please take a look</description>
      <pubDate>Mon, 19 Nov 2018 14:23:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514446#M138736</guid>
      <dc:creator>Geo-</dc:creator>
      <dc:date>2018-11-19T14:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql into data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514451#M138738</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/184018"&gt;@Geo-&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;hi,expert~I have updated the question,please take a look&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Still no example data.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 14:33:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514451#M138738</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-19T14:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql into data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514629#M138770</link>
      <description>Yes,I have made some samples in the attachment</description>
      <pubDate>Mon, 19 Nov 2018 23:24:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514629#M138770</guid>
      <dc:creator>Geo-</dc:creator>
      <dc:date>2018-11-19T23:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql into data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514708#M138809</link>
      <description>&lt;P&gt;Excel files are NOT SAS datasets. They can tell us nothing about column attributes like lengths, formats etc, as those informations are mostly lost during the export.&lt;/P&gt;
&lt;P&gt;Please supply example data as advised.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 10:53:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-into-data-step/m-p/514708#M138809</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-20T10:53:36Z</dc:date>
    </item>
  </channel>
</rss>

