<?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: Filling missing values in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95485#M27029</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Costasg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the code which should help you to serve your purpose -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;set tmp1.air;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*****filling country value*****/&lt;/P&gt;&lt;P&gt;proc sort data=test out=test_sorted;&lt;/P&gt;&lt;P&gt;by mgrno descending country;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data step1(drop=country rename=(country_new=country));&lt;/P&gt;&lt;P&gt;set test_sorted;&lt;/P&gt;&lt;P&gt;by mgrno ;&lt;/P&gt;&lt;P&gt;retain country_new;&lt;/P&gt;&lt;P&gt;if first.mgrno then country_new=country;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/****filling&amp;nbsp; Exchange Code, Stock Class Code, Stock Class Description and Industry Code***/&lt;/P&gt;&lt;P&gt;proc sort data=step1 out=step1_sorted;&lt;/P&gt;&lt;P&gt;by ticker descending EXCHCD descending STKCD descending STKCDESC descending INDCODE;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data step2(drop=EXCHCD STKCD STKCDESC INDCODE rename=(exchcd_new=EXCHCD STKCD_new=STKCD STKCDESC_new=STKCDESC INDCODE_new=INDCODE));&lt;/P&gt;&lt;P&gt;set step1_sorted;&lt;/P&gt;&lt;P&gt;by ticker;&lt;/P&gt;&lt;P&gt;if first.ticker then do;&lt;/P&gt;&lt;P&gt;exchcd_new=EXCHCD;&lt;/P&gt;&lt;P&gt;STKCD_new=STKCD;&lt;/P&gt;&lt;P&gt;STKCDESC_new=STKCDESC;&lt;/P&gt;&lt;P&gt;INDCODE_new=INDCODE;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know in case of any queries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ankit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 03 Feb 2013 14:34:35 GMT</pubDate>
    <dc:creator>Ankitsas</dc:creator>
    <dc:date>2013-02-03T14:34:35Z</dc:date>
    <item>
      <title>Filling missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95480#M27024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a database and I need to fill some missing values. Particullarly, the database spans from the 1980s till 2012. Some information has been available after 1998. So what I want to do is to fill the missing values for these variables back to the start date. More specifically, I want to update the following variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Country&lt;/P&gt;&lt;P&gt;-Exchange Code&lt;/P&gt;&lt;P&gt;-Stock Class Code&lt;/P&gt;&lt;P&gt;-Stock Class Description&lt;/P&gt;&lt;P&gt;-Industry Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone please help me on this?&lt;/P&gt;&lt;P&gt;I am attaching a small sample of the database for 1 stock (as the whole database exceeds 10gb).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Feb 2013 16:36:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95480#M27024</guid>
      <dc:creator>Costasg</dc:creator>
      <dc:date>2013-02-02T16:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Filling missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95481#M27025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What date of the year do you want for the missing years? Which is the date, RDATE or FDATE?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Feb 2013 16:51:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95481#M27025</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-02-02T16:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Filling missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95482#M27026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi PGStats,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to fill these variables from the start date of the database (31/12/1980) and for every observation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So COUNTRY variable should be filled according to manager number and RDATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&amp;nbsp; Exchange Code, Stock Class Code, Stock Class Description and Industry Code variables should be filled according to ticker symbol and FDATE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Feb 2013 17:33:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95482#M27026</guid>
      <dc:creator>Costasg</dc:creator>
      <dc:date>2013-02-02T17:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Filling missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95483#M27027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Costasg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please elaborate on the statement "So COUNTRY variable should be filled according to manager number and RDATE" ?i was trying to work around on this, but the sentence sounds little noisy so thought to ask you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ankit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2013 13:24:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95483#M27027</guid>
      <dc:creator>Ankitsas</dc:creator>
      <dc:date>2013-02-03T13:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Filling missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95484#M27028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually I don't think that dates should matter. There are different dates as these are seperate files downloaded together.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the only thing that needed to be done is to fill the variable Country based on the manager number&lt;/P&gt;&lt;P&gt;and the variables&amp;nbsp; Exchange Code, Stock Class Code, Stock Class Description and Industry Code based on the ticker symbol.&lt;/P&gt;&lt;P&gt;I hope the above helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Costasg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2013 13:32:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95484#M27028</guid>
      <dc:creator>Costasg</dc:creator>
      <dc:date>2013-02-03T13:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Filling missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95485#M27029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Costasg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the code which should help you to serve your purpose -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;set tmp1.air;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*****filling country value*****/&lt;/P&gt;&lt;P&gt;proc sort data=test out=test_sorted;&lt;/P&gt;&lt;P&gt;by mgrno descending country;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data step1(drop=country rename=(country_new=country));&lt;/P&gt;&lt;P&gt;set test_sorted;&lt;/P&gt;&lt;P&gt;by mgrno ;&lt;/P&gt;&lt;P&gt;retain country_new;&lt;/P&gt;&lt;P&gt;if first.mgrno then country_new=country;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/****filling&amp;nbsp; Exchange Code, Stock Class Code, Stock Class Description and Industry Code***/&lt;/P&gt;&lt;P&gt;proc sort data=step1 out=step1_sorted;&lt;/P&gt;&lt;P&gt;by ticker descending EXCHCD descending STKCD descending STKCDESC descending INDCODE;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data step2(drop=EXCHCD STKCD STKCDESC INDCODE rename=(exchcd_new=EXCHCD STKCD_new=STKCD STKCDESC_new=STKCDESC INDCODE_new=INDCODE));&lt;/P&gt;&lt;P&gt;set step1_sorted;&lt;/P&gt;&lt;P&gt;by ticker;&lt;/P&gt;&lt;P&gt;if first.ticker then do;&lt;/P&gt;&lt;P&gt;exchcd_new=EXCHCD;&lt;/P&gt;&lt;P&gt;STKCD_new=STKCD;&lt;/P&gt;&lt;P&gt;STKCDESC_new=STKCDESC;&lt;/P&gt;&lt;P&gt;INDCODE_new=INDCODE;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know in case of any queries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ankit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2013 14:34:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95485#M27029</guid>
      <dc:creator>Ankitsas</dc:creator>
      <dc:date>2013-02-03T14:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Filling missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95486#M27030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ankitsas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks for this; however it only works for the country variable. The other variables are left missing (including those that initially had values)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2013 14:45:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95486#M27030</guid>
      <dc:creator>Costasg</dc:creator>
      <dc:date>2013-02-03T14:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Filling missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95487#M27031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Costasg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sincere apology, please find the updated code below :-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;set tmp1.air;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*****filling country value*****/&lt;/P&gt;&lt;P&gt;proc sort data=test out=test_sorted;&lt;/P&gt;&lt;P&gt;by mgrno descending country;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data step1(drop=country rename=(country_new=country));&lt;/P&gt;&lt;P&gt;set test_sorted;&lt;/P&gt;&lt;P&gt;by mgrno ;&lt;/P&gt;&lt;P&gt;retain country_new;&lt;/P&gt;&lt;P&gt;if first.mgrno then country_new=country;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/****filling&amp;nbsp; Exchange Code, Stock Class Code, Stock Class Description and Industry Code***/&lt;/P&gt;&lt;P&gt;proc sort data=step1 out=step1_sorted;&lt;/P&gt;&lt;P&gt;by ticker descending EXCHCD descending STKCD descending STKCDESC descending INDCODE;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data step2(drop=EXCHCD STKCD STKCDESC INDCODE rename=(exchcd_new=EXCHCD STKCD_new=STKCD STKCDESC_new=STKCDESC INDCODE_new=INDCODE));&lt;/P&gt;&lt;P&gt;set step1_sorted;&lt;/P&gt;&lt;P&gt;by ticker;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;retain exchcd_new STKCD_new STKCDESC_new INDCODE_new;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if first.ticker then do;&lt;/P&gt;&lt;P&gt;exchcd_new=EXCHCD;&lt;/P&gt;&lt;P&gt;STKCD_new=STKCD;&lt;/P&gt;&lt;P&gt;STKCDESC_new=STKCDESC;&lt;/P&gt;&lt;P&gt;INDCODE_new=INDCODE;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please use this code and hope it will work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ankit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2013 15:04:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95487#M27031</guid>
      <dc:creator>Ankitsas</dc:creator>
      <dc:date>2013-02-03T15:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Filling missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95488#M27032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It works just fine!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks Ankit!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2013 21:59:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Filling-missing-values/m-p/95488#M27032</guid>
      <dc:creator>Costasg</dc:creator>
      <dc:date>2013-02-03T21:59:49Z</dc:date>
    </item>
  </channel>
</rss>

