<?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: Counting number of missing data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Counting-number-of-missing-data/m-p/739878#M230998</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would you want output something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="delete_output.png" style="width: 635px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59142i09264273BE055F5C/image-size/large?v=v2&amp;amp;px=999" role="button" title="delete_output.png" alt="delete_output.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, see the code &lt;A href="https://gist.github.com/statgeek/2de1faf1644dc8160fe721056202f111" target="_self"&gt;here&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Replace the CLASS data at the top with your input data set, Opera_DIS_AGE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure I understand how your code is supposed to work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You do a transpose which gets you the list of variables (FYI - not really needed as you can use _numeric_ or _character_ in various places.)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But your SQL query is just a select of those variables? Were you intending to loop through each and do something like this?&amp;nbsp;&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;select count(age) as n_age, count(*) as n_total, count(sex) as n_sex .....
from ...

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or did you want output for each one individually?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select count(age) as n, count(*) as n_total, calculated n / calculated n_total as pct_missing
from opera
union all
select count(sex) as n, count(*) as n_total, calculated n / calculated n_total as pct_missing
from opera&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a rough way to do this in PROC FREQ that my code then generalizes and summaries into a nice data set. You only need to know the name of the data set ahead of time.&lt;/P&gt;
&lt;P&gt;Note that in this case it does not matter what types the variables are, ie character/numeric.&amp;nbsp; This was used in the linked code.&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_DIS_AGE;
        call streaminit(45);
		length obs 8.;
		array vars(*) $3. DEYEage DMHDage DCOMage DEARage DLEAage DDRSage DOUTage DREMage DPHYage AgAcq1st;

		do obs= 1 to 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_DIS_AGE;
%let OUTPUT_DSN = want;
*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 all;
*turns off the output so the results do not get too messy;
ods table onewayfreqs=temp;

proc freq data=&amp;amp;INPUT_DSN.;
    table _all_ / missing;
    format _numeric_ nmissfmt. _character_ $missfmt.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if all your variables are numeric, PROC MEANS will do it in one step with N/NMISS counts easily available.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=opera_dis_age n nmiss stackods;
ods output summary = want2;
run;

proc print data=want2;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/65907"&gt;@wlierman&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am still working / struggling with the code that produces a count of missing and non-missing observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have been following this code from an earlier solution. This is not the entire code --just to the point where I hit a snag as shown in the log below.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data OPERA.OPERA_DIS_AGE;
        call streaminit(45);
		length obs 8.;
		array vars(*) $3. DEYEage DMHDage DCOMage DEARage DLEAage DDRSage DOUTage DREMage DPHYage AgAcq1st;

		do obs= 1 to 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;





/* First1, get variable names */
proc transpose data = OPERA.OPERA_DIS_AGE(obs = 0) out = OPERA.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 OPERA.vname;
   Create table temp As
     Select &amp;amp;vnames from OPERA.OPERA_DIS_AGE;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data OPERA.OPERA_DIS_AGE;
618          call streaminit(45);
619          length obs 8.;
620          array vars(*) $3. DEYEage DMHDage DCOMage DEARage DLEAage DDRSage DOUTage DREMage
620! DPHYage AgAcq1st;
621
622          do obs= 1 to 181308;
623
624                   do i=1 to dim(vars);
625                           vars(i)= put(rand('table', 0.4, 0.4, 0.2), Z3.);
626                           if vars(i) = '003' then call missing(vars(i));
627
628                   end;
629                   output;
630          end;
631          drop i;
632  run;

NOTE: The data set OPERA.OPERA_DIS_AGE has 181308 observations and 11 variables.
NOTE: Compressing data set OPERA.OPERA_DIS_AGE increased size by 12.50 percent.
      Compressed is 126 pages; un-compressed would require 112 pages.
NOTE: DATA statement used (Total process time):
      real time           0.35 seconds
      cpu time            0.32 seconds


633  proc transpose data = OPERA.OPERA_DIS_AGE(obs = 0) out = OPERA.vname;
634      var _all_;
635  run;

NOTE: Numeric variables in the input data set will be converted to character in the output
      data set.
NOTE: Compression was disabled for data set OPERA.VNAME because compression overhead would
      increase the size of the data set.
NOTE: There were 0 observations read from the data set OPERA.OPERA_DIS_AGE.
NOTE: The data set OPERA.VNAME has 11 observations and 1 variables.
NOTE: PROCEDURE TRANSPOSE used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds


636  /* then check if variable is all missing */
637  proc sql noprint;
638     Select catx('','n(',_name_,') as', _name_) into :vnames separated by ','
639     From OPERA.vname;
640     Create table temp As
641       Select &amp;amp;vnames from OPERA.OPERA_DIS_AGE;
                         ----
                         22
                         76
ERROR 22-322: Syntax error, expecting one of the following: ;, ',', ANSIMISS, CROSS, EXCEPT,
              FULL, GROUP, HAVING, INNER, INTERSECT, JOIN, LEFT, NATURAL, NOMISS, ORDER,
              OUTER, RIGHT, UNION, WHERE.

ERROR 76-322: Syntax error, statement will be ignored.

NOTE: Line generated by the macro variable "VNAMES".
1     n(obs) asobs,n(DEYEage) asDEYEage,n(DMHDage) asDMHDage,n(DCOMage) asDCOMage,n(DEARage)
             ------
             1    22
WARNING 1-322: Assuming the symbol AS was misspelled as asobs.

ERROR 22-322: Expecting a name.

1  !  n(obs) asobs,n(DEYEage) asDEYEage,n(DMHDage) asDMHDage,n(DCOMage) asDCOMage,n(DEARage)
                              ---------
                              22
1  ! asDEARage,n(DLEAage) asDLEAage,n(DDRSage) asDDRSage,n(DOUTage) asDOUTage,n(DREMage)
1  ! asDREMage,n(DPHYage) asDPHYage,n(AgAcq1st) asAgAcq1st
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, AS, CONTAINS, EQ, EQT, FROM, GE, GET, GT, GTT, LE,
              LET, LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.

642  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;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you for continuing help and assistance.&lt;/P&gt;
&lt;P&gt;wlierman&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 May 2021 19:58:32 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-05-07T19:58:32Z</dc:date>
    <item>
      <title>Counting number of missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-number-of-missing-data/m-p/739870#M230996</link>
      <description>&lt;P&gt;I am still working / struggling with the code that produces a count of missing and non-missing observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have been following this code from an earlier solution. This is not the entire code --just to the point where I hit a snag as shown in the log below.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data OPERA.OPERA_DIS_AGE;
        call streaminit(45);
		length obs 8.;
		array vars(*) $3. DEYEage DMHDage DCOMage DEARage DLEAage DDRSage DOUTage DREMage DPHYage AgAcq1st;

		do obs= 1 to 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;





/* First1, get variable names */
proc transpose data = OPERA.OPERA_DIS_AGE(obs = 0) out = OPERA.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 OPERA.vname;
   Create table temp As
     Select &amp;amp;vnames from OPERA.OPERA_DIS_AGE;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data OPERA.OPERA_DIS_AGE;
618          call streaminit(45);
619          length obs 8.;
620          array vars(*) $3. DEYEage DMHDage DCOMage DEARage DLEAage DDRSage DOUTage DREMage
620! DPHYage AgAcq1st;
621
622          do obs= 1 to 181308;
623
624                   do i=1 to dim(vars);
625                           vars(i)= put(rand('table', 0.4, 0.4, 0.2), Z3.);
626                           if vars(i) = '003' then call missing(vars(i));
627
628                   end;
629                   output;
630          end;
631          drop i;
632  run;

NOTE: The data set OPERA.OPERA_DIS_AGE has 181308 observations and 11 variables.
NOTE: Compressing data set OPERA.OPERA_DIS_AGE increased size by 12.50 percent.
      Compressed is 126 pages; un-compressed would require 112 pages.
NOTE: DATA statement used (Total process time):
      real time           0.35 seconds
      cpu time            0.32 seconds


633  proc transpose data = OPERA.OPERA_DIS_AGE(obs = 0) out = OPERA.vname;
634      var _all_;
635  run;

NOTE: Numeric variables in the input data set will be converted to character in the output
      data set.
NOTE: Compression was disabled for data set OPERA.VNAME because compression overhead would
      increase the size of the data set.
NOTE: There were 0 observations read from the data set OPERA.OPERA_DIS_AGE.
NOTE: The data set OPERA.VNAME has 11 observations and 1 variables.
NOTE: PROCEDURE TRANSPOSE used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds


636  /* then check if variable is all missing */
637  proc sql noprint;
638     Select catx('','n(',_name_,') as', _name_) into :vnames separated by ','
639     From OPERA.vname;
640     Create table temp As
641       Select &amp;amp;vnames from OPERA.OPERA_DIS_AGE;
                         ----
                         22
                         76
ERROR 22-322: Syntax error, expecting one of the following: ;, ',', ANSIMISS, CROSS, EXCEPT,
              FULL, GROUP, HAVING, INNER, INTERSECT, JOIN, LEFT, NATURAL, NOMISS, ORDER,
              OUTER, RIGHT, UNION, WHERE.

ERROR 76-322: Syntax error, statement will be ignored.

NOTE: Line generated by the macro variable "VNAMES".
1     n(obs) asobs,n(DEYEage) asDEYEage,n(DMHDage) asDMHDage,n(DCOMage) asDCOMage,n(DEARage)
             ------
             1    22
WARNING 1-322: Assuming the symbol AS was misspelled as asobs.

ERROR 22-322: Expecting a name.

1  !  n(obs) asobs,n(DEYEage) asDEYEage,n(DMHDage) asDMHDage,n(DCOMage) asDCOMage,n(DEARage)
                              ---------
                              22
1  ! asDEARage,n(DLEAage) asDLEAage,n(DDRSage) asDDRSage,n(DOUTage) asDOUTage,n(DREMage)
1  ! asDREMage,n(DPHYage) asDPHYage,n(AgAcq1st) asAgAcq1st
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, AS, CONTAINS, EQ, EQT, FROM, GE, GET, GT, GTT, LE,
              LET, LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.

642  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;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you for continuing help and assistance.&lt;/P&gt;
&lt;P&gt;wlierman&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 19:36:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-number-of-missing-data/m-p/739870#M230996</guid>
      <dc:creator>wlierman</dc:creator>
      <dc:date>2021-05-07T19:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Counting number of missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-number-of-missing-data/m-p/739878#M230998</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would you want output something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="delete_output.png" style="width: 635px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59142i09264273BE055F5C/image-size/large?v=v2&amp;amp;px=999" role="button" title="delete_output.png" alt="delete_output.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, see the code &lt;A href="https://gist.github.com/statgeek/2de1faf1644dc8160fe721056202f111" target="_self"&gt;here&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Replace the CLASS data at the top with your input data set, Opera_DIS_AGE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure I understand how your code is supposed to work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You do a transpose which gets you the list of variables (FYI - not really needed as you can use _numeric_ or _character_ in various places.)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But your SQL query is just a select of those variables? Were you intending to loop through each and do something like this?&amp;nbsp;&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;select count(age) as n_age, count(*) as n_total, count(sex) as n_sex .....
from ...

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or did you want output for each one individually?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select count(age) as n, count(*) as n_total, calculated n / calculated n_total as pct_missing
from opera
union all
select count(sex) as n, count(*) as n_total, calculated n / calculated n_total as pct_missing
from opera&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a rough way to do this in PROC FREQ that my code then generalizes and summaries into a nice data set. You only need to know the name of the data set ahead of time.&lt;/P&gt;
&lt;P&gt;Note that in this case it does not matter what types the variables are, ie character/numeric.&amp;nbsp; This was used in the linked code.&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_DIS_AGE;
        call streaminit(45);
		length obs 8.;
		array vars(*) $3. DEYEage DMHDage DCOMage DEARage DLEAage DDRSage DOUTage DREMage DPHYage AgAcq1st;

		do obs= 1 to 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_DIS_AGE;
%let OUTPUT_DSN = want;
*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 all;
*turns off the output so the results do not get too messy;
ods table onewayfreqs=temp;

proc freq data=&amp;amp;INPUT_DSN.;
    table _all_ / missing;
    format _numeric_ nmissfmt. _character_ $missfmt.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if all your variables are numeric, PROC MEANS will do it in one step with N/NMISS counts easily available.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=opera_dis_age n nmiss stackods;
ods output summary = want2;
run;

proc print data=want2;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/65907"&gt;@wlierman&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am still working / struggling with the code that produces a count of missing and non-missing observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have been following this code from an earlier solution. This is not the entire code --just to the point where I hit a snag as shown in the log below.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data OPERA.OPERA_DIS_AGE;
        call streaminit(45);
		length obs 8.;
		array vars(*) $3. DEYEage DMHDage DCOMage DEARage DLEAage DDRSage DOUTage DREMage DPHYage AgAcq1st;

		do obs= 1 to 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;





/* First1, get variable names */
proc transpose data = OPERA.OPERA_DIS_AGE(obs = 0) out = OPERA.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 OPERA.vname;
   Create table temp As
     Select &amp;amp;vnames from OPERA.OPERA_DIS_AGE;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data OPERA.OPERA_DIS_AGE;
618          call streaminit(45);
619          length obs 8.;
620          array vars(*) $3. DEYEage DMHDage DCOMage DEARage DLEAage DDRSage DOUTage DREMage
620! DPHYage AgAcq1st;
621
622          do obs= 1 to 181308;
623
624                   do i=1 to dim(vars);
625                           vars(i)= put(rand('table', 0.4, 0.4, 0.2), Z3.);
626                           if vars(i) = '003' then call missing(vars(i));
627
628                   end;
629                   output;
630          end;
631          drop i;
632  run;

NOTE: The data set OPERA.OPERA_DIS_AGE has 181308 observations and 11 variables.
NOTE: Compressing data set OPERA.OPERA_DIS_AGE increased size by 12.50 percent.
      Compressed is 126 pages; un-compressed would require 112 pages.
NOTE: DATA statement used (Total process time):
      real time           0.35 seconds
      cpu time            0.32 seconds


633  proc transpose data = OPERA.OPERA_DIS_AGE(obs = 0) out = OPERA.vname;
634      var _all_;
635  run;

NOTE: Numeric variables in the input data set will be converted to character in the output
      data set.
NOTE: Compression was disabled for data set OPERA.VNAME because compression overhead would
      increase the size of the data set.
NOTE: There were 0 observations read from the data set OPERA.OPERA_DIS_AGE.
NOTE: The data set OPERA.VNAME has 11 observations and 1 variables.
NOTE: PROCEDURE TRANSPOSE used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds


636  /* then check if variable is all missing */
637  proc sql noprint;
638     Select catx('','n(',_name_,') as', _name_) into :vnames separated by ','
639     From OPERA.vname;
640     Create table temp As
641       Select &amp;amp;vnames from OPERA.OPERA_DIS_AGE;
                         ----
                         22
                         76
ERROR 22-322: Syntax error, expecting one of the following: ;, ',', ANSIMISS, CROSS, EXCEPT,
              FULL, GROUP, HAVING, INNER, INTERSECT, JOIN, LEFT, NATURAL, NOMISS, ORDER,
              OUTER, RIGHT, UNION, WHERE.

ERROR 76-322: Syntax error, statement will be ignored.

NOTE: Line generated by the macro variable "VNAMES".
1     n(obs) asobs,n(DEYEage) asDEYEage,n(DMHDage) asDMHDage,n(DCOMage) asDCOMage,n(DEARage)
             ------
             1    22
WARNING 1-322: Assuming the symbol AS was misspelled as asobs.

ERROR 22-322: Expecting a name.

1  !  n(obs) asobs,n(DEYEage) asDEYEage,n(DMHDage) asDMHDage,n(DCOMage) asDCOMage,n(DEARage)
                              ---------
                              22
1  ! asDEARage,n(DLEAage) asDLEAage,n(DDRSage) asDDRSage,n(DOUTage) asDOUTage,n(DREMage)
1  ! asDREMage,n(DPHYage) asDPHYage,n(AgAcq1st) asAgAcq1st
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, AS, CONTAINS, EQ, EQT, FROM, GE, GET, GT, GTT, LE,
              LET, LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.

642  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;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you for continuing help and assistance.&lt;/P&gt;
&lt;P&gt;wlierman&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 19:58:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-number-of-missing-data/m-p/739878#M230998</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-05-07T19:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Counting number of missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-number-of-missing-data/m-p/739904#M231006</link>
      <description>&lt;P&gt;Thank you for taking the time to address this problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I really appreciate your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;wlierman&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 21:20:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-number-of-missing-data/m-p/739904#M231006</guid>
      <dc:creator>wlierman</dc:creator>
      <dc:date>2021-05-07T21:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Counting number of missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-number-of-missing-data/m-p/739962#M231051</link>
      <description>Should padding a white blank :&lt;BR /&gt;&lt;BR /&gt;Select catx('',&lt;BR /&gt;--&amp;gt;&lt;BR /&gt;Select catx('  ',</description>
      <pubDate>Sat, 08 May 2021 12:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-number-of-missing-data/m-p/739962#M231051</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-05-08T12:51:48Z</dc:date>
    </item>
  </channel>
</rss>

