<?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: problem related to use of macro in base sas 9.1 in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/problem-related-to-use-of-macro-in-base-sas-9-1/m-p/66067#M6631</link>
    <description>Hi Arvind,&lt;BR /&gt;
&lt;BR /&gt;
Try reposting -- It looks like all your text didn't show up. Off the top of my head, I would do something like:&lt;BR /&gt;
&lt;BR /&gt;
array vars[3] col1-col3;&lt;BR /&gt;
array misscounts[3];&lt;BR /&gt;
do i=1 to dim(vars);&lt;BR /&gt;
  if vars&lt;I&gt;=. then misscounts&lt;I&gt;+1;&lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
The variables misscounts1-misscounts3 will contain the number of missing values in each of col1-col3. Then you'd just need use that info to figure out how it relates to col1-col3.&lt;/I&gt;&lt;/I&gt;</description>
    <pubDate>Tue, 16 Dec 2008 21:37:26 GMT</pubDate>
    <dc:creator>RichardH_sas</dc:creator>
    <dc:date>2008-12-16T21:37:26Z</dc:date>
    <item>
      <title>problem related to use of macro in base sas 9.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/problem-related-to-use-of-macro-in-base-sas-9-1/m-p/66066#M6630</link>
      <description>i have one sas data set . i have to check the value of some certain column in this data set.wheather ther are having missing value or not. &lt;BR /&gt;
mcolumn : have list of column like col1,col2,col3&lt;BR /&gt;
&lt;BR /&gt;
data _NULL_;&lt;BR /&gt;
set lib.ABC;&lt;BR /&gt;
if upcase(trim(symget('mcolumn'))) = "NA" &lt;BR /&gt;
then do; &lt;BR /&gt;
      putlog "THEN MODULE"; &lt;BR /&gt;
      call symputx('MandRet','1'); &lt;BR /&gt;
      stop; &lt;BR /&gt;
      end;&lt;BR /&gt;
else do;&lt;BR /&gt;
      putlog "not null";&lt;BR /&gt;
	  s = countc(trim(symget('mcolumn')),',')+1;&lt;BR /&gt;
	  n=1;&lt;BR /&gt;
      do while(n&amp;lt;=s);      &lt;BR /&gt;
	       put n=;&lt;BR /&gt;
	       p=trim(scan(symget('mcolumn'),n,','));		   &lt;BR /&gt;
		   PUT P=;&lt;BR /&gt;
		   call symputx('ColValue',p);		   &lt;BR /&gt;
		   IF missing(resolve(P)) THEN DO; &lt;BR /&gt;
		     put P=;&lt;BR /&gt;
             PUTLOG "TRUE";  &lt;BR /&gt;
             STOP; &lt;BR /&gt;
           END; 	   &lt;BR /&gt;
		   n=n+1;&lt;BR /&gt;
	  end;&lt;BR /&gt;
	 end;&lt;BR /&gt;
run;&lt;BR /&gt;
%mend Mandatory_column_check;&lt;BR /&gt;
%Mandatory_column_check(AmdBLCMExtInitCsmAccount)&lt;BR /&gt;
&lt;BR /&gt;
in the above program in do while loop i create one macro variable colvalue .it is containg name of column to be checked. in the next step i have to check column's value .....&lt;BR /&gt;
&lt;BR /&gt;
but there is a rules that if create macro in data step then you can't use that macro in same data step......&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
i am completly in base sas 9.1 ...i don't know mush about that...and most of the time i get confusion abt macro concept....i am not able to understand how sas program works....please suggets me any book so that i can clear my basic concept.....</description>
      <pubDate>Tue, 16 Dec 2008 13:28:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/problem-related-to-use-of-macro-in-base-sas-9-1/m-p/66066#M6630</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-12-16T13:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: problem related to use of macro in base sas 9.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/problem-related-to-use-of-macro-in-base-sas-9-1/m-p/66067#M6631</link>
      <description>Hi Arvind,&lt;BR /&gt;
&lt;BR /&gt;
Try reposting -- It looks like all your text didn't show up. Off the top of my head, I would do something like:&lt;BR /&gt;
&lt;BR /&gt;
array vars[3] col1-col3;&lt;BR /&gt;
array misscounts[3];&lt;BR /&gt;
do i=1 to dim(vars);&lt;BR /&gt;
  if vars&lt;I&gt;=. then misscounts&lt;I&gt;+1;&lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
The variables misscounts1-misscounts3 will contain the number of missing values in each of col1-col3. Then you'd just need use that info to figure out how it relates to col1-col3.&lt;/I&gt;&lt;/I&gt;</description>
      <pubDate>Tue, 16 Dec 2008 21:37:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/problem-related-to-use-of-macro-in-base-sas-9-1/m-p/66067#M6631</guid>
      <dc:creator>RichardH_sas</dc:creator>
      <dc:date>2008-12-16T21:37:26Z</dc:date>
    </item>
  </channel>
</rss>

