<?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: **** Thank you **** Reeza, Tom, Kurt  How to count missing and non-missing data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739414#M230783</link>
    <description>&lt;P&gt;Maxim 1. So start here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/pgmsashome/home.htm#p0258wnlz15ubrn1vqfalp6l4hjz" target="_blank" rel="noopener"&gt;Programming Documentation for SAS® 9.4 and SAS® Viya®&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From there,&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/lefunctionsref/p1q8bq2v0o11n6n1gpij335fqpph.htm" target="_blank" rel="noopener"&gt;Functions and CALL Routines&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/lestmtsref/p0gct6ariiecuhn15jkq8pzfzgef.htm" target="_blank" rel="noopener"&gt;DATA Step Statements&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and the procedures, e.g.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/proc/p1xidhqypi0fnwn1if8opjpqpbmn.htm" target="_blank" rel="noopener"&gt;FORMAT Procedure&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/proc/n1xno5xgs39b70n0zydov0owajj8.htm" target="_blank" rel="noopener"&gt;TRANSPOSE Procedure&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/procstat/procstat_freq_toc.htm" target="_blank" rel="noopener"&gt;FREQ Procedure&lt;/A&gt;&amp;nbsp;(which is listed under "Base SAS Statistical Procedures")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ODS is listed under "Output and Graphics"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Further, make use of Maxim 6 (Google Is Your Friend). I have found that the search engine has become very good at answering questions, like "how do i create html with sas ods?". Such questions (always include the keyword "sas") quickly lead you to the relevant documentation, postings here on the community, and papers from the many SAS conventions. Especially the papers provide "how to" cookbooks.&lt;/P&gt;</description>
    <pubDate>Thu, 06 May 2021 07:37:34 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-05-06T07:37:34Z</dc:date>
    <item>
      <title>**** Thank you **** Reeza, Tom, Kurt  How to count missing and non-missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739326#M230735</link>
      <description>&lt;P&gt;Thanks to you all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once I added all the code that Reeza originally sent the code worked well.&lt;/P&gt;
&lt;P&gt;The entire code is shown.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What literature in the SAS materials would I go to cover what the code does in this problem?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;wklierman&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data OPERA.OPERA_All_2;
        call streaminit(45);
		length obs 8.;
		array vars(*) $3. DLEAdi DMHDdi DCOMdi DEARdi DEYEdi DDRSdi DOUTdi DREMdi DPHYdi;

		do obs= 1 to 200; *181308;

		         do i=1 to dim(vars);
				         vars(i)= put(rand('table', 0.4, 0.4, 0.2), Z3.);
						 if vars(i) = '003' then call missing(vars(i));
						 
				 end;
				 output;
		end;
		drop i;
run;

*set input data set  name;
%let INPUT_DSN = OPERA.OPERA_All_2;
%let OUTPUT_DSN = OPERA.OPERA_All_4;
* create format for missing;

proc format;
  value $ missfmt ' ' = "Missing"  other = "Not_Missing";
  value nmissfmt . ="Missing" other="Not_Missing";
run;

* proc freq to count missing / non-missing;
ods select none;
* turns off the output so the results sdo not get too messy;
ods table onewayfreqs=temp;

proc freq data=&amp;amp;INPUT_DSN.;
    table _all_ / missing;
	format _numeric_ nmissfmt. _character_ $missfmt.;
run;

ods select all;
* Format output;   

Data OPERA.OPERA_ALL_2A;
   length variable $32.  variable_value  $50.;
   set temp;
   Variable=scan(table, 2);
   Variable_Value=strip(trim(vvaluex(variable)));
   presentation = catt(frequency, " (", trim(put(percent/100, percent7.1)), ")");
   keep variable variable_value frequency percent cum: presentation;
   label variable='Variable' variable_value='Variable_Value';
run;

proc sort Data = OPERA.OPERA_ALL_2A;
   by Variable;
run;

* make a wide data set for presentation, with values a N (Percent);

proc transpose data = OPERA.OPERA_All_2A  out = OPERA.OPERA_All_3_wide   (drop=_name_);  /*(rename=(_name_ = Code  col1=Value));*/
      by variable;  *obs;
	  id variable_value;
      var presentation;  *DLEAdi--DPHYdi;
run;

* transpose only N;

proc transpose data=OPERA.OPERA_All_2A  out = OPERA.OPERA_All_3_wide_N prefix=N_;
     by variable;  
	  id variable_value;
      var presentation;  
run;


* transpose only percents;

proc transpose data=OPERA.OPERA_All_2A  out = OPERA.OPERA_All_3_wide_PCT  prefix=PCT_;
     by variable;  
	 id variable_value;
     var presentation;  
run;


* final output file;

data &amp;amp;Output_DSN.;
   Merge OPERA.OPERA_All_3_wide_N  OPERA.OPERA_All_3_wide_PCT OPERA.OPERA_All_3_wide;
     by variable;
	 drop _name_;
	 label N_Missing='# Missing'  N_Not_Missing='# Not Missing'
	     PCT_Missing='% Missing'  N_Not_Missing='% Not Missing'
		 Missing='Missing'
		 Not_Missing='Not Missing';
run;

title "Missing Report of  &amp;amp;INPUT_DSN.";

proc print data=&amp;amp;Output_DSN. noobs label;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 May 2021 19:47:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739326#M230735</guid>
      <dc:creator>wlierman</dc:creator>
      <dc:date>2021-05-05T19:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: **** Thank you **** Reeza, Tom, Kurt  How to count missing and non-missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739367#M230752</link>
      <description>&lt;P&gt;Likely start with the documentation for SAS data step functions. I'm not sure which ones you aren't familiar with thous VVALUEX is likely one you haven't seen. Array processing. Proc Transpose.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Start at &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=pgmsashome&amp;amp;docsetTarget=home.htm&amp;amp;locale=en"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=pgmsashome&amp;amp;docsetTarget=home.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Search for any of the functions or statements you aren't familiar with.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 22:29:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739367#M230752</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-05-05T22:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: **** Thank you **** Reeza, Tom, Kurt  How to count missing and non-missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739414#M230783</link>
      <description>&lt;P&gt;Maxim 1. So start here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/pgmsashome/home.htm#p0258wnlz15ubrn1vqfalp6l4hjz" target="_blank" rel="noopener"&gt;Programming Documentation for SAS® 9.4 and SAS® Viya®&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From there,&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/lefunctionsref/p1q8bq2v0o11n6n1gpij335fqpph.htm" target="_blank" rel="noopener"&gt;Functions and CALL Routines&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/lestmtsref/p0gct6ariiecuhn15jkq8pzfzgef.htm" target="_blank" rel="noopener"&gt;DATA Step Statements&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and the procedures, e.g.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/proc/p1xidhqypi0fnwn1if8opjpqpbmn.htm" target="_blank" rel="noopener"&gt;FORMAT Procedure&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/proc/n1xno5xgs39b70n0zydov0owajj8.htm" target="_blank" rel="noopener"&gt;TRANSPOSE Procedure&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/procstat/procstat_freq_toc.htm" target="_blank" rel="noopener"&gt;FREQ Procedure&lt;/A&gt;&amp;nbsp;(which is listed under "Base SAS Statistical Procedures")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ODS is listed under "Output and Graphics"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Further, make use of Maxim 6 (Google Is Your Friend). I have found that the search engine has become very good at answering questions, like "how do i create html with sas ods?". Such questions (always include the keyword "sas") quickly lead you to the relevant documentation, postings here on the community, and papers from the many SAS conventions. Especially the papers provide "how to" cookbooks.&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 07:37:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739414#M230783</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-05-06T07:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: **** Thank you **** Reeza, Tom, Kurt  How to count missing and non-missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739460#M230803</link>
      <description>This my paper could give you a start .&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2020/4737-2020.pdf" target="_blank"&gt;https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2020/4737-2020.pdf&lt;/A&gt;</description>
      <pubDate>Thu, 06 May 2021 12:29:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739460#M230803</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-05-06T12:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: **** Thank you **** Reeza, Tom, Kurt  How to count missing and non-missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739498#M230813</link>
      <description>&lt;P&gt;Thank you for sending the link to your paper.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Appreciate ti.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;wklierman&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 14:38:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739498#M230813</guid>
      <dc:creator>wlierman</dc:creator>
      <dc:date>2021-05-06T14:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: **** Thank you **** Reeza, Tom, Kurt  How to count missing and non-missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739516#M230825</link>
      <description>Hi KSharp,&lt;BR /&gt;Great paper.&lt;BR /&gt;Thank you.&lt;BR /&gt;wlierman&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 06 May 2021 15:24:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739516#M230825</guid>
      <dc:creator>wlierman</dc:creator>
      <dc:date>2021-05-06T15:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: checking on missing| non-missing variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739662#M230896</link>
      <description>&lt;P&gt;This is a continuation of sorts on the topic of determining the missing / nonmissing variables in a data set.&amp;nbsp; I am following a code algorithm from the 2020 Global Forum paper by Shan and Bremser (great paper by the way).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL 
This will be faster for big tables; it will pick up numeric and character variables: 
/* firstl, get variable names */
proc transpose data=have(obs=0) out=vname;
var _all_;
run;
/* then check if variable is all missing */
proc sql noprint;
select catx(' ','n(',_name_,') as',_name_) into :vnames separated by ','
from vname;
create table temp as
select &amp;amp;vnames from have;
quit;
proc transpose data=temp out=want;
var _all_;
run;
proc sql noprint;
select _name_ into : missing_variables separated by ' '
from want
where col1=0;
quit;
 
%put Missing variables are : &amp;amp;missing_variables ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Anyway, this is my code and the accompanying log which specifies the error that I am getting:&lt;/P&gt;
&lt;PRE&gt;/* First1, get variable names */
proc transpose data = OPERA.OPERA_dis_age(obs = 0) out = OPERA.OPERA_vnames;
    var _all_;
run;


/* then check if variable is all missing */
proc sql noprint;
   Select catx(' ','n('_name_,') as',_name_) into :vnames separated by ','
   From OPERA.OPERA_vnames;
   Create table temp As
     Select &amp;amp;vnames 
     From OPERA.OPERA_dis_age;
quit;&lt;/PRE&gt;
&lt;P&gt;And the log&lt;/P&gt;
&lt;PRE&gt;The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds


66   proc sql noprint;
67      Select catx(' ','n('_name_,') as',_name_) into :vnames separated by ','
                        ----------
                       &lt;STRONG&gt; 49  22&lt;/STRONG&gt;
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS
             release.  Inserting white space between a quoted string and the succeeding
             identifier is recommended.

ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, *, **, +, ',', -, /, &amp;lt;,
              &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, ?, AND, CONTAINS, EQ, EQT, GE, GET, GT, GTT, LE, LET, LIKE,
              LT, LTT, NE, NET, OR, ^=, |, ||, ~=.

68      From OPERA.OPERA_vnames;
69      Create table temp As
70        Select &amp;amp;vnames
WARNING: Apparent symbolic reference VNAMES not resolved.
70        Select &amp;amp;vnames
                 -
                &lt;STRONG&gt; 22&lt;/STRONG&gt;
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,
              a numeric constant, a datetime constant, a missing value, BTRIM, INPUT, PUT,
              SUBSTRING, USER.

71        From OPERA.OPERA_dis_age;
72   quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds

&lt;/PRE&gt;
&lt;P&gt;What is the problem here?&amp;nbsp; I checked over the code but could have missed something.&lt;/P&gt;
&lt;P&gt;Thanks for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;wlierman&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 22:01:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739662#M230896</guid>
      <dc:creator>wlierman</dc:creator>
      <dc:date>2021-05-06T22:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: checking on missing| non-missing variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739750#M230933</link>
      <description>You are missing a comma . Compare to my original code.&lt;BR /&gt;   Select catx(' ','n('_name_,') as',_name_) into :vnames separated by ','&lt;BR /&gt;&lt;BR /&gt;--&amp;gt;&lt;BR /&gt;   Select catx(' ','n('    ,    _name_,') as',_name_) into :vnames separated by ','</description>
      <pubDate>Fri, 07 May 2021 12:27:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739750#M230933</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-05-07T12:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: **** Thank you **** Reeza, Tom, Kurt  How to count missing and non-missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739752#M230935</link>
      <description>&lt;PRE&gt;Data OPERA_All_2;
        call streaminit(45);
		length obs 8.;
		array vars(*) $3. DLEAdi DMHDdi DCOMdi DEARdi DEYEdi DDRSdi DOUTdi DREMdi DPHYdi;

		do obs= 1 to 200; *181308;

		         do i=1 to dim(vars);
				         vars(i)= put(rand('table', 0.4, 0.4, 0.2), Z3.);
						 if vars(i) = '003' then call missing(vars(i));
						 
				 end;
				 output;
		end;
		drop i;
run;



/* firstl, get variable names */
proc transpose data=OPERA_All_2(obs=0) out=vname;
var _all_;
run;
/* then check if variable is all missing */
proc sql noprint;
select catx(' ','n(',_name_,') as',_name_) into :vnames separated by ','
from vname;
create table temp as
select &amp;amp;vnames from OPERA_All_2;
quit;
proc transpose data=temp out=want;
var _all_;
run;
proc sql noprint;
select _name_ into : missing_variables separated by ' '
from want
where col1=0;
quit;
 
%put Missing variables are : &amp;amp;missing_variables ;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 May 2021 12:31:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739752#M230935</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-05-07T12:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: **** Thank you **** Reeza, Tom, Kurt  How to count missing and non-missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739755#M230937</link>
      <description>&lt;P&gt;If you want a report include n of missing ,percent of missing ......... Try this one :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data OPERA_All_2;
        call streaminit(45);
		length obs 8.;
		array vars(*) $3. DLEAdi DMHDdi DCOMdi DEARdi DEYEdi DDRSdi DOUTdi DREMdi DPHYdi;

		do obs= 1 to 200; *181308;

		         do i=1 to dim(vars);
				         vars(i)= put(rand('table', 0.4, 0.4, 0.2), Z3.);
						 if vars(i) = '003' then call missing(vars(i));
						 
				 end;
				 output;
		end;
		drop i;
run;




%macro report(dsn=,vname=);
proc sql ;
create table temp as
select "&amp;amp;vname." as vname length=40
      ,n(&amp;amp;vname.) as n_not_missing label='# Not Missing' 
      ,n(&amp;amp;vname.)/count(*) as pct_not_missing label='% Not Missing' format=percent8.2
      ,nmiss(&amp;amp;vname.) as n_missing label='# Missing' 
      ,nmiss(&amp;amp;vname.)/count(*) as pct_missing label='% Missing'  format=percent8.2
from  &amp;amp;dsn ;
quit;
proc append base=want data=temp force;run;
%mend;




proc transpose data=OPERA_All_2(obs=0) out=vname;
var _all_;
run;
proc delete data=want;run;
data _null_;
 set vname;
 call execute(cats('%report(dsn=OPERA_All_2,vname=',_name_,')'));
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 May 2021 12:55:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739755#M230937</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-05-07T12:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: checking on missing| non-missing variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739792#M230952</link>
      <description>&lt;P&gt;Thank you very much.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;wlierman&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 14:50:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739792#M230952</guid>
      <dc:creator>wlierman</dc:creator>
      <dc:date>2021-05-07T14:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: **** Thank you **** Reeza, Tom, Kurt  How to count missing and non-missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739794#M230953</link>
      <description>Thank you for the code.&lt;BR /&gt;&lt;BR /&gt;I will do that.&lt;BR /&gt;&lt;BR /&gt;wlierman</description>
      <pubDate>Fri, 07 May 2021 14:51:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Thank-you-Reeza-Tom-Kurt-How-to-count-missing-and-non-missing/m-p/739794#M230953</guid>
      <dc:creator>wlierman</dc:creator>
      <dc:date>2021-05-07T14:51:33Z</dc:date>
    </item>
  </channel>
</rss>

