<?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 Code Optimisation and transformation help based on existing code? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Code-Optimisation-and-transformation-help-based-on-existing-code/m-p/174803#M264583</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8173"&gt;&lt;STRONG&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8172" style="font-size: 12pt; font-family: 'Trebuchet MS','sans-serif';"&gt;Code below consolidates the oracle tables and columns that don’t have blank values. I request your help in adding the content to perform the same on sas native tables by identifying the libname that is either oracle or sas)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8174"&gt;&lt;STRONG style="font-size: 12pt; font-family: 'Trebuchet MS','sans-serif';"&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8176"&gt;&lt;STRONG&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8175" style="font-family: 'Trebuchet MS','sans-serif'; font-size: 12pt;"&gt;Can you please help in&amp;nbsp; transforming it&amp;nbsp; by converting the code below into a macro that should accept the lib name as parameters?&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8353"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Trebuchet MS', 'sans-serif';"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8184"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;LIBNAME&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; jbl &lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8354" style="font-family: 'Courier New'; color: blue; background: white;"&gt;ORACLE&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;PATH&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8183" style="font-family: 'Courier New'; color: black; background: white;"&gt;=ahbdwh&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;SCHEMA&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=sys&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;USER&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=jbl30&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;PASSWORD&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;"{SAS002}05C6153E155987C63225469B"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8355"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;LIBNAME&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; jbl_jbl &lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8356" style="font-family: 'Courier New'; color: blue; background: white;"&gt;ORACLE&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;PATH&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=ahbdwh&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;SCHEMA&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=jbl30&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;USER&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=jbl30&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;PASSWORD&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8357" style="font-family: 'Courier New'; color: purple; background: white;"&gt;"{SAS002}05C6153E155987C63225469B"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8358"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;libname&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; stat &lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8359" style="font-family: 'Courier New'; color: purple; background: white;"&gt;"c:\SASCONFIG\Lev1\SASApp\Data\stat"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8360"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8344"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;%macro&lt;/STRONG&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8343" style="font-family: 'Courier New'; color: black; background: white;"&gt; checkds(dsn);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8361"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8362" style="font-family: 'Courier New'; color: black; background: white;"&gt;(exist(&amp;amp;dsn)) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8182"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;data &amp;amp;dsn ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8177"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;set &amp;amp;dsn;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8178"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;stop;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8179"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8219"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8220"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; checkds;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8221"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8229"&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8228" style="font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;checkds&lt;/EM&gt;&lt;/STRONG&gt;(stat.tbl_column_count);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8222"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8230"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;Proc&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;STRONG id="yui_3_16_0_1_1420731982036_8342"&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8341" style="font-family: 'Courier New'; color: navy; background: white;"&gt;sql&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8186"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;alter&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;table&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8185" style="font-family: 'Courier New'; color: black; background: white;"&gt; stat.tbl_column_count &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;modify&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; table_name char(&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;50&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8180"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8181"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8187"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;Proc&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8227" style="font-family: 'Courier New'; color: blue; background: white;"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8188"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;create&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; tables &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; table_name &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; jbl.user_tables &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; num_rows&amp;gt;&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; table_name &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;not&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;like&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'%HIS%'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8336"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8218"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;Create&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;table&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8217" style="font-family: 'Courier New'; color: black; background: white;"&gt; alpha_num_columns &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8338"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8337" style="font-family: 'Courier New'; color: black; background: white;"&gt; utc.table_name,utc.column_name &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; jbl.user_tab_columns UTC &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;INNER&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;JOIN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; TABLES T &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;ON&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; UTC.table_name=t.table_name&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8339"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8340" style="font-family: 'Courier New'; color: black; background: white;"&gt; utc.data_type &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;not&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; (&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8366" style="font-family: 'Courier New'; color: purple; background: white;"&gt;'NUMBER'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'DECIMAL'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8245"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8236"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;Create&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; num_columns &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8190"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8189" style="font-family: 'Courier New'; color: black; background: white;"&gt; utc.table_name,utc.column_name &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; jbl.user_tab_columns UTC &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;INNER&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;JOIN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; TABLES T &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;ON&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; UTC.table_name=t.table_name&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8237"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; utc.data_type &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; (&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8365" style="font-family: 'Courier New'; color: purple; background: white;"&gt;'NUMBER'&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8367" style="font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8244" style="font-family: 'Courier New'; color: purple; background: white;"&gt;'DECIMAL'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8216"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8363"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8238"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;Proc&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8364"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; count(*) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;into&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8368" style="font-family: 'Courier New'; color: black; background: white;"&gt; :mv_count_table &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; tables;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8243"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8191"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;%macro&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;STRONG&gt;&lt;EM&gt;table_count&lt;/EM&gt;&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8240"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; i= &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%to&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8239" style="font-family: 'Courier New'; color: black; background: white;"&gt; &amp;amp;mv_count_table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8192"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8241"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8369"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;set tables (firstobs=&amp;amp;i obs=&amp;amp;i);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8371"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;call symputx (&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'mv_tab'&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8370" style="font-family: 'Courier New'; color: black; background: white;"&gt;,table_name);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8193"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8372"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8215"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;create table table_alpha_num as&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8242"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;select column_name from alpha_num_columns where&amp;nbsp; table_name=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;mv_tab"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;select count(*) into :CCount from table_alpha_num;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8374"&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8373" style="font-family: 'Courier New'; color: black; background: white;"&gt;select count(*)into :avl from num_columns where&amp;nbsp; table_name=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;mv_tab"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;select column_name into :Nname separated by &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; from num_columns where&amp;nbsp; table_name=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;mv_tab"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8194"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8195"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &amp;amp;avl ne &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8197"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Proc means data =&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: teal; background: white;"&gt;jbl_jbl.&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8196" style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;amp;mv_tab nway noprint n;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;output out=column_stat (where=(_stat_=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'N'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;) keep=_stat_ &amp;amp;Nname&amp;nbsp; );&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8375"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;data column_stat;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8214"&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8213" style="font-family: 'Courier New'; color: black; background: white;"&gt;set column_stat(Drop=_STAT_);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Proc transpose data=column_stat out=num_column_count(keep=_name_ col1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8198"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;alter table num_column_count modify _name_ char(&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;256&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;data num_column_count;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8376"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set num_column_count;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;length table_name &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: teal; background: white;"&gt;$50.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;table_name=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;mv_tab"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8212"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8379"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8211"&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8210" style="font-family: 'Courier New'; color: black; background: white;"&gt;proc append base=stat.tbl_column_count data=num_column_count force;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8377"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8209"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8378"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8199"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8380"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%If&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &amp;amp;CCount ne &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8208"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;data char;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8381"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;set table_alpha_num ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8383"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;column=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;"count("&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;||column_name||&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8382" style="font-family: 'Courier New'; color: purple; background: white;"&gt;") as "&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;||column_name;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8384"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8207"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;select column into :column SEPARATED by &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;','&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; from char;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;create table alpha_num_count as&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;select &amp;amp;column from &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: teal; background: white;"&gt;jbl_jbl.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;amp;mv_tab;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8201"&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8200" style="font-family: 'Courier New'; color: black; background: white;"&gt;Proc transpose data=alpha_num_count out=alpha_num_column_count(keep=_name_ col1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8389"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8388"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8387"&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8390" style="font-family: 'Courier New'; color: black; background: white;"&gt;alter table alpha_num_column_count modify _name_ char(&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;256&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8386"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8385"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8206"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;data alpha_num_column_count;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set alpha_num_column_count;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8391"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;length table_name &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: teal; background: white;"&gt;$50.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8202"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;table_name=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;mv_tab"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;proc append base=stat.tbl_column_count data=alpha_num_column_count force;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8396"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8395"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8394"&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8409" style="font-family: 'Courier New'; color: black; background: white;"&gt;data stat.tbl_column_count ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8393"&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8392" style="font-family: 'Courier New'; color: black; background: white;"&gt;set stat.tbl_column_count(where=(col1&amp;gt;&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8397"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8398"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8205"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8399"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;table_count&lt;/EM&gt;&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Jan 2015 16:23:00 GMT</pubDate>
    <dc:creator>Allaluiah</dc:creator>
    <dc:date>2015-01-08T16:23:00Z</dc:date>
    <item>
      <title>Code Optimisation and transformation help based on existing code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Code-Optimisation-and-transformation-help-based-on-existing-code/m-p/174803#M264583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8173"&gt;&lt;STRONG&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8172" style="font-size: 12pt; font-family: 'Trebuchet MS','sans-serif';"&gt;Code below consolidates the oracle tables and columns that don’t have blank values. I request your help in adding the content to perform the same on sas native tables by identifying the libname that is either oracle or sas)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8174"&gt;&lt;STRONG style="font-size: 12pt; font-family: 'Trebuchet MS','sans-serif';"&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8176"&gt;&lt;STRONG&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8175" style="font-family: 'Trebuchet MS','sans-serif'; font-size: 12pt;"&gt;Can you please help in&amp;nbsp; transforming it&amp;nbsp; by converting the code below into a macro that should accept the lib name as parameters?&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8353"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Trebuchet MS', 'sans-serif';"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8184"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;LIBNAME&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; jbl &lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8354" style="font-family: 'Courier New'; color: blue; background: white;"&gt;ORACLE&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;PATH&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8183" style="font-family: 'Courier New'; color: black; background: white;"&gt;=ahbdwh&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;SCHEMA&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=sys&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;USER&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=jbl30&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;PASSWORD&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;"{SAS002}05C6153E155987C63225469B"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8355"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;LIBNAME&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; jbl_jbl &lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8356" style="font-family: 'Courier New'; color: blue; background: white;"&gt;ORACLE&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;PATH&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=ahbdwh&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;SCHEMA&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=jbl30&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;USER&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=jbl30&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;PASSWORD&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8357" style="font-family: 'Courier New'; color: purple; background: white;"&gt;"{SAS002}05C6153E155987C63225469B"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8358"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;libname&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; stat &lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8359" style="font-family: 'Courier New'; color: purple; background: white;"&gt;"c:\SASCONFIG\Lev1\SASApp\Data\stat"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8360"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8344"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;%macro&lt;/STRONG&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8343" style="font-family: 'Courier New'; color: black; background: white;"&gt; checkds(dsn);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8361"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8362" style="font-family: 'Courier New'; color: black; background: white;"&gt;(exist(&amp;amp;dsn)) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8182"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;data &amp;amp;dsn ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8177"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;set &amp;amp;dsn;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8178"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;stop;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8179"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8219"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8220"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; checkds;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8221"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8229"&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8228" style="font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;checkds&lt;/EM&gt;&lt;/STRONG&gt;(stat.tbl_column_count);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8222"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8230"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;Proc&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;STRONG id="yui_3_16_0_1_1420731982036_8342"&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8341" style="font-family: 'Courier New'; color: navy; background: white;"&gt;sql&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8186"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;alter&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;table&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8185" style="font-family: 'Courier New'; color: black; background: white;"&gt; stat.tbl_column_count &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;modify&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; table_name char(&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;50&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8180"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8181"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8187"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;Proc&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8227" style="font-family: 'Courier New'; color: blue; background: white;"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8188"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;create&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; tables &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; table_name &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; jbl.user_tables &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; num_rows&amp;gt;&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; table_name &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;not&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;like&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'%HIS%'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8336"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8218"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;Create&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;table&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8217" style="font-family: 'Courier New'; color: black; background: white;"&gt; alpha_num_columns &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8338"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8337" style="font-family: 'Courier New'; color: black; background: white;"&gt; utc.table_name,utc.column_name &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; jbl.user_tab_columns UTC &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;INNER&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;JOIN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; TABLES T &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;ON&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; UTC.table_name=t.table_name&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8339"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8340" style="font-family: 'Courier New'; color: black; background: white;"&gt; utc.data_type &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;not&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; (&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8366" style="font-family: 'Courier New'; color: purple; background: white;"&gt;'NUMBER'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'DECIMAL'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8245"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8236"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;Create&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; num_columns &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8190"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8189" style="font-family: 'Courier New'; color: black; background: white;"&gt; utc.table_name,utc.column_name &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; jbl.user_tab_columns UTC &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;INNER&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;JOIN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; TABLES T &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;ON&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; UTC.table_name=t.table_name&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8237"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; utc.data_type &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; (&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8365" style="font-family: 'Courier New'; color: purple; background: white;"&gt;'NUMBER'&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8367" style="font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8244" style="font-family: 'Courier New'; color: purple; background: white;"&gt;'DECIMAL'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8216"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8363"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8238"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;Proc&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8364"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; count(*) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;into&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8368" style="font-family: 'Courier New'; color: black; background: white;"&gt; :mv_count_table &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; tables;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8243"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8191"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;%macro&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;STRONG&gt;&lt;EM&gt;table_count&lt;/EM&gt;&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8240"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; i= &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%to&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8239" style="font-family: 'Courier New'; color: black; background: white;"&gt; &amp;amp;mv_count_table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8192"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8241"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8369"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;set tables (firstobs=&amp;amp;i obs=&amp;amp;i);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8371"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;call symputx (&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'mv_tab'&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8370" style="font-family: 'Courier New'; color: black; background: white;"&gt;,table_name);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8193"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8372"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8215"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;create table table_alpha_num as&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8242"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;select column_name from alpha_num_columns where&amp;nbsp; table_name=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;mv_tab"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;select count(*) into :CCount from table_alpha_num;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8374"&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8373" style="font-family: 'Courier New'; color: black; background: white;"&gt;select count(*)into :avl from num_columns where&amp;nbsp; table_name=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;mv_tab"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;select column_name into :Nname separated by &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; from num_columns where&amp;nbsp; table_name=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;mv_tab"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8194"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8195"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &amp;amp;avl ne &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8197"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Proc means data =&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: teal; background: white;"&gt;jbl_jbl.&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8196" style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;amp;mv_tab nway noprint n;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;output out=column_stat (where=(_stat_=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'N'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;) keep=_stat_ &amp;amp;Nname&amp;nbsp; );&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8375"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;data column_stat;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8214"&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8213" style="font-family: 'Courier New'; color: black; background: white;"&gt;set column_stat(Drop=_STAT_);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Proc transpose data=column_stat out=num_column_count(keep=_name_ col1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8198"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;alter table num_column_count modify _name_ char(&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;256&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;data num_column_count;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8376"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set num_column_count;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;length table_name &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: teal; background: white;"&gt;$50.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;table_name=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;mv_tab"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8212"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8379"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8211"&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8210" style="font-family: 'Courier New'; color: black; background: white;"&gt;proc append base=stat.tbl_column_count data=num_column_count force;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8377"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8209"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8378"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8199"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8380"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%If&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &amp;amp;CCount ne &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8208"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;data char;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8381"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;set table_alpha_num ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8383"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;column=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;"count("&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;||column_name||&lt;/SPAN&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8382" style="font-family: 'Courier New'; color: purple; background: white;"&gt;") as "&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;||column_name;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8384"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8207"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;select column into :column SEPARATED by &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;','&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; from char;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;create table alpha_num_count as&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;select &amp;amp;column from &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: teal; background: white;"&gt;jbl_jbl.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;amp;mv_tab;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8201"&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8200" style="font-family: 'Courier New'; color: black; background: white;"&gt;Proc transpose data=alpha_num_count out=alpha_num_column_count(keep=_name_ col1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8389"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8388"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8387"&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8390" style="font-family: 'Courier New'; color: black; background: white;"&gt;alter table alpha_num_column_count modify _name_ char(&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;256&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8386"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8385"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8206"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;data alpha_num_column_count;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set alpha_num_column_count;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8391"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;length table_name &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: teal; background: white;"&gt;$50.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8202"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;table_name=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;mv_tab"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;proc append base=stat.tbl_column_count data=alpha_num_column_count force;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8396"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8395"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8394"&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8409" style="font-family: 'Courier New'; color: black; background: white;"&gt;data stat.tbl_column_count ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8393"&gt;&lt;SPAN id="yui_3_16_0_1_1420731982036_8392" style="font-family: 'Courier New'; color: black; background: white;"&gt;set stat.tbl_column_count(where=(col1&amp;gt;&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8397"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8398"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8205"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="yiv5636827903MsoNormal" id="yui_3_16_0_1_1420731982036_8399"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;table_count&lt;/EM&gt;&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 16:23:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Code-Optimisation-and-transformation-help-based-on-existing-code/m-p/174803#M264583</guid>
      <dc:creator>Allaluiah</dc:creator>
      <dc:date>2015-01-08T16:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Code Optimisation and transformation help based on existing code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Code-Optimisation-and-transformation-help-based-on-existing-code/m-p/174804#M264584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For optimization, point out what part(s) in the macro that suffers.&lt;/P&gt;&lt;P&gt;Since I don't know anything about the requirements for this macro, it's hard to tell what changes that can be made.&lt;/P&gt;&lt;P&gt;You can use the attrc() function with the 'ENGINE' parameter to find out which data format your table is in.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 09:48:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Code-Optimisation-and-transformation-help-based-on-existing-code/m-p/174804#M264584</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-01-09T09:48:47Z</dc:date>
    </item>
  </channel>
</rss>

