<?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: What is the purpose of these extra assignment in code? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-purpose-of-these-extra-assignment-in-code/m-p/485024#M125971</link>
    <description>&lt;P&gt;A, B, C, D, E, F are variables. If these variables are not present in the&amp;nbsp;man_dim_state data set, then the assignment statements will fail, and they should not be present.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Aug 2018 07:03:30 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2018-08-08T07:03:30Z</dc:date>
    <item>
      <title>What is the purpose of these extra assignment in code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-purpose-of-these-extra-assignment-in-code/m-p/485022#M125970</link>
      <description>&lt;P&gt;Hi everyone. I am currently looking at codes written by other programmers but I do not understand the purpose of it.&lt;/P&gt;&lt;P&gt;Here are the codes :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  attrib state_code length=$5 label='State Code';
  attrib state length=$30 label='State Name';
  attrib state_zone_id length=$30 label='State Zone ID';
  attrib state_zone_code length=$30 label='State Zone Code';
  attrib state_zone_name length=$30 label='State Zone Name';
  *attrib gis_state length=8 label='GIS State No';
  attrib data_dttm length=8 format=datetime. label='Data Date and Time';
  set man_dim_state (firstobs=2);
  region=A;
  zone=put(input(put(B, 2.),2.),z2.);
  state_code=C;
  state=D;
  state_zone_id=E;
  state_zone_code=F;
  state_zone_name=G;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, the bottom portion of the code is basically assigning english letter to it. However, there is no such value in the output with C D E F. Moreover, there is also no such column C D E F but the original name(StateXXX).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone explain the possible reasons for these codes?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 06:59:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-purpose-of-these-extra-assignment-in-code/m-p/485022#M125970</guid>
      <dc:creator>imdickson</dc:creator>
      <dc:date>2018-08-08T06:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: What is the purpose of these extra assignment in code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-purpose-of-these-extra-assignment-in-code/m-p/485024#M125971</link>
      <description>&lt;P&gt;A, B, C, D, E, F are variables. If these variables are not present in the&amp;nbsp;man_dim_state data set, then the assignment statements will fail, and they should not be present.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 07:03:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-purpose-of-these-extra-assignment-in-code/m-p/485024#M125971</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-08-08T07:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: What is the purpose of these extra assignment in code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-purpose-of-these-extra-assignment-in-code/m-p/485026#M125972</link>
      <description>&lt;P&gt;Look at the whole code of that step. There's either a set that reads from a dataset, or infile and input that read from an external file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Correction: there is a set, just not where I would write it &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If columns A to G are not present in your resulting dataset, they are dropped somewhere along the way (either with a drop statement or a drop= dataset option).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 07:07:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-purpose-of-these-extra-assignment-in-code/m-p/485026#M125972</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-08T07:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: What is the purpose of these extra assignment in code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-purpose-of-these-extra-assignment-in-code/m-p/485028#M125973</link>
      <description>&lt;P&gt;This code expects that the incoming data set contains variables named A, B, C, D, E, F, G.&amp;nbsp; It probably drops these variables later in the DATA step (we know you are not showing the entire DATA step here).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The intention of the code:&lt;/P&gt;
&lt;P&gt;The data gets converted to a structure that uses different variable names, with different lengths and labels for the variables.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 07:07:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-purpose-of-these-extra-assignment-in-code/m-p/485028#M125973</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-08T07:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: What is the purpose of these extra assignment in code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-purpose-of-these-extra-assignment-in-code/m-p/485171#M126022</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This code expects that the incoming data set contains variables named A, B, C, D, E, F, G.&amp;nbsp; It probably drops these variables later in the DATA step (we know you are not showing the entire DATA step here).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The intention of the code:&lt;/P&gt;
&lt;P&gt;The data gets converted to a structure that uses different variable names, with different lengths and labels for the variables.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And at a guess to go along with &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;,&amp;nbsp;this code smells like it is "fixing" poorly imported data to match a defined set of characteristics. Possibly so data sets can be combined.&lt;/P&gt;
&lt;P&gt;If your code in the scheme of this process shows use of Proc Import code then the data reading process is suspect and fixes like this become common when relying on Proc Import for reading multiple similar files.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 14:44:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-purpose-of-these-extra-assignment-in-code/m-p/485171#M126022</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-08T14:44:42Z</dc:date>
    </item>
  </channel>
</rss>

