<?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 Replace all missing values of specific years in a panel data to 0 (not all missing values to 0) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Replace-all-missing-values-of-specific-years-in-a-panel-data-to/m-p/360207#M274630</link>
    <description>&lt;P&gt;Hi, I want to change all missing values from the year 1982 to 1988 to 0, but I want to keep data from 1980 to 1981 and from 1989 to 1991 unchanged. I just put income variable here but my original data set has 45 variables. I want to apply the change to all the variables. Could anyone please help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8970iB3D08154981A1379/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Picture1.png" title="Picture1.png" /&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 20 May 2017 19:15:26 GMT</pubDate>
    <dc:creator>nazmul</dc:creator>
    <dc:date>2017-05-20T19:15:26Z</dc:date>
    <item>
      <title>Replace all missing values of specific years in a panel data to 0 (not all missing values to 0)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-all-missing-values-of-specific-years-in-a-panel-data-to/m-p/360207#M274630</link>
      <description>&lt;P&gt;Hi, I want to change all missing values from the year 1982 to 1988 to 0, but I want to keep data from 1980 to 1981 and from 1989 to 1991 unchanged. I just put income variable here but my original data set has 45 variables. I want to apply the change to all the variables. Could anyone please help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8970iB3D08154981A1379/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Picture1.png" title="Picture1.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 May 2017 19:15:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-all-missing-values-of-specific-years-in-a-panel-data-to/m-p/360207#M274630</guid>
      <dc:creator>nazmul</dc:creator>
      <dc:date>2017-05-20T19:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: Replace all missing values of specific years in a panel data to 0 (not all missing values to 0)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-all-missing-values-of-specific-years-in-a-panel-data-to/m-p/360208#M274631</link>
      <description>&lt;P&gt;Please do not post data as an image. To use your data we would have to type it out, which you should really do ahead of time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are instructions here on how to post your data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your question is a conditional execution.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So your conditions appear to be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If year Greater than or equal to 1982 and year less than or equal to 1988&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; If income is missing then set income to 0&lt;/P&gt;
&lt;P&gt;Else do nothing&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this is correct you can convert it to code via:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*If year Greater than or equal to 1982 and year less than or equal to 1988;
if year &amp;gt;= 1982 and year &amp;lt;= 1998 then do;
    *If income is missing then set income to 0;
     if income = . then income=0;
*else do nothing;
end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To incorporate multiple values you would need an array.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To create an array you need to list all the variables somehow and they need to be the same type.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suggest giving the expansion a try yourself and posting back if you have issues:&lt;/P&gt;
&lt;P&gt;Here's a tutorial:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-arrays/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-arrays/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 May 2017 19:26:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-all-missing-values-of-specific-years-in-a-panel-data-to/m-p/360208#M274631</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-20T19:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Replace all missing values of specific years in a panel data to 0 (not all missing values to 0)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-all-missing-values-of-specific-years-in-a-panel-data-to/m-p/360209#M274632</link>
      <description>&lt;P&gt;Thank you for your help. Regarding my impage upload, I am sorry I did not know the rule. Should I upload a SAS file instead from next time?&lt;/P&gt;</description>
      <pubDate>Sat, 20 May 2017 19:36:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-all-missing-values-of-specific-years-in-a-panel-data-to/m-p/360209#M274632</guid>
      <dc:creator>nazmul</dc:creator>
      <dc:date>2017-05-20T19:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Replace all missing values of specific years in a panel data to 0 (not all missing values to 0)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-all-missing-values-of-specific-years-in-a-panel-data-to/m-p/360212#M274633</link>
      <description>&lt;P&gt;Don't upload any files.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the future use the instructions in the post linked to create a data step so someone can recreate your dataset via a program. This means there's no risk of downloading an infected file.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 May 2017 20:07:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-all-missing-values-of-specific-years-in-a-panel-data-to/m-p/360212#M274633</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-20T20:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Replace all missing values of specific years in a panel data to 0 (not all missing values to 0)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-all-missing-values-of-specific-years-in-a-panel-data-to/m-p/360214#M274634</link>
      <description>&lt;P&gt;Thank you for your suggestion. I will do&lt;/P&gt;</description>
      <pubDate>Sat, 20 May 2017 20:10:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-all-missing-values-of-specific-years-in-a-panel-data-to/m-p/360214#M274634</guid>
      <dc:creator>nazmul</dc:creator>
      <dc:date>2017-05-20T20:10:17Z</dc:date>
    </item>
  </channel>
</rss>

