<?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 Looking for help with what code is doing. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Looking-for-help-with-what-code-is-doing/m-p/165981#M43016</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm looking at a piece of code a previous program wrote and I'm stuck on what seems like a very simple piece of code but I can't seem to figure out what it is doing.&lt;/P&gt;&lt;P&gt;I have 2 tables with the same list of people ids from two separate years.&amp;nbsp; Each row can have up too 3 phone numbers for that person per year.&amp;nbsp; In this code it's merging the two tables by the person id and an array is created for the set of variables from each year.&amp;nbsp; My issue is what is happening in the do loop?&amp;nbsp; Is it just setting the first array equal to the second array?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14157176645311571" jivemacro_uid="_14157176645311571"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;data phone&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length pid id_a id_b phid1_a phid2_a phid3_a phid1_b phid2_b phid3_b 8 ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; merge&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line_1 (rename=(ID=ID_A PHID1=PHID1_A PHID2=PHID2_A PHID3=PHID3_A))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line_2 (rename=(ID=ID_B PHID1=PHID1_B PHID2=PHID2_B PHID3=PHID3_B))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by pid ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array phna {*} phytype_a phone_a ext_a listed_a ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array phnb {*} phytype_b phone_b ext_b listed_b ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = 1 to dim(phna) ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; phna(i) = phnb(i) ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end ;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;run ;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Nov 2014 14:52:33 GMT</pubDate>
    <dc:creator>jerry898969</dc:creator>
    <dc:date>2014-11-11T14:52:33Z</dc:date>
    <item>
      <title>Looking for help with what code is doing.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Looking-for-help-with-what-code-is-doing/m-p/165981#M43016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm looking at a piece of code a previous program wrote and I'm stuck on what seems like a very simple piece of code but I can't seem to figure out what it is doing.&lt;/P&gt;&lt;P&gt;I have 2 tables with the same list of people ids from two separate years.&amp;nbsp; Each row can have up too 3 phone numbers for that person per year.&amp;nbsp; In this code it's merging the two tables by the person id and an array is created for the set of variables from each year.&amp;nbsp; My issue is what is happening in the do loop?&amp;nbsp; Is it just setting the first array equal to the second array?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14157176645311571" jivemacro_uid="_14157176645311571"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;data phone&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length pid id_a id_b phid1_a phid2_a phid3_a phid1_b phid2_b phid3_b 8 ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; merge&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line_1 (rename=(ID=ID_A PHID1=PHID1_A PHID2=PHID2_A PHID3=PHID3_A))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line_2 (rename=(ID=ID_B PHID1=PHID1_B PHID2=PHID2_B PHID3=PHID3_B))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by pid ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array phna {*} phytype_a phone_a ext_a listed_a ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array phnb {*} phytype_b phone_b ext_b listed_b ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = 1 to dim(phna) ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; phna(i) = phnb(i) ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end ;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;run ;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 14:52:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Looking-for-help-with-what-code-is-doing/m-p/165981#M43016</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2014-11-11T14:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for help with what code is doing.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Looking-for-help-with-what-code-is-doing/m-p/165982#M43017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yep, not sure what the question was exactly, but phna can be thought of as an alias to the listed variables and phnb to the others, so phyntype_b = phyntype_a, phone_b = phone_a.&amp;nbsp; I think they are trying to avoid a long list of this variable = that variable, though for four assignments its a bit pointless.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 15:06:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Looking-for-help-with-what-code-is-doing/m-p/165982#M43017</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-11-11T15:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for help with what code is doing.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Looking-for-help-with-what-code-is-doing/m-p/165983#M43018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The value of each variable in the first array will be the value of the corresponding variable in the second array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.G. &lt;STRONG&gt;phytype_a &lt;/STRONG&gt;will have the value of&amp;nbsp; &lt;STRONG&gt;phytype_b&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 15:08:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Looking-for-help-with-what-code-is-doing/m-p/165983#M43018</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2014-11-11T15:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for help with what code is doing.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Looking-for-help-with-what-code-is-doing/m-p/165984#M43019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I think it can be done without introducing rename and arrays as long as you put line_2 dataset after line_1 dataset in merge statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 15:11:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Looking-for-help-with-what-code-is-doing/m-p/165984#M43019</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-11-11T15:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for help with what code is doing.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Looking-for-help-with-what-code-is-doing/m-p/165985#M43020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you everyone for your help.&amp;nbsp; I just wanted to make sure I was making sense of it before I proceeded. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;stat@sas,&amp;nbsp; I have different values in of the rename fields, won't that only leave one version of the variables? pid is the only variable value that they will have in common. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for clarifying the code for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 15:26:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Looking-for-help-with-what-code-is-doing/m-p/165985#M43020</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2014-11-11T15:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for help with what code is doing.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Looking-for-help-with-what-code-is-doing/m-p/165986#M43021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, it will leave only one version of the variables. I was assuming that you just want to update phone and other variables based on latest information contained in line_2 dataset.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 15:36:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Looking-for-help-with-what-code-is-doing/m-p/165986#M43021</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-11-11T15:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for help with what code is doing.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Looking-for-help-with-what-code-is-doing/m-p/165987#M43022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi stat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do but I have to keep the id values for reference later in the process by another co-worker. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 15:56:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Looking-for-help-with-what-code-is-doing/m-p/165987#M43022</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2014-11-11T15:56:07Z</dc:date>
    </item>
  </channel>
</rss>

