<?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: How to create info based on an unknown imported dataset (no clue of # and kind of variables)? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-info-based-on-an-unknown-imported-dataset-no-clue/m-p/154410#M30289</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc summary..... &lt;A href="http://support.sas.com/resources/papers/proceedings10/026-2010.pdf" title="http://support.sas.com/resources/papers/proceedings10/026-2010.pdf"&gt;http://support.sas.com/resources/papers/proceedings10/026-2010.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 24 Nov 2013 09:31:25 GMT</pubDate>
    <dc:creator>jakarman</dc:creator>
    <dc:date>2013-11-24T09:31:25Z</dc:date>
    <item>
      <title>How to create info based on an unknown imported dataset (no clue of # and kind of variables)?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-info-based-on-an-unknown-imported-dataset-no-clue/m-p/154409#M30288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm facing the following 'challenge': based on *any* imported dataset with an unknown number / set of variables (by proc import, or just simply dragged into Enterprise Guide) I want to create the following information among other things (as a report or output in a dataset):&lt;/P&gt;&lt;P&gt;1) The number of records filled and/or blanc (OBC_ID=_n_ creates a copy of obs, always filled, so that should be an easy step in the process)&lt;/P&gt;&lt;P&gt;2) Per variable (presented by variable name), the total sum of all records (in case of numeric field)&lt;/P&gt;&lt;P&gt;3) Per variable (presented by variable name), the ratio filled records vs. blanc records, so the % of the variable name that is blanc (for numeric and character variables)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The dataset vcolumn in SASHELP contains all variables of the (random) imported set, but not the info as needed unfortunately. For this assignment, it looks like I need to create a loop in which all unknown variables are assigned to a macro, and from there the code should read out all records of the variable, so the output can be generated? Should that be a good approach? If so, how can this be done?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, the output has to provide me with information as presented below (all variables of the imported dataset which contains unknown variables should be present, so the dummy dataset as presented as the desired output below does contain 7 variables):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***************************&lt;/P&gt;&lt;P&gt;Output, based on a random imported set:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variable name | number of records in total dataset |&amp;nbsp;&amp;nbsp;&amp;nbsp; total sum of records&amp;nbsp;&amp;nbsp;&amp;nbsp; | % blanc (or % filled)&lt;/P&gt;&lt;P&gt;Video_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1600&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1280800&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp; 100%&lt;/P&gt;&lt;P&gt;Video_ID2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 800&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 158766&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp; 50%&lt;/P&gt;&lt;P&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1600&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N/A (Char)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp; 100%&lt;/P&gt;&lt;P&gt;Address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 400&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N/A (Char)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp; 25%&lt;/P&gt;&lt;P&gt;Amount&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1600&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5500&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp; 100%&lt;/P&gt;&lt;P&gt;Date_rent&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1600&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp; N/A (output=sum dates)&amp;nbsp; |&amp;nbsp; 100%&lt;/P&gt;&lt;P&gt;Date_due&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1600&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp; N/A (output=sum dates)&amp;nbsp; |&amp;nbsp; 100%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can this be done...? There's no dataset in SASHELP with such info, if I'm correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your input!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Nov 2013 20:19:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-info-based-on-an-unknown-imported-dataset-no-clue/m-p/154409#M30288</guid>
      <dc:creator>Wouter</dc:creator>
      <dc:date>2013-11-23T20:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to create info based on an unknown imported dataset (no clue of # and kind of variables)?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-info-based-on-an-unknown-imported-dataset-no-clue/m-p/154410#M30289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc summary..... &lt;A href="http://support.sas.com/resources/papers/proceedings10/026-2010.pdf" title="http://support.sas.com/resources/papers/proceedings10/026-2010.pdf"&gt;http://support.sas.com/resources/papers/proceedings10/026-2010.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Nov 2013 09:31:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-info-based-on-an-unknown-imported-dataset-no-clue/m-p/154410#M30289</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-11-24T09:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to create info based on an unknown imported dataset (no clue of # and kind of variables)?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-info-based-on-an-unknown-imported-dataset-no-clue/m-p/154411#M30290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, most likely that will be incorporated at the end of the code (or somtething similar). But for this, you *need* the variable names. And... these are unknown in 'my project'. So the question leaves us with: how to put in unknown (number of) variables into this PROC? Create a DO loop --&amp;gt; macro's?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Nov 2013 10:03:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-info-based-on-an-unknown-imported-dataset-no-clue/m-p/154411#M30290</guid>
      <dc:creator>Wouter</dc:creator>
      <dc:date>2013-11-24T10:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to create info based on an unknown imported dataset (no clue of # and kind of variables)?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-info-based-on-an-unknown-imported-dataset-no-clue/m-p/154412#M30291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you omit the var statement it will produce a report for all of them.&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146757.htm" title="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146757.htm"&gt;Base SAS(R) 9.2 Procedures Guide&lt;/A&gt; var statement proc summary&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is part of the concepts the variables are not necessary strictly defined. This is quite different is a lot of other languages.&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/64801/HTML/default/viewer.htm#p0wphcpsfgx6o7n1sjtqzizp1n39.htm" title="http://support.sas.com/documentation/cdl/en/lrcon/64801/HTML/default/viewer.htm#p0wphcpsfgx6o7n1sjtqzizp1n39.htm"&gt;SAS(R) 9.4 Language Reference: Concepts&lt;/A&gt; SAS Variable list. You can define ranges but also having special list like _all_ _numeric_ _character_&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is part of the SAS VA promotion this behavior is coming back at more parts. Just klik klik and a lot of programming decisions are automated behind screens.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Nov 2013 15:03:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-info-based-on-an-unknown-imported-dataset-no-clue/m-p/154412#M30291</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-11-24T15:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to create info based on an unknown imported dataset (no clue of # and kind of variables)?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-info-based-on-an-unknown-imported-dataset-no-clue/m-p/154413#M30292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Most SAS procedures have no need to know the variable names.&amp;nbsp; &lt;/P&gt;&lt;P&gt;And in many places you can substitute variables lists like _ALL_, _NUMERIC_ or _CHARACTER_.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Nov 2013 15:44:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-info-based-on-an-unknown-imported-dataset-no-clue/m-p/154413#M30292</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-11-24T15:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to create info based on an unknown imported dataset (no clue of # and kind of variables)?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-info-based-on-an-unknown-imported-dataset-no-clue/m-p/154414#M30293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There's at least 2 solutions on this forum, one from me and one from someone else that pretty much are the full solution to this question. &lt;/P&gt;&lt;P&gt;Some more searching will find you the full answer. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some things to think about, SASHELP or the Dictionary tables don't have the full answer, but do they give you other things to get there, i.e. variable names? But as Tom's mentioned you don't even really need those &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Nov 2013 20:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-info-based-on-an-unknown-imported-dataset-no-clue/m-p/154414#M30293</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-11-24T20:27:48Z</dc:date>
    </item>
  </channel>
</rss>

