<?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: if then returnng blanks in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/if-then-returnng-blanks/m-p/619725#M182019</link>
    <description>thankyou&lt;BR /&gt;</description>
    <pubDate>Fri, 24 Jan 2020 00:42:23 GMT</pubDate>
    <dc:creator>Ranjeeta</dc:creator>
    <dc:date>2020-01-24T00:42:23Z</dc:date>
    <item>
      <title>if then returnng blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-then-returnng-blanks/m-p/619705#M182010</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new2; 
set new1;
length Reporting_INST_AT $4.;
length Reporting_INST_AM $4. ;
if FAC_NUM=842  and INST_AT = '1423' and INST_AM = '4110' then Reporting_FAC_NUM=976 and Reporting_INST_AT='4804' and Reporting_INST_AM='4805';
else if FAC_NUM=849   then Reporting_FAC_NUM=976 ;
else if FAC_NUM=664  and INST_AT ='1538' and INST_AM ='4113' then Reporting_FAC_NUM=942 and Reporting_INST_AT='4788' and Reporting_INST_AM='4790';
else if FAC_NUM=880  and INST_AM ='3905' then Reporting_FAC_NUM=953 and Reporting_INST_AM='4767';
else if FAC_NUM=731  and INST_AT ='3286' and INST_AM = '3986' then Reporting_FAC_NUM=975 and Reporting_INST_AT='4747' and Reporting_INST_AM='4751';
else if FAC_NUM=949  and INST_AT ='3917' and INST_AM ='4090' then Reporting_FAC_NUM=975 and Reporting_INST_AT='4752' and Reporting_INST_AM='4756';
else if FAC_NUM=956 then Reporting_FAC_NUM=947 ;
else if FAC_NUM=927  and INST_AT ='3707' and INST_AM = '4142' then Reporting_FAC_NUM=933 and Reporting_INST_AT='4773' and Reporting_INST_AM='4774';
else if FAC_NUM=933  and INST_AT ='1079' and INST_AM = '4414' then Reporting_FAC_NUM=933 and Reporting_INST_AT= '1079' and Reporting_INST_AM='4414';
else if FAC_NUM=933  and INST_AT ='4607' then Reporting_FAC_NUM=933 and Reporting_INST_AT='4607' ;
else if FAC_NUM =941 and INST_AT ='1343' and INST_AM ='4089' then Reporting_FAC_NUM=941 and  Reporting_INST_AT='.' and Reporting_INST_AM='4089';
else if FAC_NUM =941 and INST_AT ='3883' and INST_AM ='4260' then Reporting_FAC_NUM=941 and  Reporting_INST_AT='4799' and Reporting_INST_AM='4802';
else if FAC_NUM =941 and INST_AT ='4610' and INST_AM ='4672' then Reporting_FAC_NUM=941 and  Reporting_INST_AT='4799' and Reporting_INST_AM='4802';
else if FAC_NUM =721 and INST_AT ='2177' and INST_AM ='3974' then Reporting_FAC_NUM=977 and  Reporting_INST_AT='4819' and Reporting_INST_AM='4820';
else if FAC_NUM =819 and INST_AT ='2180' and INST_AM ='4118' then Reporting_FAC_NUM=977 and  Reporting_INST_AT='4822' and Reporting_INST_AM='4823';
else if FAC_NUM =692 and INST_AT ='4784' and INST_AM ='4106' then Reporting_FAC_NUM=978 and  Reporting_INST_AT='4830' and Reporting_INST_AM='4829';
else if FAC_NUM =693 and INST_AT ='1100' and INST_AM ='4105' then Reporting_FAC_NUM=978 and  Reporting_INST_AT='4831' and Reporting_INST_AM='4832';
else if FAC_NUM =954 and INST_AT ='3943' and INST_AM ='4139' then Reporting_FAC_NUM=979 and  Reporting_INST_AT='4836' and Reporting_INST_AM='4837';
else if FAC_NUM =960 and INST_AT ='4152' and INST_AM ='3975' then Reporting_FAC_NUM=979 and  Reporting_INST_AT='4840' and Reporting_INST_AM='4839';
else if FAC_NUM =954 and INST_AT ='4014' and INST_AM ='4140' then Reporting_FAC_NUM=952 and  Reporting_INST_AT='4844' and Reporting_INST_AM='4845';
else if FAC_NUM =898 and INST_AT ='1443' and INST_AM ='4056' then Reporting_FAC_NUM=980 and  Reporting_INST_AT='4858' and Reporting_INST_AM='4857';
else if FAC_NUM =773 and INST_AT = '.' and INST_AM ='.' then Reporting_FAC_NUM=980 and Reporting_INST_AM='4860';
else if FAC_NUM=852 and INST_AT = '1444' and INST_AM ='3985' then Reporting_FAC_NUM=980 and Reporting_INST_AT='4865' and Reporting_INST_AM='4864';
else if FAC_NUM=628 and INST_AT = '1223' and INST_AM ='4238' then Reporting_FAC_NUM=981 and Reporting_INST_AT='4869' and Reporting_INST_AM='4868';
else if FAC_NUM=870 and INST_AT = '1239' and INST_AM ='4239' then Reporting_FAC_NUM=981 and Reporting_INST_AT='4871' and Reporting_INST_AM='4870';
else if FAC_NUM=629  then Reporting_FAC_NUM=981 ;
else Reporting_FAC_NUM=FAC_NUM and Reporting_INST_AT=INST_AT and Reporting_INST_AM=INST_AM;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;With the above code I get blanks for&amp;nbsp;Reporting_INST_AT and&amp;nbsp;Reporting_INST_AM and 0 or 1 for&amp;nbsp;&lt;CODE class=" language-sas"&gt;Reporting_FAC_NUM&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;Would someone be able to please point out the reason for the same or give me some hints&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also get the message in the log:&lt;/P&gt;&lt;P&gt;Variable Reporting_INST_AT is uninitialized.&lt;BR /&gt;NOTE: Variable Reporting_INST_AM is uninitialized.&lt;BR /&gt;NOTE: There were 272 observations read from the data set WORK.NEW1.&lt;BR /&gt;NOTE: The data set WORK.NEW2 has 272 observations and 15 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.04 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 22:53:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-then-returnng-blanks/m-p/619705#M182010</guid>
      <dc:creator>Ranjeeta</dc:creator>
      <dc:date>2020-01-23T22:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: if then returnng blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-then-returnng-blanks/m-p/619707#M182011</link>
      <description>&lt;P&gt;You need to change your syntax to:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if (conditions) then &lt;STRONG&gt;do;&lt;/STRONG&gt; stmt; smtmt; stmt; &lt;STRONG&gt;end;&lt;/STRONG&gt;
else if (conditions) then &lt;STRONG&gt;do;&lt;/STRONG&gt; stmt; smtmt; stmt; &lt;STRONG&gt;end;&lt;/STRONG&gt;
else if (conditions) then &lt;STRONG&gt;do;&lt;/STRONG&gt; stmt; smtmt; stmt; &lt;STRONG&gt;end;&lt;/STRONG&gt;
else if (conditions) then &lt;STRONG&gt;do;&lt;/STRONG&gt; stmt; smtmt; stmt; &lt;STRONG&gt;end;&lt;/STRONG&gt;
else &lt;STRONG&gt;do;&lt;/STRONG&gt; stmt; stmt; stmt; &lt;STRONG&gt;end;
&lt;/STRONG&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The data step isn't interpreting the "and"s the way you think it is.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 23:11:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-then-returnng-blanks/m-p/619707#M182011</guid>
      <dc:creator>JeffMaggio</dc:creator>
      <dc:date>2020-01-23T23:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: if then returnng blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-then-returnng-blanks/m-p/619711#M182014</link>
      <description>&lt;P&gt;An explicit example of &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/180206"&gt;@JeffMaggio&lt;/a&gt;'s suggestion:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;else if FAC_NUM=664  and INST_AT ='1538' and INST_AM ='4113' then do;
   Reporting_FAC_NUM=942;
   Reporting_INST_AT='4788';
   Reporting_INST_AM='4790';
end;
&lt;/PRE&gt;
&lt;P&gt;I &lt;STRONG&gt;really &lt;/STRONG&gt;hate lines of code longer than 60 or so characters so put the dependent assignments one per line.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 23:27:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-then-returnng-blanks/m-p/619711#M182014</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-01-23T23:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: if then returnng blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-then-returnng-blanks/m-p/619724#M182018</link>
      <description>&lt;P&gt;thankyou&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 00:42:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-then-returnng-blanks/m-p/619724#M182018</guid>
      <dc:creator>Ranjeeta</dc:creator>
      <dc:date>2020-01-24T00:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: if then returnng blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-then-returnng-blanks/m-p/619725#M182019</link>
      <description>thankyou&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Jan 2020 00:42:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-then-returnng-blanks/m-p/619725#M182019</guid>
      <dc:creator>Ranjeeta</dc:creator>
      <dc:date>2020-01-24T00:42:23Z</dc:date>
    </item>
  </channel>
</rss>

