<?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: Extraction from SASHELP.VCLOUMN is hanging for long time in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Extraction-from-SASHELP-VCLOUMN-is-hanging-for-long-time/m-p/322203#M71271</link>
    <description>&lt;P&gt;I'm kind of interested in how you will use that resulting macro variable. Embedded quotes inside macro variables are often sources of headaches at later steps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have the || as use in concatenation then you may well want to consider use of one of the CAT functions as || has the potential to have lots of blanks embedded in the result&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jan 2017 17:06:33 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-01-03T17:06:33Z</dc:date>
    <item>
      <title>Extraction from SASHELP.VCLOUMN is hanging for long time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extraction-from-SASHELP-VCLOUMN-is-hanging-for-long-time/m-p/321973#M71163</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following code in my program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;NOPRINT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; name &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; :col separated by &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"||','||"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sashelp.vcolumn &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; memname=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"COUNTRY_TRANS"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; name &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;not&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;in&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"SECT_SICSID"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"_NAME_"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"_LABEL_"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;The code is running in this step for long time and it isnot finishing for more than 3 hr. Is this issue related to environment? &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Please advise what would have been the issue here?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Thanks,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Sampath&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2017 17:31:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extraction-from-SASHELP-VCLOUMN-is-hanging-for-long-time/m-p/321973#M71163</guid>
      <dc:creator>bmsampath</dc:creator>
      <dc:date>2017-01-02T17:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction from SASHELP.VCLOUMN is hanging for long time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extraction-from-SASHELP-VCLOUMN-is-hanging-for-long-time/m-p/321977#M71164</link>
      <description>&lt;P&gt;Hi, I found DICTIONARY.COLUMNS to be fractionally faster than using SASHELP.VCOLUMN (which is a view of dictionary.columns). But, your mileage may vary depending on the systems involved.&lt;/P&gt;
&lt;P&gt;&lt;IMG title="use_dict_columns.png" alt="use_dict_columns.png" src="https://communities.sas.com/t5/image/serverpage/image-id/6558iB93F5985A7B7F4F9/image-size/original?v=v2&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If you can't figure out what the issue is, you might want to work with Tech Support.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2017 17:45:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extraction-from-SASHELP-VCLOUMN-is-hanging-for-long-time/m-p/321977#M71164</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-01-02T17:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction from SASHELP.VCLOUMN is hanging for long time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extraction-from-SASHELP-VCLOUMN-is-hanging-for-long-time/m-p/321978#M71165</link>
      <description>&lt;P&gt;This happens if your connected to a database with many tables/rows. 3 hrs is extreme though.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Other options is to&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Try dictionary.column instead of SASHELP.vcolumn&lt;/P&gt;
&lt;P&gt;2. Use PROC contents or datasets to generate the variable list - this is usually very quick.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2017 17:46:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extraction-from-SASHELP-VCLOUMN-is-hanging-for-long-time/m-p/321978#M71165</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-02T17:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction from SASHELP.VCLOUMN is hanging for long time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extraction-from-SASHELP-VCLOUMN-is-hanging-for-long-time/m-p/321984#M71170</link>
      <description>&lt;P&gt;I tried DICTIONARY.COLUMNS also. It is also running for long time..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will report this issue to our system admin. Thanks for your ideas. I will try theam also.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2017 18:04:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extraction-from-SASHELP-VCLOUMN-is-hanging-for-long-time/m-p/321984#M71170</guid>
      <dc:creator>bmsampath</dc:creator>
      <dc:date>2017-01-02T18:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction from SASHELP.VCLOUMN is hanging for long time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extraction-from-SASHELP-VCLOUMN-is-hanging-for-long-time/m-p/321987#M71171</link>
      <description>&lt;P&gt;If you do not subset on the LIBNAME value then SAS must open every table in every library to get column attributes. &amp;nbsp;You probably have many open librefs and that is why it is taking such a long time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use DICTIONARY.COLUMNS and subset on LIBNAME then it can run faster. &amp;nbsp;Using SASHELP.VCOLUMN will normally have worse performance since SAS does not pass the WHERE condition through the view.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql NOPRINT;
  select name
    into :col separated by "||','||" 
  from DICTIONARY.COLUMNS
  where libname='WORK' 
    and memname="COUNTRY_TRANS" 
    and upcase(name) not in("SECT_SICSID","_NAME_","_LABEL_")
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But in many situations you will still get faster results by using PROC CONTENTS to query just one table at a time.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=work.country_trans noprint out=_contents_ ;
run;

proc sql NOPRINT;
  select name
    into :col separated by "||','||" 
  from _contents_ 
  where upcase(name) not in("SECT_SICSID","_NAME_","_LABEL_")
  ;
  drop table _contents_ ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2017 18:31:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extraction-from-SASHELP-VCLOUMN-is-hanging-for-long-time/m-p/321987#M71171</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-01-02T18:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction from SASHELP.VCLOUMN is hanging for long time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extraction-from-SASHELP-VCLOUMN-is-hanging-for-long-time/m-p/322032#M71185</link>
      <description>&lt;P&gt;When you use SASHELP.VCOLUMN instead of DICTIONARY.COLUMNS, SAS first executes the view (scanning&amp;nbsp;&lt;U&gt;all&lt;/U&gt; tables in&amp;nbsp;&lt;U&gt;all&lt;/U&gt; libraries) before applying the WHERE condition; given enough tables in your libraries, this can easily explain your 3 hours.&lt;/P&gt;
&lt;P&gt;With DICTIONARY.COLUMNS, PROC SQL can optimize the table scans according to the WHERE.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 00:18:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extraction-from-SASHELP-VCLOUMN-is-hanging-for-long-time/m-p/322032#M71185</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-03T00:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction from SASHELP.VCLOUMN is hanging for long time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extraction-from-SASHELP-VCLOUMN-is-hanging-for-long-time/m-p/322203#M71271</link>
      <description>&lt;P&gt;I'm kind of interested in how you will use that resulting macro variable. Embedded quotes inside macro variables are often sources of headaches at later steps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have the || as use in concatenation then you may well want to consider use of one of the CAT functions as || has the potential to have lots of blanks embedded in the result&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 17:06:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extraction-from-SASHELP-VCLOUMN-is-hanging-for-long-time/m-p/322203#M71271</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-03T17:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction from SASHELP.VCLOUMN is hanging for long time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extraction-from-SASHELP-VCLOUMN-is-hanging-for-long-time/m-p/322205#M71272</link>
      <description>&lt;P&gt;Adding libname = 'WORK' in where clause solved the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks everyone.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 17:10:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extraction-from-SASHELP-VCLOUMN-is-hanging-for-long-time/m-p/322205#M71272</guid>
      <dc:creator>bmsampath</dc:creator>
      <dc:date>2017-01-03T17:10:17Z</dc:date>
    </item>
  </channel>
</rss>

