<?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: Running SAS query on DB2 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Running-SAS-query-on-DB2/m-p/50556#M13809</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Siddhartha:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assumme that you are running this query agaist a mainframe DB2 database?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you may have run into a processing limitation that has been put in place by the mainfram DBA's to prevent queries taking too long a slowing down the database.&amp;nbsp; There are several possible solutions:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Call you friendly mainframe DBA and appeal to their good nature to change the processing limit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) See if you can run the query from an account that has more priority on the mainframe - often these accounts have different limits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Run the query in smaller 'chunks' - such as weeks, and then combine the results,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) Call your friendly mainframe DBA (again) as get the index variables for the database to optimize your query - changing (or adding/removing) just one variable from the query can make a huge difference to the CPU time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your chances of 1) or 2) working are slim.&amp;nbsp; I recommend trying to make the query as efficient as possible to reduce the CPU overhead.&amp;nbsp; Check how many records are returned in a 1 day query and the CPU time and then multiply by the total number of days your are extracting as a (very) rough estimate of the total CPU time you need.&amp;nbsp; Then you can check how many records are returned by the failed query with the full month.&amp;nbsp; That can give you an idea of how far the query got before it failed and how much time the query will need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see I've hit this wall too...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Aug 2011 15:35:20 GMT</pubDate>
    <dc:creator>OS2Rules</dc:creator>
    <dc:date>2011-08-18T15:35:20Z</dc:date>
    <item>
      <title>Running SAS query on DB2</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Running-SAS-query-on-DB2/m-p/50555#M13808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P dir="ltr"&gt;Hi,&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;I tried to use the MVSW as well as analysis environment to execute the below query on DB2 (SAS code) for &lt;STRONG&gt;single day&lt;/STRONG&gt;, as I need to fetch the data for the &lt;STRONG&gt;entire month&lt;/STRONG&gt;. Unfortunately, I still get an error due to insufficient ASU time:&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;STRONG&gt;ERROR: Error fetching from cursor. DB2 error is DSNT408I SQLCODE = -905, ERROR: UNSUCCESSFUL EXECUTION DUE TO RESOURCE LIMIT&lt;/STRONG&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;STRONG&gt;BEING EXCEEDED, RESOURCE NAME = ASUTIME LIMIT = 000000000009 CPU SECONDS (000000450000 SERVICE UNITS) DERIVED FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;STRONG&gt;SYSIBM.DSNRLST01.&lt;/STRONG&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;Could any one advise on this.&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SAS code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;signoff host;&lt;BR /&gt;%let host = mvsw&amp;nbsp; 9450;&lt;BR /&gt;signon host user = sid_14 pass = _prompt_;&lt;/P&gt;&lt;P&gt;rsubmit host;&lt;BR /&gt;libname outlib "sid_14.SAS.COLL.SERV.DATA" disp=old; &lt;BR /&gt;proc sql inobs =max;&lt;BR /&gt;&amp;nbsp; connect to db2;&lt;BR /&gt;&amp;nbsp; create table outlib.opk_r_A as&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from connection to db2&lt;BR /&gt;(select opts from&amp;nbsp; DKDDBPE_DB2P.EO.CS_OPK_FASTE_S&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; WHERE&amp;nbsp;&amp;nbsp; DATE(OPTS) &amp;gt;= '2011-06-01'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;AND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATE(OPTS) &amp;lt;=&amp;nbsp; '2011-06-01'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;AND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BEAKST IN ('U')&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;);&lt;BR /&gt;&amp;nbsp; %put &amp;amp;sqlxrc &amp;amp;sqlxmsg;&lt;BR /&gt;&amp;nbsp; disconnect from db2;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;proc download in=outlib out=sid;&lt;BR /&gt;select opk_r_A;&lt;BR /&gt;run;&lt;BR /&gt;endrsubmit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanking you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siddhartha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: #000080; font-family: Courier New;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="font-size: 10pt; color: #000080; font-family: Courier New;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="font-size: 10pt; color: #000080; font-family: Courier New;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="font-size: 10pt; color: #000080; font-family: Courier New;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: #000080; font-family: Courier New;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: #000080; font-family: Courier New;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: #000080; font-family: Courier New;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: #000080; font-family: Courier New;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2011 13:22:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Running-SAS-query-on-DB2/m-p/50555#M13808</guid>
      <dc:creator>Siddhartha</dc:creator>
      <dc:date>2011-08-18T13:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Running SAS query on DB2</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Running-SAS-query-on-DB2/m-p/50556#M13809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Siddhartha:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assumme that you are running this query agaist a mainframe DB2 database?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you may have run into a processing limitation that has been put in place by the mainfram DBA's to prevent queries taking too long a slowing down the database.&amp;nbsp; There are several possible solutions:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Call you friendly mainframe DBA and appeal to their good nature to change the processing limit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) See if you can run the query from an account that has more priority on the mainframe - often these accounts have different limits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Run the query in smaller 'chunks' - such as weeks, and then combine the results,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) Call your friendly mainframe DBA (again) as get the index variables for the database to optimize your query - changing (or adding/removing) just one variable from the query can make a huge difference to the CPU time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your chances of 1) or 2) working are slim.&amp;nbsp; I recommend trying to make the query as efficient as possible to reduce the CPU overhead.&amp;nbsp; Check how many records are returned in a 1 day query and the CPU time and then multiply by the total number of days your are extracting as a (very) rough estimate of the total CPU time you need.&amp;nbsp; Then you can check how many records are returned by the failed query with the full month.&amp;nbsp; That can give you an idea of how far the query got before it failed and how much time the query will need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see I've hit this wall too...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2011 15:35:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Running-SAS-query-on-DB2/m-p/50556#M13809</guid>
      <dc:creator>OS2Rules</dc:creator>
      <dc:date>2011-08-18T15:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: Running SAS query on DB2</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Running-SAS-query-on-DB2/m-p/50557#M13810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I suggest you also look at this part of your query:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE&amp;nbsp;&amp;nbsp; DATE(OPTS) &amp;gt;= '2011-&lt;STRONG&gt;06&lt;/STRONG&gt;-01'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;AND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATE(OPTS) &amp;lt;=&amp;nbsp; '2011-&lt;STRONG&gt;06&lt;/STRONG&gt;-01' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This brings back ALL rows. I am wondering if you meant to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE&amp;nbsp;&amp;nbsp; DATE(OPTS) &amp;gt;= '2011-&lt;STRONG&gt;06&lt;/STRONG&gt;-01'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;AND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATE(OPTS) &lt;STRONG&gt;&amp;lt;&lt;/STRONG&gt;&amp;nbsp; '2011-&lt;STRONG&gt;07&lt;/STRONG&gt;-01'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2011 21:07:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Running-SAS-query-on-DB2/m-p/50557#M13810</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2011-08-18T21:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Running SAS query on DB2</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Running-SAS-query-on-DB2/m-p/50558#M13811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am extracting the data for one day ( i.e., 2011-06-01) but I need to extract for the whole month.&lt;/P&gt;&lt;P&gt;So for single day only I am getting the error regarding ASU time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siddhartha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2011 08:46:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Running-SAS-query-on-DB2/m-p/50558#M13811</guid>
      <dc:creator>Siddhartha</dc:creator>
      <dc:date>2011-08-19T08:46:17Z</dc:date>
    </item>
  </channel>
</rss>

