<?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: Convert the code from SAS to HADOOP in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-the-code-from-SAS-to-HADOOP/m-p/466400#M30239</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;23         options sastrace=',,,d' sastraceloc=saslog nostsuffix;
24         


25         proc sql;
26         create table work.filter_for_temp as
27         select * from hdp_hsf.temp_apr18 t1
28         where t1.process_type = 'ZSC1' and (t1.zhdl = . and t1.zpre = .) ;
 
HADOOP_1: Executed: on connection 1
USE `analytics_hsf`
 
 
HADOOP_2: Prepared: on connection 1
SHOW TABLES 'TEMP_APR18'
 
 
HADOOP_3: Prepared: on connection 1
DESCRIBE FORMATTED TEMP_APR18
 
 
HADOOP_4: Prepared: on connection 1
SELECT * FROM `TEMP_APR18`
 
 
HADOOP_5: Prepared: on connection 1
SELECT  `TEMP_APR18`.`business_partner`, `TEMP_APR18`.`business_agreement`, `TEMP_APR18`.`product_guid`, `TEMP_APR18`.`los`, 
`TEMP_APR18`.`report_date`, `TEMP_APR18`.`bundle_seq_id`, `TEMP_APR18`.`process_type`, `TEMP_APR18`.`product_life_indicator`, 
`TEMP_APR18`.`contract_status`, `TEMP_APR18`.`product_status`, `TEMP_APR18`.`prod_cnt`, `TEMP_APR18`.`product_start_date`, 
`TEMP_APR18`.`product_end_date`, `TEMP_APR18`.`months_to_go`, `TEMP_APR18`.`tax_rate`, `TEMP_APR18`.`zopt`, `TEMP_APR18`.`zrda`, 
`TEMP_APR18`.`zrdp`, `TEMP_APR18`.`zcaf`, `TEMP_APR18`.`zcap`, `TEMP_APR18`.`zjc1`, `TEMP_APR18`.`zjc2`, `TEMP_APR18`.`zmpf`, 
`TEMP_APR18`.`zmpp`, `TEMP_APR18`.`zpda`, `TEMP_APR18`.`zptd`, `TEMP_APR18`.`zvi1`, `TEMP_APR18`.`zvi2`, `TEMP_APR18`.`zvt1`, 
`TEMP_APR18`.`zvt2`, `TEMP_APR18`.`zhdl`, `TEMP_APR18`.`zqu1`, `TEMP_APR18`.`zwip`, `TEMP_APR18`.`zpre`, `TEMP_APR18`.`zncd`, 
2                                                          The SAS System                               10:57 Thursday, May 31, 2018

`TEMP_APR18`.`znpd`, `TEMP_APR18`.`znrd`, `TEMP_APR18`.`zl0a`, `TEMP_APR18`.`zld0`, `TEMP_APR18`.`zld1`, `TEMP_APR18`.`zd03`, 
`TEMP_APR18`.`zd04`, `TEMP_APR18`.`zcd1`, `TEMP_APR18`.`zd06`, `TEMP_APR18`.`zd02`, `TEMP_APR18`.`zcd2`, `TEMP_APR18`.`zd05`, 
`TEMP_APR18`.`zcd3`  FROM `TEMP_APR18`  WHERE  ( ( `process_type` = 'ZSC1' ) AND  ( `zhdl` IS  NULL  ) AND  ( `zpre` IS  NULL  ) )
 
NOTE: Compressing data set WORK.FILTER_FOR_TEMP decreased size by 95.54 percent. 
      Compressed is 7 pages; un-compressed would require 157 pages.
NOTE: Table WORK.FILTER_FOR_TEMP created, with 2032 rows and 48 columns.

29         quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           55.21 seconds
      user cpu time       0.15 seconds
      system cpu time     0.05 seconds
      memory              4010.84k
      OS Memory           25248.00k
      Timestamp           05/31/2018 12:20:51 PM
      Step Count                        3  Switch Count  104
      Page Faults                       0
      Page Reclaims                     561
      Page Swaps                        0
      Voluntary Context Switches        2287
      Involuntary Context Switches      169
      Block Input Operations            168
      Block Output Operations           1808
      

30         
31         GOPTIONS NOACCESSIBLE;
32         %LET _CLIENTTASKLABEL=;
33         %LET _CLIENTPROJECTPATH=;
34         %LET _CLIENTPROJECTNAME=;
35         %LET _SASPROGRAMFILE=;
36         
37         ;*';*";*/;quit;run;
38         ODS _ALL_ CLOSE;
39         
40         
41         QUIT; RUN;
42         &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am running the same query on Hadoop Hive but it throws an error still SAS excutes.&lt;/P&gt;</description>
    <pubDate>Thu, 31 May 2018 11:25:50 GMT</pubDate>
    <dc:creator>saikiran_nemani</dc:creator>
    <dc:date>2018-05-31T11:25:50Z</dc:date>
    <item>
      <title>Convert the code from SAS to HADOOP</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-the-code-from-SAS-to-HADOOP/m-p/466384#M30232</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
Delete FROM BI_BGRS.TEMP_APR18 t1
WHERE t1.PROCESS_TYPE = 'ZSC1' AND (t1.ZHDL = . and t1.ZPRE = .) ;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As we are having Millions (103 Million) of Records , we want change the present SAS Query to Hadoop Query Because it is taking Huge time and meanwhile its getting stucked all the time.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 10:26:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-the-code-from-SAS-to-HADOOP/m-p/466384#M30232</guid>
      <dc:creator>saikiran_nemani</dc:creator>
      <dc:date>2018-05-31T10:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: Convert the code from SAS to HADOOP</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-the-code-from-SAS-to-HADOOP/m-p/466386#M30234</link>
      <description>&lt;P&gt;And what is the question?&amp;nbsp; This:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token function"&gt;Delete&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;FROM&lt;/SPAN&gt; BI_BGRS&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;TEMP_APR18 t1
&lt;SPAN class="token statement"&gt;WHERE&lt;/SPAN&gt; t1&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;PROCESS_TYPE &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'ZSC1'&lt;/SPAN&gt; AND &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;t1&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;ZHDL &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt; and t1&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;ZPRE &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Looks like ANSI SQL, so should work on the database like that.&amp;nbsp; You may need to change the . to the missing value or function of the database, and it may be that you need to change the single quote to double.&amp;nbsp; otherwise I can't see an issue.&amp;nbsp; Have you tried it.&lt;/P&gt;
&lt;P&gt;Why the brackets?&amp;nbsp; Also, avoid coding in upper or mixed case.&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 10:33:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-the-code-from-SAS-to-HADOOP/m-p/466386#M30234</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-05-31T10:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Convert the code from SAS to HADOOP</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-the-code-from-SAS-to-HADOOP/m-p/466388#M30235</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where t1.process_type = 'ZSC1' and (t1.zhdl = . and t1.zpre = .) ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The above query mainly deletes the process type whose type is zsc1 and also deletes the Level of Services who are missing .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 10:40:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-the-code-from-SAS-to-HADOOP/m-p/466388#M30235</guid>
      <dc:creator>saikiran_nemani</dc:creator>
      <dc:date>2018-05-31T10:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: Convert the code from SAS to HADOOP</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-the-code-from-SAS-to-HADOOP/m-p/466389#M30236</link>
      <description>&lt;P&gt;Its no different to:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;where&lt;/SPAN&gt; t1&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;process_type &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'ZSC1'&lt;/SPAN&gt; and t1&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;zhdl &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt; and t1&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;zpre &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 May 2018 10:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-the-code-from-SAS-to-HADOOP/m-p/466389#M30236</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-05-31T10:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Convert the code from SAS to HADOOP</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-the-code-from-SAS-to-HADOOP/m-p/466393#M30237</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/124432"&gt;@saikiran_nemani&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I haven't had real hand-on with Hadoop yet &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; so only on a generic level when interfacing with any database:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If using implicit SQL (SAS SQL) then make sure to not use any function or expression which the SAS Access engine can't translate into database specific syntax. If such a translation is not possible and SAS can't push execution to the database then what happens is that all the data gets first transferred to the SAS side for execution - and this can have a huge performance impact.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To avoid such unfavorable scenarios:&lt;/P&gt;
&lt;P&gt;1. Use options "&lt;SPAN&gt;options sastrace=',,,d' sastraceloc=saslog &lt;/SPAN&gt;&lt;EM&gt;nostsuffix&lt;/EM&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;" as this will show you in the SAS log what part of the code SAS was able to send to the remote database for execution.&lt;/P&gt;
&lt;P&gt;2. Eventually use explicit pass-through as this will a) ensure that the code always executes on the database side and b) will allow you to take advantage of database functions not available in SAS.&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 10:49:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-the-code-from-SAS-to-HADOOP/m-p/466393#M30237</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-05-31T10:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Convert the code from SAS to HADOOP</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-the-code-from-SAS-to-HADOOP/m-p/466400#M30239</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;23         options sastrace=',,,d' sastraceloc=saslog nostsuffix;
24         


25         proc sql;
26         create table work.filter_for_temp as
27         select * from hdp_hsf.temp_apr18 t1
28         where t1.process_type = 'ZSC1' and (t1.zhdl = . and t1.zpre = .) ;
 
HADOOP_1: Executed: on connection 1
USE `analytics_hsf`
 
 
HADOOP_2: Prepared: on connection 1
SHOW TABLES 'TEMP_APR18'
 
 
HADOOP_3: Prepared: on connection 1
DESCRIBE FORMATTED TEMP_APR18
 
 
HADOOP_4: Prepared: on connection 1
SELECT * FROM `TEMP_APR18`
 
 
HADOOP_5: Prepared: on connection 1
SELECT  `TEMP_APR18`.`business_partner`, `TEMP_APR18`.`business_agreement`, `TEMP_APR18`.`product_guid`, `TEMP_APR18`.`los`, 
`TEMP_APR18`.`report_date`, `TEMP_APR18`.`bundle_seq_id`, `TEMP_APR18`.`process_type`, `TEMP_APR18`.`product_life_indicator`, 
`TEMP_APR18`.`contract_status`, `TEMP_APR18`.`product_status`, `TEMP_APR18`.`prod_cnt`, `TEMP_APR18`.`product_start_date`, 
`TEMP_APR18`.`product_end_date`, `TEMP_APR18`.`months_to_go`, `TEMP_APR18`.`tax_rate`, `TEMP_APR18`.`zopt`, `TEMP_APR18`.`zrda`, 
`TEMP_APR18`.`zrdp`, `TEMP_APR18`.`zcaf`, `TEMP_APR18`.`zcap`, `TEMP_APR18`.`zjc1`, `TEMP_APR18`.`zjc2`, `TEMP_APR18`.`zmpf`, 
`TEMP_APR18`.`zmpp`, `TEMP_APR18`.`zpda`, `TEMP_APR18`.`zptd`, `TEMP_APR18`.`zvi1`, `TEMP_APR18`.`zvi2`, `TEMP_APR18`.`zvt1`, 
`TEMP_APR18`.`zvt2`, `TEMP_APR18`.`zhdl`, `TEMP_APR18`.`zqu1`, `TEMP_APR18`.`zwip`, `TEMP_APR18`.`zpre`, `TEMP_APR18`.`zncd`, 
2                                                          The SAS System                               10:57 Thursday, May 31, 2018

`TEMP_APR18`.`znpd`, `TEMP_APR18`.`znrd`, `TEMP_APR18`.`zl0a`, `TEMP_APR18`.`zld0`, `TEMP_APR18`.`zld1`, `TEMP_APR18`.`zd03`, 
`TEMP_APR18`.`zd04`, `TEMP_APR18`.`zcd1`, `TEMP_APR18`.`zd06`, `TEMP_APR18`.`zd02`, `TEMP_APR18`.`zcd2`, `TEMP_APR18`.`zd05`, 
`TEMP_APR18`.`zcd3`  FROM `TEMP_APR18`  WHERE  ( ( `process_type` = 'ZSC1' ) AND  ( `zhdl` IS  NULL  ) AND  ( `zpre` IS  NULL  ) )
 
NOTE: Compressing data set WORK.FILTER_FOR_TEMP decreased size by 95.54 percent. 
      Compressed is 7 pages; un-compressed would require 157 pages.
NOTE: Table WORK.FILTER_FOR_TEMP created, with 2032 rows and 48 columns.

29         quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           55.21 seconds
      user cpu time       0.15 seconds
      system cpu time     0.05 seconds
      memory              4010.84k
      OS Memory           25248.00k
      Timestamp           05/31/2018 12:20:51 PM
      Step Count                        3  Switch Count  104
      Page Faults                       0
      Page Reclaims                     561
      Page Swaps                        0
      Voluntary Context Switches        2287
      Involuntary Context Switches      169
      Block Input Operations            168
      Block Output Operations           1808
      

30         
31         GOPTIONS NOACCESSIBLE;
32         %LET _CLIENTTASKLABEL=;
33         %LET _CLIENTPROJECTPATH=;
34         %LET _CLIENTPROJECTNAME=;
35         %LET _SASPROGRAMFILE=;
36         
37         ;*';*";*/;quit;run;
38         ODS _ALL_ CLOSE;
39         
40         
41         QUIT; RUN;
42         &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am running the same query on Hadoop Hive but it throws an error still SAS excutes.&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 11:25:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-the-code-from-SAS-to-HADOOP/m-p/466400#M30239</guid>
      <dc:creator>saikiran_nemani</dc:creator>
      <dc:date>2018-05-31T11:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Convert the code from SAS to HADOOP</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-the-code-from-SAS-to-HADOOP/m-p/466652#M30275</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/124432"&gt;@saikiran_nemani&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Is this the full log or have you remove lines?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe I should see the prepared statements in the log but then also a log message which tells me which one of t he prepared statements has actually been executed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for the timings: You've stated that this takes a "huge" amount of time. Is this the 55 seconds real time?&lt;/P&gt;
&lt;PRE&gt;      real time           55.21 seconds
      user cpu time       0.15 seconds
      system cpu time     0.05 seconds
&lt;/PRE&gt;
&lt;P&gt;Real time is much higher than CPU time. What data volumes are you transferring form Hadoop to SAS? Could it be that the WHERE clause gets only executed on the SAS side? The log message which SQL code got executed should tell us.&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 22:16:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-the-code-from-SAS-to-HADOOP/m-p/466652#M30275</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-05-31T22:16:59Z</dc:date>
    </item>
  </channel>
</rss>

