<?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 do I get the character and numeric values in macro for missing and not missing values in SAS in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443353#M28640</link>
    <description>&lt;P&gt;You can also just let PROC SUMMARY do the work for you in a single pass.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let in=test;
%let out=want;

proc means stackodsoutput data=&amp;amp;in noprint chartype ;
  class _all_ / missing ;
  ways 1 ;
 format _numeric_ missfmt. _character_ $missfmt. ;
  output out=stats ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You will need to add a little logic to clean up the output.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=stats(obs=0) out=names ;
 var _all_;
run;

data &amp;amp;out ;
  length varnum point 8 _name_ $32 n nmiss 8 ;
  retain varnum point _name_ n nmiss ;
  set stats ;
  by _type_ ;
  if first._type_ then do;
     if _n_=1 then varnum=length(_type_);
     else varnum=varnum-1;
     point = varnum ;
     n=0;
     nmiss=0;
     set names (keep=_name_) point=point;
  end;
  if vvaluex(_name_) ='Missing' then nmiss=_freq_;
  else n=_freq_;
  if last._type_;
  keep varnum _name_ n nmiss ;
run;
proc sort data=&amp;amp;out;
  by varnum ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Mar 2018 15:28:46 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2018-03-07T15:28:46Z</dc:date>
    <item>
      <title>How do I get the character and numeric values in macro for missing and not missing values in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443257#M28622</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello, I am trying to get the missing and not missing values for 17 variables out of which 4 are Numeric.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Belos is the&amp;nbsp;proc format which I have used:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value $missfmt ' '='Missing' other='Not Missing';
value missfmt . ='Missing' other='Not Missing';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; %do I=1 %to %sysfunc(countw(&amp;amp;varlist)); 
 	%let var = %scan(&amp;amp;varlist, &amp;amp;I);
	%put &amp;amp;var.;
	

	proc freq data=work.MV_MISSING_VALUE;
	
	format &amp;amp;var. missfmt. ; /* apply format for the duration of this PROC */
	tables &amp;amp;var. / missing missprint nocum  out= Final_Output_&amp;amp;var ;

	run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: You are trying to use the numeric format MISSFMT with the character variable TIRE_TYPE in data set WORK.MV_MISSING_VALUE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way to edit the format statement in PROC FREQ above to get the numeric as well character values. I understood the error but not able to apply the correct syntax or do I need to change the numeric variable to character and then proceed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Look forward to your reply!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 12:06:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443257#M28622</guid>
      <dc:creator>narulap</dc:creator>
      <dc:date>2018-03-07T12:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the character and numeric values in macro for missing and not missing values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443259#M28623</link>
      <description>&lt;P&gt;Derive a list of variables from metadata and automate with call execute:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let lib=work;
%let dataset=MV_MISSING_VALUE;

proc sql;
create table varlist as
select name, type from dictionary.columns
where libname = upcase("&amp;amp;lib.") and memname = upcase("&amp;amp;dataset");
quit;

%macro checkmiss(var,type);
proc freq data=&amp;amp;lib..&amp;amp;dataset;
%if &amp;amp;type=char %then %do;
format &amp;amp;var. $missfmt. ; /* apply format for the duration of this PROC */
%end; %else %do;
format &amp;amp;var. missfmt. ; /* apply format for the duration of this PROC */
%end;
tables &amp;amp;var. / missing missprint nocum  out= Final_Output_&amp;amp;var ;
run;
%mend;

data _null_;
set varlist;
call execute('%nrstr(%checkmiss(' !! trim(name) !! ',' !! trim(type) !! '));');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 12:21:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443259#M28623</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-07T12:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the character and numeric values in macro for missing and not missing values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443279#M28626</link>
      <description>&lt;P&gt;Or just use the inbuilt types and have two procs:&lt;/P&gt;
&lt;PRE&gt;proc freq data=work.mv_missing_value;
  tables _numeric_ / missing misprint nocum out=numeric_missing;
  format _all_ missfmt.;
run;
proc freq data=work.mv_missing_value;
  tables _character_ / missing misprint nocum out=char_missing;
  format _all_ $missfmt.;
run;
&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Mar 2018 13:09:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443279#M28626</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-03-07T13:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the character and numeric values in macro for missing and not missing values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443285#M28628</link>
      <description>&lt;P&gt;I am having the "varlist" which has the variables list. I am trying to run the code in a macro. Below is the full code which I am using.&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;/*Assign Macros for Minimum Date and Maximum Date-1st STEP*/
%let mindate = '01JAN2018:00:00:00';
%put &amp;amp;mindate;
%let maxdate = '31JAN2018:00:00:00';
%put &amp;amp;maxdate;

/*Using Macros(Minimum and Maximum date) in PROC SQL-2nd Step */

/* create a format to group missing and nonmissing */
/* Format is necessary to get the final Output in Missing and Not Missing Format-3rd Step*/

proc format;
 value $missfmt ' '='Missing' other='Not Missing';
 value  missfmt  . ='Missing' other='Not Missing';
run;


%let varlist = TBM_STAGE1 TBM_STAGE2 SHIFT_BUILD_DATE BLADDER CURING_STAGE1 SHIFT_CURING_DATE MOLD ARTICLE7 CUSTOMER CUSTOMER_INTENDED 
TIRESIZE TIRE_TYPE TREAD WAREHOUSED BATCH_ID Processed_dttm;

%macro abc() ;

	proc sql;
	create table MV_MISSING_VALUE AS
	select *
	from pankaj.mv_yield_detail_mm
	where "&amp;amp;mindate."dt &amp;lt;= PROCESSED_DTTM &amp;lt;="&amp;amp;maxdate."dt
	ORDER BY PROCESSED_DTTM;
	quit;

	data _null_;
	set MV_MISSING_VALUE;
	/*call execute('%nrstr(%abc(' !! trim(varlist) !! ',' !! trim(varlist) !! '));');*/
	run;

 %do I=1 %to %sysfunc(countw(&amp;amp;varlist)); 
 	%let var = %scan(&amp;amp;varlist, &amp;amp;I);
	%put &amp;amp;var.;
	
	proc freq data=work.MV_MISSING_VALUE;
	%if &amp;amp;varlist=char %then %do;
		format &amp;amp;var. missfmt. ; /* apply format for the duration of this PROC */
	%end; %else %do;
	format &amp;amp;var. $missfmt. ; /* apply format for the duration of this PROC */
	%end;
	tables &amp;amp;var. / missing missprint nocum  out= Final_Output_&amp;amp;var ;
	run;
%end;
%mend;
%abc;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Mar 2018 13:18:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443285#M28628</guid>
      <dc:creator>narulap</dc:creator>
      <dc:date>2018-03-07T13:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the character and numeric values in macro for missing and not missing values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443289#M28631</link>
      <description>&lt;P&gt;Hi, I already had the two proc freq for numeric and character but I am trying to use a Macro for that and run the whole in a macro.&lt;/P&gt;&lt;P&gt;I already had the output for all the characters variables and struggling for numeric variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bladder&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Count&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Frequency&lt;/P&gt;&lt;P&gt;Missing&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 913&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.101776235&lt;BR /&gt;Not Missing&amp;nbsp; &amp;nbsp; &amp;nbsp;896153&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;99.898223765&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code from where I started :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Assign Macros for Minimum Date and Maximum Date-1st STEP*/
%let mindate = '01JAN2018:00:00:00';
%put &amp;amp;mindate;
%let maxdate = '31JAN2018:00:00:00';
%put &amp;amp;maxdate;

proc format;
 value $missfmt ' '='Missing' other='Not Missing';
 value  missfmt  . ='Missing' other='Not Missing';
run;

%let varlist = TBM_STAGE1 TBM_STAGE2 SHIFT_BUILD_DATE BLADDER CURING_STAGE1 SHIFT_CURING_DATE MOLD ARTICLE7 CUSTOMER CUSTOMER_INTENDED 
TIRESIZE TIRE_TYPE TREAD WAREHOUSED BATCH_ID Processed_dttm;

%macro abc() ;

	proc sql;
	create table MV_MISSING_VALUE AS
	select *
	from pankaj.mv_yield_detail_mm
	where "&amp;amp;mindate."dt &amp;lt;= PROCESSED_DTTM &amp;lt;="&amp;amp;maxdate."dt
	ORDER BY PROCESSED_DTTM;
	quit;
	
 %do I=1 %to %sysfunc(countw(&amp;amp;varlist)); 
 	%let var = %scan(&amp;amp;varlist, &amp;amp;I);
	%put &amp;amp;var.;
	
	proc freq data=work.MV_MISSING_VALUE;
	format &amp;amp;var. $missfmt.; /* apply format for the duration of this PROC */
	tables &amp;amp;var. / missing missprint nocum  out= Final_Output_&amp;amp;var ;
	run;
%end;
%mend;
%abc;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Mar 2018 13:33:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443289#M28631</guid>
      <dc:creator>narulap</dc:creator>
      <dc:date>2018-03-07T13:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the character and numeric values in macro for missing and not missing values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443290#M28632</link>
      <description>&lt;P&gt;In case&amp;nbsp;you just need a report below could do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  set sashelp.class;

  if mod(_n_,2)=0 then
    call missing(name);

  if mod(_n_,3)=0 then
    call missing(age);
run;

proc format;
  value $missfmt ' '='Missing' other='Not Missing';
  value missfmt . ='Missing' other='Not Missing';
run;

data cldata;
  set have(obs=1);
  call missing(of _all_);
  output;
run;

options missing='0';
proc tabulate data=have missing classdata=cldata;
  format _numeric_ missfmt. _character_ $missfmt.; 
  class _numeric_ _character_;
  keylabel n=' ';
  table _numeric_ _character_;
run;
options missing='.';
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Mar 2018 13:36:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443290#M28632</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-03-07T13:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the character and numeric values in macro for missing and not missing values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443291#M28633</link>
      <description>&lt;P&gt;You misunderstand what my code does. I only have a small macro so that I can easier call the proc freq in call execute. I could write the complete proc freq step into the call execute (and do the numeric/character logic in data step code), without any macro at all.&lt;/P&gt;
&lt;P&gt;See this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Assign Macros for Minimum Date and Maximum Date-1st STEP*/
%let mindate = '01JAN2018:00:00:00';
%put &amp;amp;mindate;
%let maxdate = '31JAN2018:00:00:00';
%put &amp;amp;maxdate;

/*Using Macros(Minimum and Maximum date) in PROC SQL-2nd Step */

/* create a format to group missing and nonmissing */
/* Format is necessary to get the final Output in Missing and Not Missing Format-3rd Step*/

proc format;
 value $missfmt ' '='Missing' other='Not Missing';
 value  missfmt  . ='Missing' other='Not Missing';
run;

proc sql;
create table MV_MISSING_VALUE AS
select *
from pankaj.mv_yield_detail_mm
where "&amp;amp;mindate."dt &amp;lt;= PROCESSED_DTTM &amp;lt;="&amp;amp;maxdate."dt
ORDER BY PROCESSED_DTTM;
quit;

%let lib=work;
%let dataset=MV_MISSING_VALUE;

proc sql;
create table varlist as
select name, type from dictionary.columns
where libname = upcase("&amp;amp;lib.") and memname = upcase("&amp;amp;dataset");
quit;

%macro checkmiss(var,type);
proc freq data=&amp;amp;lib..&amp;amp;dataset;
%if &amp;amp;type=char %then %do;
format &amp;amp;var. $missfmt. ; /* apply format for the duration of this PROC */
%end; %else %do;
format &amp;amp;var. missfmt. ; /* apply format for the duration of this PROC */
%end;
tables &amp;amp;var. / missing missprint nocum  out= Final_Output_&amp;amp;var ;
run;
%mend;

data _null_;
set varlist;
call execute('%nrstr(%checkmiss(' !! trim(name) !! ',' !! trim(type) !! '));');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Mar 2018 13:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443291#M28633</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-07T13:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the character and numeric values in macro for missing and not missing values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443305#M28635</link>
      <description>&lt;P&gt;Sorry, just not seeing it.&amp;nbsp; Why are you trying to do data processing in macro?&amp;nbsp; Macro is only used for generating some text?&amp;nbsp; What you are effectively doing with that is generating a proc freq for every single variable, each time that is a load/write/process overhead.&amp;nbsp; I just don't see what the macro is adding to the process here, as its certainly coming at a large overhead.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 14:04:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443305#M28635</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-03-07T14:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the character and numeric values in macro for missing and not missing values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443349#M28638</link>
      <description>&lt;P&gt;Looks like you are working way too hard for this.&lt;/P&gt;
&lt;P&gt;Can't you just let SAS handle this by using variable lists in the format statement?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format _numeric_ missfmt. _character_ $missfmt. ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You might need to add another format statement at some point to remove the MISSFMT. from any statistics you calculated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 15:24:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443349#M28638</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-07T15:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the character and numeric values in macro for missing and not missing values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443353#M28640</link>
      <description>&lt;P&gt;You can also just let PROC SUMMARY do the work for you in a single pass.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let in=test;
%let out=want;

proc means stackodsoutput data=&amp;amp;in noprint chartype ;
  class _all_ / missing ;
  ways 1 ;
 format _numeric_ missfmt. _character_ $missfmt. ;
  output out=stats ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You will need to add a little logic to clean up the output.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=stats(obs=0) out=names ;
 var _all_;
run;

data &amp;amp;out ;
  length varnum point 8 _name_ $32 n nmiss 8 ;
  retain varnum point _name_ n nmiss ;
  set stats ;
  by _type_ ;
  if first._type_ then do;
     if _n_=1 then varnum=length(_type_);
     else varnum=varnum-1;
     point = varnum ;
     n=0;
     nmiss=0;
     set names (keep=_name_) point=point;
  end;
  if vvaluex(_name_) ='Missing' then nmiss=_freq_;
  else n=_freq_;
  if last._type_;
  keep varnum _name_ n nmiss ;
run;
proc sort data=&amp;amp;out;
  by varnum ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 15:28:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/443353#M28640</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-07T15:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the character and numeric values in macro for missing and not missing values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/444073#M28707</link>
      <description>&lt;P&gt;Thanks Kurt,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understood the code&amp;nbsp;which you provided and have implemented the same logic in my code and its working fine. As I am new to SAS EG and I was given a requirement straight away to point out the missing and non missing values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how I implemented and its working fine.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	proc sql ;
		create table varlist_1 as
		select name, type from  dictionary.columns
		where libname = upcase("work") and memname = upcase("MV_MISSING_VALUE");
	quit;


 %do I=1 %to %sysfunc(countw(&amp;amp;varlist)); 
 	%let var = %scan(&amp;amp;varlist, &amp;amp;I);
	%put &amp;amp;var.;


	proc sql noprint;
	select type into: t separated by ' ' from varlist_1
	where name="&amp;amp;var.";
	quit;
	%put check=&amp;amp;t.;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks for your support!!!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 13:32:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/444073#M28707</guid>
      <dc:creator>narulap</dc:creator>
      <dc:date>2018-03-09T13:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the character and numeric values in macro for missing and not missing values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/444077#M28708</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, its true. Finally, i got the required output.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your input Tom.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 13:45:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-get-the-character-and-numeric-values-in-macro-for/m-p/444077#M28708</guid>
      <dc:creator>narulap</dc:creator>
      <dc:date>2018-03-09T13:45:13Z</dc:date>
    </item>
  </channel>
</rss>

