<?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: Urgent in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46705#M12464</link>
    <description>The SAS support website &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt; has a wealth of examples, samples and also DOC references.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
An Introduction to SAS PROC SQL&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi27/p070-27.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi27/p070-27.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
SAS-hosted Documentation:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/" target="_blank"&gt;http://support.sas.com/documentation/&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
SAS Support website:&lt;BR /&gt;
&lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;</description>
    <pubDate>Tue, 16 Sep 2008 12:15:17 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2008-09-16T12:15:17Z</dc:date>
    <item>
      <title>Urgent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46702#M12461</link>
      <description>Hi everyone,&lt;BR /&gt;
&lt;BR /&gt;
I really need Help in this one.&lt;BR /&gt;
&lt;BR /&gt;
I need to list all the non empty columns of all tables in a libname.&lt;BR /&gt;
&lt;BR /&gt;
How can I do this?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance</description>
      <pubDate>Tue, 16 Sep 2008 10:37:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46702#M12461</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-16T10:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46703#M12462</link>
      <description>I suggest that you build a macro that first read out all tables (and their column names) for a specific libname, using DICTIONARY.TABLES (from PROC SQL), then maybe do PROC FREQ on them to find out which columns has nonmissing values.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Linus</description>
      <pubDate>Tue, 16 Sep 2008 10:56:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46703#M12462</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2008-09-16T10:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46704#M12463</link>
      <description>Thank you very much for your quick answer, since this question is really urgent.&lt;BR /&gt;
&lt;BR /&gt;
Since I am a newbie at SAS programming, I have one more question.&lt;BR /&gt;
&lt;BR /&gt;
After making my first table (Table, Columns) how can I use it as an input in the from condition for another query?&lt;BR /&gt;
&lt;BR /&gt;
Can you give me an example, it would be great.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance.</description>
      <pubDate>Tue, 16 Sep 2008 11:01:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46704#M12463</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-16T11:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46705#M12464</link>
      <description>The SAS support website &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt; has a wealth of examples, samples and also DOC references.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
An Introduction to SAS PROC SQL&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi27/p070-27.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi27/p070-27.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
SAS-hosted Documentation:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/" target="_blank"&gt;http://support.sas.com/documentation/&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
SAS Support website:&lt;BR /&gt;
&lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;</description>
      <pubDate>Tue, 16 Sep 2008 12:15:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46705#M12464</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2008-09-16T12:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46706#M12465</link>
      <description>Thank you very much for the resources.</description>
      <pubDate>Tue, 16 Sep 2008 12:51:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46706#M12465</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-16T12:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46707#M12466</link>
      <description>for now I am trying a personnal solution:&lt;BR /&gt;
&lt;BR /&gt;
proc sql print;&lt;BR /&gt;
select distinct T.memname into :nomesTabelas separated by ' '&lt;BR /&gt;
from DICTIONARY.COLUMNS C,&lt;BR /&gt;
                DICTIONARY.TABLES T&lt;BR /&gt;
where C.libname = 'test' AND T.libname = 'test' and&lt;BR /&gt;
C.memname = T.memname&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
proc sql print;&lt;BR /&gt;
select count(distinct T.memname) into :nTabelas separated by ' '&lt;BR /&gt;
from DICTIONARY.COLUMNS C,&lt;BR /&gt;
                DICTIONARY.TABLES T&lt;BR /&gt;
where C.libname = 'test' AND T.libname = 'test' and&lt;BR /&gt;
C.memname = T.memname&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
%put &amp;amp;nomesTabelas;&lt;BR /&gt;
&lt;BR /&gt;
data tabelas;&lt;BR /&gt;
array tabelas {&amp;amp;nTabelas} &amp;amp;nomesTabelas;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
after gathering all the table names in the libname I want to iterate&lt;BR /&gt;
it a select all columns to check if they are empty.&lt;BR /&gt;
&lt;BR /&gt;
Two more questions:&lt;BR /&gt;
&lt;BR /&gt;
1 - How can I doi that? I am trying like this:&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
do i = 1 to &amp;amp;nTabelas;&lt;BR /&gt;
        proc sql print;&lt;BR /&gt;
        select name into :nomesColunas separated by ' '&lt;BR /&gt;
        from DDS..&amp;amp;tabelas&lt;I&gt;;&lt;BR /&gt;
end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
but it doesnt seems to work,&lt;BR /&gt;
&lt;BR /&gt;
2 - How to find if the column is empty in the dataset?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance.&lt;/I&gt;</description>
      <pubDate>Wed, 17 Sep 2008 13:58:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46707#M12466</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-17T13:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46708#M12467</link>
      <description>I have a question what is an empty column?&lt;BR /&gt;
&lt;BR /&gt;
All datasets columns are listen in a view &lt;B&gt;sashelp.vcolumn&lt;/B&gt;.</description>
      <pubDate>Wed, 17 Sep 2008 14:06:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46708#M12467</guid>
      <dc:creator>SAS_user</dc:creator>
      <dc:date>2008-09-17T14:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46709#M12468</link>
      <description>Might I suggest you create a new discussion thread/post when you have a different question.  Also, a SUBJECT that relates to your question would be helpful.&lt;BR /&gt;
&lt;BR /&gt;
SAS variables are either NUMERIC or CHARACTER in type.  SAS NUMERIC type variables can have a value/state considered to be a "missing value".  SAS CHARACTER variables can have a value/state some consider to be "missing" value but actually the value is either blank or non-blank.  The SAS MISSING function can be applied to either CHARACTER or NUMERIC type variables.  Some individuals relate SAS environment terminology to other DBMS nomemclature -- so I would say that a reference to an "empty" column is either a blank or missing value for a particular SAS variable.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Recommended reading on SAS variables:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/59522/HTML/default/a000998827.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/59522/HTML/default/a000998827.htm&lt;/A&gt;</description>
      <pubDate>Wed, 17 Sep 2008 16:36:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46709#M12468</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2008-09-17T16:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46710#M12469</link>
      <description>Hi:&lt;BR /&gt;
  About this piece of your question:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data _null_;&lt;BR /&gt;
   do i = 1 to &amp;amp;nTabelas;&lt;BR /&gt;
      proc sql print;&lt;BR /&gt;
        select name into :nomesColunas separated by ' '&lt;BR /&gt;
        from DDS..&amp;amp;tabelas;&lt;BR /&gt;
   end;&lt;BR /&gt;
   run;&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
You cannot have a PROC SQL step inside a DATA step program. You must investigate other ways (such as a macro program which contains your PROC SQL code inside a macro do loop or a DATA step program which performs a CALL EXECUTE).&lt;BR /&gt;
&lt;BR /&gt;
In general, SAS programs are composed of PROCEDURE steps and DATA steps. It is not appropriate to put an SQL step inside a DATA step in open code. When you got the error message about having an unclosed DO block, that was SAS trying to show you that the beginning of the PROC SQL step caused the compiler to detect that the DO block in the DATA step program had not "finished":&lt;BR /&gt;
[pre]&lt;BR /&gt;
12   data _null_;&lt;BR /&gt;
13      do i = 1 to &amp;amp;nTabelas;&lt;BR /&gt;
                        &lt;BR /&gt;
NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.03 seconds&lt;BR /&gt;
      cpu time            0.00 seconds&lt;BR /&gt;
      &lt;BR /&gt;
&lt;BR /&gt;
                                &lt;BR /&gt;
14         proc sql print;&lt;BR /&gt;
          -&lt;BR /&gt;
          117&lt;BR /&gt;
ERROR 117-185: There was 1 unclosed DO block.&lt;BR /&gt;
                          &lt;BR /&gt;
15           select name into :nC separated by ' '&lt;BR /&gt;
16           from sashelp.class;&lt;BR /&gt;
17      end;&lt;BR /&gt;
        ---&lt;BR /&gt;
        180&lt;BR /&gt;
ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;
                    &lt;BR /&gt;
18      run;&lt;BR /&gt;
NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect.&lt;BR /&gt;
NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;
NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;
      real time           0.51 seconds&lt;BR /&gt;
      cpu time            0.09 seconds&lt;BR /&gt;
[/pre]&lt;BR /&gt;
     &lt;BR /&gt;
&lt;BR /&gt;
If you DO set up code to execute (via CALL EXECUTE), it executes AFTER the data step has finished building the appropriate statements.&lt;BR /&gt;
&lt;BR /&gt;
I usually recommend a more conservative approach which would be to start with a macro program and understand how that works first before jumping into CALL EXECUTE. &lt;BR /&gt;
&lt;BR /&gt;
The macro facility documentation is quite thorough and contains examples of writing programs that execute based on iterations through a macro %DO loop (as opposed to a data step DO loop).&lt;BR /&gt;
&lt;BR /&gt;
This paper is also a good resource for people who are just learning about macro processing: &lt;A href="http://www2.sas.com/proceedings/sugi28/056-28.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi28/056-28.pdf&lt;/A&gt; &lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 17 Sep 2008 20:42:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46710#M12469</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-09-17T20:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46711#M12470</link>
      <description>Sorry if i was misunderstood. But the topic in this thread was:&lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;I need to list all the non empty columns of all tables in a libname.&lt;/I&gt;&lt;BR /&gt;
&lt;BR /&gt;
So i wanted to ask Eikon, how he describes a phrase "empty column".</description>
      <pubDate>Thu, 18 Sep 2008 07:13:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46711#M12470</guid>
      <dc:creator>SAS_user</dc:creator>
      <dc:date>2008-09-18T07:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46712#M12471</link>
      <description>My apology to the poster "SAS user" -- I read the reply incorrectly, not noticing the sender was different than the original.&lt;BR /&gt;
&lt;BR /&gt;
Scott</description>
      <pubDate>Thu, 18 Sep 2008 13:05:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urgent/m-p/46712#M12471</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2008-09-18T13:05:54Z</dc:date>
    </item>
  </channel>
</rss>

