<?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: proc expand question in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-expand-question/m-p/197846#M49446</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@art297,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I posted a PROC EXPAND example and another using PROC TRANSREG for good measure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For further reading I would recommend the following topic from SAS-L:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://marc.info/?t=139164201000004&amp;amp;r=1&amp;amp;w=2" title="http://marc.info/?t=139164201000004&amp;amp;r=1&amp;amp;w=2"&gt;http://marc.info/?t=139164201000004&amp;amp;r=1&amp;amp;w=2&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Mar 2015 02:14:08 GMT</pubDate>
    <dc:creator>FriedEgg</dc:creator>
    <dc:date>2015-03-10T02:14:08Z</dc:date>
    <item>
      <title>proc expand question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-expand-question/m-p/197845#M49445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just out of curiosity, can someone post a proc expand solution to the problem posed in the thread: &lt;A __default_attr="72639" __jive_macro_name="thread" class="jive_macro jive_macro_thread active_link" href="https://communities.sas.com/" modifiedtitle="true" title="Array linear interpolation"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TIA,&lt;/P&gt;&lt;P&gt;Art&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2015 00:06:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-expand-question/m-p/197845#M49445</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-03-10T00:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: proc expand question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-expand-question/m-p/197846#M49446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@art297,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I posted a PROC EXPAND example and another using PROC TRANSREG for good measure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For further reading I would recommend the following topic from SAS-L:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://marc.info/?t=139164201000004&amp;amp;r=1&amp;amp;w=2" title="http://marc.info/?t=139164201000004&amp;amp;r=1&amp;amp;w=2"&gt;http://marc.info/?t=139164201000004&amp;amp;r=1&amp;amp;w=2&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2015 02:14:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-expand-question/m-p/197846#M49446</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2015-03-10T02:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: proc expand question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-expand-question/m-p/197847#M49447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In this particular case, one must do a little gymnastics to fix the beginning and end of the series :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data temp(drop=i first:) first(keep=first:);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set have end=done;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;array v{*} v:;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;array first{1024} (1024*.);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;do i = 1 to dim(v);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if v{i}=0 then call missing (v{i});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if missing(first{i}) then first{i} = v{i};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;output temp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if done then output first;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc expand data=temp out=expanded;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;id id;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;convert v: / method=join;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if _n_=1 then set first;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set expanded;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;array v{*} v:;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;array first{*} first:;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;do i = 1 to dim(v);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if missing(v{i}) then &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if missing(first{i}) then v{i} = 0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else v{i} = first{i};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else call missing(first{i});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;drop i first:;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2015 02:46:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-expand-question/m-p/197847#M49447</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-03-10T02:46:06Z</dc:date>
    </item>
  </channel>
</rss>

