<?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 to use multiple variable names in a strip condition in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-multiple-variable-names-in-a-strip-condition/m-p/358987#M84399</link>
    <description>&lt;P&gt;i am using the below condition and want to make it standard. but for some sstudies the variable name "aeacn" is "aacn". is there any way where i can make sure that if it is aacn then also it needs to consider.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data inc;
 set adae;
 if strip(aeacn)="" and strip(withdraw)="" then aeact_use=""; 
 else if aecontrt="N" and strip(upcase(aeacn)) in ("", "NA", "DOSE NO CHANGED") then aeact_use="0";
 else do;
   if aecontrt="Y" then aeact_use="1";
   if strip(upcase(aeacn)) not in ("", "NOT APPLICABLE", "DOSE NOT CHANGED", "DOSE NO CHANGED") then do;
     if aeact_use="" then aeact_use="8";
   end; 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 16 May 2017 13:04:53 GMT</pubDate>
    <dc:creator>alexdsa310</dc:creator>
    <dc:date>2017-05-16T13:04:53Z</dc:date>
    <item>
      <title>how to use multiple variable names in a strip condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-multiple-variable-names-in-a-strip-condition/m-p/358987#M84399</link>
      <description>&lt;P&gt;i am using the below condition and want to make it standard. but for some sstudies the variable name "aeacn" is "aacn". is there any way where i can make sure that if it is aacn then also it needs to consider.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data inc;
 set adae;
 if strip(aeacn)="" and strip(withdraw)="" then aeact_use=""; 
 else if aecontrt="N" and strip(upcase(aeacn)) in ("", "NA", "DOSE NO CHANGED") then aeact_use="0";
 else do;
   if aecontrt="Y" then aeact_use="1";
   if strip(upcase(aeacn)) not in ("", "NOT APPLICABLE", "DOSE NOT CHANGED", "DOSE NO CHANGED") then do;
     if aeact_use="" then aeact_use="8";
   end; 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 May 2017 13:04:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-multiple-variable-names-in-a-strip-condition/m-p/358987#M84399</guid>
      <dc:creator>alexdsa310</dc:creator>
      <dc:date>2017-05-16T13:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to use multiple variable names in a strip condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-multiple-variable-names-in-a-strip-condition/m-p/358999#M84408</link>
      <description>&lt;P&gt;Your code seems to be missing an END.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think your question is related to having inconsistent input data structures?&lt;/P&gt;
&lt;P&gt;If so then just add code to make the data consistent and then run the same logic.&lt;/P&gt;
&lt;P&gt;So if your code references variable A and your input could have A or B then add something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;length A B $30 ;
A=coalesce(A,B);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That way A is always defined and wil have the first non missing value between the two variables.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 13:08:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-multiple-variable-names-in-a-strip-condition/m-p/358999#M84408</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-05-16T13:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to use multiple variable names in a strip condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-multiple-variable-names-in-a-strip-condition/m-p/359005#M84411</link>
      <description>&lt;P&gt;Thanks tom.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I i use your solution i get the following note&lt;/P&gt;&lt;P&gt;NOTE: Invalid numeric data for that variable&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 13:12:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-multiple-variable-names-in-a-strip-condition/m-p/359005#M84411</guid>
      <dc:creator>alexdsa310</dc:creator>
      <dc:date>2017-05-16T13:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to use multiple variable names in a strip condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-multiple-variable-names-in-a-strip-condition/m-p/359008#M84413</link>
      <description>&lt;P&gt;sorry code which i modified&lt;/P&gt;&lt;P&gt;data inc;&lt;BR /&gt;set adae;&lt;BR /&gt;length aeacn aacn $30 ;&lt;BR /&gt;aeacn=coalesce(aeacn,aacn);&lt;BR /&gt;if strip(aecontrt)="" and strip(aeacn)="" and strip(withdraw)="" then aeact_use="";&lt;BR /&gt;else if aecontrt="N" and strip(upcase(aeacn)) in ("", "NOT APPLICABLE", "DOSE NOT CHANGED", "DOSE NO CHANGED") and withdraw="N" then aeact_use="0";&lt;BR /&gt;else do;&lt;BR /&gt;if aecontrt="Y" then aeact_use="1";&lt;BR /&gt;if strip(upcase(aeacn)) not in ("", "NOT APPLICABLE", "DOSE NOT CHANGED", "DOSE NO CHANGED") then do;&lt;BR /&gt;if aeact_use="" then aeact_use="2";&lt;BR /&gt;else aeact_use=strip(aeact_use)||",2";&lt;BR /&gt;end;&lt;BR /&gt;if withdraw="Y" then do;&lt;BR /&gt;if aeact_use="" then aeact_use="3";&lt;BR /&gt;else aeact_use=strip(aeact_use)||",3";&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 13:15:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-multiple-variable-names-in-a-strip-condition/m-p/359008#M84413</guid>
      <dc:creator>alexdsa310</dc:creator>
      <dc:date>2017-05-16T13:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to use multiple variable names in a strip condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-multiple-variable-names-in-a-strip-condition/m-p/359011#M84415</link>
      <description>&lt;P&gt;Sorry. Unlike in SQL in a data step SAS uses&amp;nbsp;different functions for character and numeric values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will need to use the &lt;STRONG&gt;coalesceC()&lt;/STRONG&gt; function.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 13:18:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-multiple-variable-names-in-a-strip-condition/m-p/359011#M84415</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-05-16T13:18:05Z</dc:date>
    </item>
  </channel>
</rss>

