<?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 to delete . values for multiple variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296680#M62214</link>
    <description>&lt;P&gt;Hi Loko&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I Have used your code but am getting zero observations as result&lt;/P&gt;</description>
    <pubDate>Tue, 06 Sep 2016 10:02:16 GMT</pubDate>
    <dc:creator>sanjay1</dc:creator>
    <dc:date>2016-09-06T10:02:16Z</dc:date>
    <item>
      <title>how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296654#M62203</link>
      <description>&lt;P&gt;Hi Sas Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 4 variables fy13,fy14,fy15,fy16 which have dot values.&lt;/P&gt;&lt;P&gt;I want to delete . values for multiple variables..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my code;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;set sample;&lt;BR /&gt;if fy13=. then delete;&lt;BR /&gt;if fy14=. then delete;&lt;BR /&gt;if fy15=. then delete;&lt;BR /&gt;if fy16=. then delete;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 08:56:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296654#M62203</guid>
      <dc:creator>sanjay1</dc:creator>
      <dc:date>2016-09-06T08:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296655#M62204</link>
      <description>&lt;P&gt;Do you want to delete the row if any of&amp;nbsp;&lt;SPAN&gt;fy13,fy14,fy15,fy16 is having dot value?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 08:59:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296655#M62204</guid>
      <dc:creator>RahulG</dc:creator>
      <dc:date>2016-09-06T08:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296661#M62205</link>
      <description>&lt;P&gt;Yes Exactly&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 09:26:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296661#M62205</guid>
      <dc:creator>sanjay1</dc:creator>
      <dc:date>2016-09-06T09:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296663#M62206</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/91059"&gt;@sanjay1﻿&lt;/a&gt;&amp;nbsp;So what is your question? Given the problem and code I can't see what you're trying to accomplish.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post more details and include an example of your data and what your expected output.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 09:27:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296663#M62206</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-06T09:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296664#M62207</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/91059"&gt;@sanjay1&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Yes Exactly&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your code already does this ...&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 09:28:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296664#M62207</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-06T09:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296666#M62208</link>
      <description>&lt;P&gt;Than your code works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can write it in a more compact way using &lt;STRONG&gt;or:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test;&lt;BR /&gt;set sample;&lt;BR /&gt;if missing(fy13) or missing(fy14) or &amp;nbsp;missing(fy15) or&amp;nbsp;missing(fy16) then delete;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 09:29:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296666#M62208</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2016-09-06T09:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296667#M62209</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dsn=sashelp.cars;
proc contents data=&amp;amp;dsn. out=contents2(keep =name type) noprint;
run;

%macro delete_cond;

proc sql noprint;
select name into :_name separated by ' '
from contents2
where type =1; /* Check for numeric columns */
quit;

%let key_col_cnt=%sysfunc(countw(&amp;amp;_name));

%do i=1 %to &amp;amp;key_col_cnt;
%let col=%sysfunc(scan( &amp;amp;_name,&amp;amp;i));
%let str=%str(  if &amp;amp;col = . then delete ;);
%put &amp;amp;str;

%end;
%mend;

%delete_cond;
data new_cars;
set &amp;amp;dsn.;
%delete_cond;
run;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have %let dsn=sashelp.cars;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you need to update it.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 09:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296667#M62209</guid>
      <dc:creator>RahulG</dc:creator>
      <dc:date>2016-09-06T09:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296671#M62210</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to calculate the % change for fy13-fy16/fy13&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But since I have missing values am getting the result as missing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code&lt;/P&gt;&lt;P&gt;data sample;&lt;BR /&gt;input fy13 fy14 fy15 fy16;&lt;BR /&gt;datalines;&lt;BR /&gt;. 15 . 16&lt;BR /&gt;19 . 2 15&lt;BR /&gt;. 22 8 .&lt;BR /&gt;17 18 18 20&lt;BR /&gt;24 28 . 9&lt;BR /&gt;;&lt;BR /&gt;run&lt;/P&gt;&lt;P&gt;I want to calculate the % change for fy13-fy16/fy13,&lt;BR /&gt;but since I have missing values am getting the result as missing.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 09:44:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296671#M62210</guid>
      <dc:creator>sanjay1</dc:creator>
      <dc:date>2016-09-06T09:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296678#M62213</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/91059"&gt;@sanjay1&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi Reeza,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I want to calculate the % change for fy13-fy16/fy13&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But since I have missing values am getting the result as missing.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code&lt;/P&gt;
&lt;P&gt;data sample;&lt;BR /&gt;input fy13 fy14 fy15 fy16;&lt;BR /&gt;datalines;&lt;BR /&gt;. 15 . 16&lt;BR /&gt;19 . 2 15&lt;BR /&gt;. 22 8 .&lt;BR /&gt;17 18 18 20&lt;BR /&gt;24 28 . 9&lt;BR /&gt;;&lt;BR /&gt;run&lt;/P&gt;
&lt;P&gt;I want to calculate the % change for fy13-fy16/fy13,&lt;BR /&gt;but since I have missing values am getting the result as missing.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;&lt;/EM&gt;&lt;U&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/U&gt;That makes sense. You didn't indicate what you want as output though.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 09:52:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296678#M62213</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-06T09:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296680#M62214</link>
      <description>&lt;P&gt;Hi Loko&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I Have used your code but am getting zero observations as result&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 10:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296680#M62214</guid>
      <dc:creator>sanjay1</dc:creator>
      <dc:date>2016-09-06T10:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296681#M62215</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/91059"&gt;@sanjay1&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi Loko&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I Have used your code but am getting zero observations as result&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Based on sample data you should have 1 observation. Please post your code and log.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 10:05:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296681#M62215</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-06T10:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296687#M62216</link>
      <description>&lt;P&gt;Hi Rahul,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am new to sas, Your code is confusing to me, if you dont mind could you please help me without macros&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 10:54:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296687#M62216</guid>
      <dc:creator>sanjay1</dc:creator>
      <dc:date>2016-09-06T10:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296692#M62217</link>
      <description>&lt;P&gt;Still not clear how the result should look like.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 11:20:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296692#M62217</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2016-09-06T11:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296705#M62218</link>
      <description>&lt;P&gt;The formula: &lt;STRONG&gt;&amp;nbsp;f13 - f16 / f13&lt;/STRONG&gt; &amp;nbsp;- &lt;U&gt;does not relate&lt;/U&gt; to f14 and f15 ?!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you mean: &lt;STRONG&gt;sum(of f13-f16) / f13&lt;/STRONG&gt; ? this formula will neglect missing values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only case, I see, you will get result of missing is when f13 is missing or&lt;/P&gt;&lt;P&gt;when all the 4 variables are missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check yourself manually;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the given sample, at least one row does not include any missing value:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;17 18 18 20&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;What result do you expect to get for that row?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 17 - 20/13 &amp;nbsp; or &amp;nbsp; (17-20) /13 &amp;nbsp; or (17+18+18+20)/13 ?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 11:56:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296705#M62218</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-09-06T11:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296730#M62221</link>
      <description>&lt;P&gt;I just want to delete the . values from my variables&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 13:42:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296730#M62221</guid>
      <dc:creator>sanjay1</dc:creator>
      <dc:date>2016-09-06T13:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296738#M62222</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/91059"&gt;@sanjay1﻿&lt;/a&gt;&amp;nbsp;rather than us going around in circles please post your expected output.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 13:57:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296738#M62222</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-06T13:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296746#M62223</link>
      <description>&lt;P&gt;You cannot delete a value of a variable !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can: &amp;nbsp;ignore missing values and depending on your calculation&lt;/P&gt;&lt;P&gt;you can replace missing value into 0 (zero) or into 1 (one):&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if var = . then var = 0; &amp;nbsp;/* to add or subtract */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;once again, having input row as:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; f13=2; f14=5; f15=8; f16=9;&lt;/P&gt;&lt;P&gt;what formula you use and what result do you expect ?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 14:15:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296746#M62223</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-09-06T14:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296776#M62231</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My concern is I dont want to get any missing values i.e dots in the variables.(dont want see the missing values I want to delete all the dots).&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 15:49:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296776#M62231</guid>
      <dc:creator>sanjay1</dc:creator>
      <dc:date>2016-09-06T15:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296836#M62252</link>
      <description>&lt;P&gt;options missing=" ";&lt;/P&gt;
&lt;P&gt;will mean that you do not see a period&amp;nbsp;for missing values if that is what you are attempting.&amp;nbsp;SAS will have a value, missing or not, for every variable for every row.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 20:32:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/296836#M62252</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-06T20:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete . values for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/297123#M62363</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 07:59:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-values-for-multiple-variables/m-p/297123#M62363</guid>
      <dc:creator>sanjay1</dc:creator>
      <dc:date>2016-09-08T07:59:48Z</dc:date>
    </item>
  </channel>
</rss>

