<?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 How can i not create a dataset if a variable is completely blank in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-can-i-not-create-a-dataset-if-a-variable-is-completely-blank/m-p/419129#M103029</link>
    <description>&lt;P&gt;How can i not create a dataset if a variable is completely blank.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am looping my program to create multiple datasets and i want to create a condition like if a particular macro variable is blank than not to create that dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help? i tried %goto exit but it didnt work&lt;/P&gt;
&lt;PRE&gt;  %if &amp;amp;suppvar_list. ne %then %goto exit;
  %else %if;
	%** Loop through each variable thats being pushed to SUPP **;
    %if %sysevalf(%superq(suppvar_list) ne,boolean) %then 
		%do j = 1 %to %sysfunc(countw(&amp;amp;suppvar_list.));
			%let curr_var = %scan(&amp;amp;suppvar_list., &amp;amp;j.);
			if not missing(&amp;amp;curr_var.) then do;
				QNAM = upcase(vname(&amp;amp;curr_var.));

				%** Look-up to get a label **;
				rc = _hhSUPP.find(key:QNAM);
				if rc ^= 0 then do;
					QLABEL = vlabel(&amp;amp;curr_var.);
				end; 
                 QVAL = &amp;amp;curr_var.;
				output;
				
			end;
		%end;
	  %**if suppvar_list is missing then QNAM, QORIG, QEVAL should be blank;
		%else %do;
		  %do j = 1 %to %sysfunc(countw(&amp;amp;suppvar_list,%str()));
		  %let curr_var = %scan(&amp;amp;suppvar_list., &amp;amp;j.);
			call missing(QNAM, QORIG, QEVAL);
		%end; 
		%end;
%end;&lt;/PRE&gt;</description>
    <pubDate>Thu, 07 Dec 2017 11:20:35 GMT</pubDate>
    <dc:creator>vraj1</dc:creator>
    <dc:date>2017-12-07T11:20:35Z</dc:date>
    <item>
      <title>How can i not create a dataset if a variable is completely blank</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-i-not-create-a-dataset-if-a-variable-is-completely-blank/m-p/419129#M103029</link>
      <description>&lt;P&gt;How can i not create a dataset if a variable is completely blank.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am looping my program to create multiple datasets and i want to create a condition like if a particular macro variable is blank than not to create that dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help? i tried %goto exit but it didnt work&lt;/P&gt;
&lt;PRE&gt;  %if &amp;amp;suppvar_list. ne %then %goto exit;
  %else %if;
	%** Loop through each variable thats being pushed to SUPP **;
    %if %sysevalf(%superq(suppvar_list) ne,boolean) %then 
		%do j = 1 %to %sysfunc(countw(&amp;amp;suppvar_list.));
			%let curr_var = %scan(&amp;amp;suppvar_list., &amp;amp;j.);
			if not missing(&amp;amp;curr_var.) then do;
				QNAM = upcase(vname(&amp;amp;curr_var.));

				%** Look-up to get a label **;
				rc = _hhSUPP.find(key:QNAM);
				if rc ^= 0 then do;
					QLABEL = vlabel(&amp;amp;curr_var.);
				end; 
                 QVAL = &amp;amp;curr_var.;
				output;
				
			end;
		%end;
	  %**if suppvar_list is missing then QNAM, QORIG, QEVAL should be blank;
		%else %do;
		  %do j = 1 %to %sysfunc(countw(&amp;amp;suppvar_list,%str()));
		  %let curr_var = %scan(&amp;amp;suppvar_list., &amp;amp;j.);
			call missing(QNAM, QORIG, QEVAL);
		%end; 
		%end;
%end;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Dec 2017 11:20:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-i-not-create-a-dataset-if-a-variable-is-completely-blank/m-p/419129#M103029</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2017-12-07T11:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can i not create a dataset if a variable is completely blank</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-i-not-create-a-dataset-if-a-variable-is-completely-blank/m-p/419131#M103031</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think we have beedn over this time and time again.&amp;nbsp; Continuing down the route you are going is not in anyway ideal - i.e. insisting on using macro for everything, splitting data up into lots of datasets, looping, etc.&amp;nbsp; They are all consistent with bad process.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 11:25:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-i-not-create-a-dataset-if-a-variable-is-completely-blank/m-p/419131#M103031</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-12-07T11:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: How can i not create a dataset if a variable is completely blank</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-i-not-create-a-dataset-if-a-variable-is-completely-blank/m-p/419220#M103058</link>
      <description>&lt;P&gt;I would ask how and why you create a blank macro variable in the first place.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since your code snippet is an incomplete macro referencing macro variables without any example value, specifying which macro variable is blank when, or showing any code related to actually creating a data set (such as "data &amp;amp;macrodatasetname;" I can't make any reasonable targeted&amp;nbsp;suggestions in response to your specific question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 15:57:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-i-not-create-a-dataset-if-a-variable-is-completely-blank/m-p/419220#M103058</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-12-07T15:57:07Z</dc:date>
    </item>
  </channel>
</rss>

