<?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: %SQZ_LIBRARY Macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SQZ-LIBRARY-Macro/m-p/106810#M22253</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Before spending time with work-arounds you could also try to solve the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's SAS/Access to ODBC you're using - right? If you can read 1500 rows then try and set readbuff to this value. The error could be caused by a simple out of memory condition.&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001355231.htm" title="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001355231.htm"&gt;http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001355231.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Aug 2012 10:35:52 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2012-08-29T10:35:52Z</dc:date>
    <item>
      <title>%SQZ_LIBRARY Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQZ-LIBRARY-Macro/m-p/106809#M22252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have been trying pull information from a table. If i limit the no of rows to 1500 then i am able to pull the data successfully buy i have to apply a filter condition on the database table. The below is the error i am receiving while i attempt the get the records from the database table. I am using Unix SAS and am pulling the information from SQLSVR&amp;nbsp; database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Error I am receiving : ERROR: CLI cursor extended fetch error: Unable to retrieve error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below is one of the methods i used to pull the information as i am not able to pull more than 1500 records at a time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql ;&lt;/P&gt;&lt;P&gt;select count(*) into : count&lt;/P&gt;&lt;P&gt;from emprd.serviceauth;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;%put &amp;amp;count;&lt;/P&gt;&lt;P&gt; %macro test(finish);&lt;/P&gt;&lt;P&gt;%let i=1;&lt;/P&gt;&lt;P&gt;%let obs = 1;&lt;/P&gt;&lt;P&gt;%let obs_1 = %eval(&amp;amp;obs+1500);&lt;/P&gt;&lt;P&gt;%do %while(&amp;amp;i &amp;lt; %eval(&amp;amp;finish/1500)+1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql ;&lt;/P&gt;&lt;P&gt;create table final_&amp;amp;i as &lt;/P&gt;&lt;P&gt;select diagnosisnarrative&lt;/P&gt;&lt;P&gt;from emprd.serviceauth(firstobs = &amp;amp;obs obs = &amp;amp;obs_1)&lt;/P&gt;&lt;P&gt;where id in (select id from final_6);&lt;/P&gt;&lt;P&gt;quit;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data final;&lt;/P&gt;&lt;P&gt;set final final_&amp;amp;i;&amp;nbsp; &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%let i=%eval(&amp;amp;i+1);&lt;/P&gt;&lt;P&gt;%let obs = %eval(&amp;amp;obs+1500);&lt;/P&gt;&lt;P&gt;%let obs_1 = %eval(&amp;amp;obs_1 + 1500);&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%mend test;&lt;/P&gt;&lt;P&gt;%test(&amp;amp;count) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I came across another method which is to use a macro, explained in the below paper : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.lexjansen.com/wuss/2011/posters/Papers_Bettinger_R_74821.pdf" title="http://www.lexjansen.com/wuss/2011/posters/Papers_Bettinger_R_74821.pdf"&gt;http://www.lexjansen.com/wuss/2011/posters/Papers_Bettinger_R_74821.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%SQZ_LIBRARY( LIBNAME /* name of SAS library to squeeze */&lt;/P&gt;&lt;P&gt;, EXCLUDE= /* List of datasets to EXclude */&lt;/P&gt;&lt;P&gt;, INCLUDE= /* List of datasets to INclude */&lt;/P&gt;&lt;P&gt;, LIST=N /* Flag for listing of dataset contents */&lt;/P&gt;&lt;P&gt;, TRIALRUN=Y /* Flag for mode of operation */&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no macro code available like the one we have for %Squeeze macro.&lt;/P&gt;&lt;P&gt;Can any one explain how to use this macro to squeeze my SQLSVR database table emprd.serviceauth. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Harish.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2012 09:51:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQZ-LIBRARY-Macro/m-p/106809#M22252</guid>
      <dc:creator>hari1109</dc:creator>
      <dc:date>2012-08-29T09:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: %SQZ_LIBRARY Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQZ-LIBRARY-Macro/m-p/106810#M22253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Before spending time with work-arounds you could also try to solve the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's SAS/Access to ODBC you're using - right? If you can read 1500 rows then try and set readbuff to this value. The error could be caused by a simple out of memory condition.&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001355231.htm" title="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001355231.htm"&gt;http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001355231.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2012 10:35:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQZ-LIBRARY-Macro/m-p/106810#M22253</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-08-29T10:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: %SQZ_LIBRARY Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQZ-LIBRARY-Macro/m-p/106811#M22254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi patrick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think i need to edit the odbc.ini file(UNIX platform) in this case if i have to set readbuff option to 1500. is that right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Harish.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2012 11:26:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQZ-LIBRARY-Macro/m-p/106811#M22254</guid>
      <dc:creator>hari1109</dc:creator>
      <dc:date>2012-08-29T11:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: %SQZ_LIBRARY Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQZ-LIBRARY-Macro/m-p/106812#M22255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;According to the docu it's a simple lib name option (see link in above post).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On a side note: why aren't you marking your thread as a question?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2012 23:13:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQZ-LIBRARY-Macro/m-p/106812#M22255</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-08-29T23:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: %SQZ_LIBRARY Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQZ-LIBRARY-Macro/m-p/106813#M22256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One of the basics of program efficiency is how long it takes the system to compile the code.&amp;nbsp; SAS is no exception - that is why the best code is the simplest code from an efficiency standpoint.&amp;nbsp; Patrick's solution is, of course, the simplest and the most efficient.&amp;nbsp; We SAS programmers don't pride ourselves so much on the complexity and volume of our code&amp;nbsp; as we pride ourselves on how fast the code processes.&amp;nbsp; Also, I have found by bitter experience that the more complex I try to make my code (e.g. do as much as possible in one step) the more probable I will make an error.&amp;nbsp; Just a word of caution.!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2012 20:46:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQZ-LIBRARY-Macro/m-p/106813#M22256</guid>
      <dc:creator>JerryH</dc:creator>
      <dc:date>2012-09-10T20:46:29Z</dc:date>
    </item>
  </channel>
</rss>

