<?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: Renaming variables , then assign a numeric to the renamed variable to eventually recode in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564355#M158293</link>
    <description>&lt;P&gt;You need to explain a bit more how you get from the source data you've posted to the output.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please use row 3 in your source, show how the output should look like AND explain the logic how you get from source to target state.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jun 2019 03:57:58 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2019-06-07T03:57:58Z</dc:date>
    <item>
      <title>Renaming variables , then assign a numeric to the renamed variable to eventually recode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/563682#M158049</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WORK.SURVEY;
   infile datalines dsd truncover;
   input NetStation:BEST12. Replicate:BEST12. HardPlastics:BEST12. SoftPlastics:BEST12. PlasticLines:BEST12. Styrofoam:BEST12. Pellets:BEST12. TotalPlastics:BEST12. DriftingWood:BEST12. Pumice:BEST12. Cs:BEST12.;
   format NetStation BEST12. Replicate BEST12. HardPlastics BEST12. SoftPlastics BEST12. PlasticLines BEST12. Styrofoam BEST12. Pellets BEST12. TotalPlastics BEST12. DriftingWood BEST12. Pumice BEST12. Cs BEST12.;
 datalines;
 1 1 1 0 0 0 0 1 0 0 653.5089
 1 2 1 0 0 0 0 1 0 0 691.9619
 1 3 1 0 0 0 0 1 0 4 566.7916
 2 1 1 0 0 0 0 1 1 0 950.4462
 2 2 3 0 0 0 0 3 3 0 2198.9015
 ;;;;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The subject sounds a bit hazy so let me explain&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set with 5 plastic categories eg hard plastic , soft plastic , pellet , plastic lines, styrofoam with counts of those categories under them. These are grouped under total plastics and a count. Then there is driftwood and count and Pumice and count&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All these plastics have been collected at three different instances titled net tow under one net station.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My task is to create a category 1 , 2, 3 under material_captured with 1 -&amp;nbsp; total plastics&amp;nbsp; , 2 - driftwood&amp;nbsp; and 3- pumice which i can then recode into another variable called substance . the recoding using case is simple .&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i need help with is getting total plastics , driftwood and pumice under "materials collected" with 1,2,3 assigned and a count displayed for each instance of replicate (net tow) at the net station .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is a sample of the data set&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking forward to hearing from the experts !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 00:25:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/563682#M158049</guid>
      <dc:creator>axel_p</dc:creator>
      <dc:date>2019-06-06T00:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables , then assign a numeric to the renamed variable to eventually recode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/563721#M158060</link>
      <description>&lt;P&gt;It is very hard to code from pictures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions here: &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; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It appears to me that what you may want to do is use a data step to create a new variable with something like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TotalPlastics = sum(Hardplastics, softplastics, plasticlines, Styrofoam, pettets)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that won't work you really need to provide example of your current SAS data set as "categories under them" doesn't make much sense without an actual example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 14:40:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/563721#M158060</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-05T14:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables , then assign a numeric to the renamed variable to eventually recode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/563932#M158137</link>
      <description>&lt;P&gt;hey ballardw mate , i have edited my post&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hope you can see the data now !&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 00:26:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/563932#M158137</guid>
      <dc:creator>axel_p</dc:creator>
      <dc:date>2019-06-06T00:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables , then assign a numeric to the renamed variable to eventually recode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/563944#M158144</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/276771"&gt;@axel_p&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;&lt;EM&gt;My task is to create a category 1 , 2, 3 under material_captured with 1 -&amp;nbsp; total plastics&amp;nbsp; , 2 - driftwood&amp;nbsp; and 3- pumice&lt;/EM&gt;&amp;nbsp;&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P&gt;What value would this variable Material_Captured contain for row 3 in your sample data where you've got HardPlastics and Pumice?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 02:55:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/563944#M158144</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-06-06T02:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables , then assign a numeric to the renamed variable to eventually recode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564280#M158263</link>
      <description>&lt;P&gt;So what is the output for that example data supposed to look like?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 19:39:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564280#M158263</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-06T19:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables , then assign a numeric to the renamed variable to eventually recode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564352#M158290</link>
      <description>&lt;P&gt;I want the respective counts of total plastics (which is the sum of hard , soft , pellet , line &amp;amp; styrofoam)&amp;nbsp; , driftwood and pumice to come under one column ( materials collected ) mapped against each replicates ( 1,2 ,3 respectively) for their individual netstations.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please find attached snip from excel for how it should look like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my other question is how do i get replicates to repeat 3 times ( total 9 times ) each for each netstation ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 03:50:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564352#M158290</guid>
      <dc:creator>axel_p</dc:creator>
      <dc:date>2019-06-07T03:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables , then assign a numeric to the renamed variable to eventually recode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564353#M158291</link>
      <description>&lt;P&gt;please find attached what I want my output to look like&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 03:50:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564353#M158291</guid>
      <dc:creator>axel_p</dc:creator>
      <dc:date>2019-06-07T03:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables , then assign a numeric to the renamed variable to eventually recode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564355#M158293</link>
      <description>&lt;P&gt;You need to explain a bit more how you get from the source data you've posted to the output.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please use row 3 in your source, show how the output should look like AND explain the logic how you get from source to target state.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 03:57:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564355#M158293</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-06-07T03:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables , then assign a numeric to the renamed variable to eventually recode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564356#M158294</link>
      <description>&lt;P&gt;Hi Patrick&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the respective counts of total plastics (which is the sum of hard , soft , pellet , line &amp;amp; styrofoam)&amp;nbsp; , driftwood and pumice to come under one column ( materials collected ) mapped against each replicates ( 1,2 ,3 respectively) for their individual netstations.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hope that clarifies !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 04:15:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564356#M158294</guid>
      <dc:creator>axel_p</dc:creator>
      <dc:date>2019-06-07T04:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables , then assign a numeric to the renamed variable to eventually recode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564357#M158295</link>
      <description>&lt;P&gt;I have also attached an excel grab of what i want my output to look like in a previous post ! let me know if there is still some gap between getting from source to target state&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 04:20:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564357#M158295</guid>
      <dc:creator>axel_p</dc:creator>
      <dc:date>2019-06-07T04:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables , then assign a numeric to the renamed variable to eventually recode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564377#M158300</link>
      <description>&lt;P&gt;Below implemented how I understand your requirement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WORK.SURVEY;
   infile datalines dsd truncover dlm=' ';
   input NetStation:BEST12. Replicate:BEST12. HardPlastics:BEST12. SoftPlastics:BEST12. PlasticLines:BEST12. Styrofoam:BEST12. Pellets:BEST12. TotalPlastics:BEST12. DriftingWood:BEST12. Pumice:BEST12. Cs:BEST12.;
   format NetStation BEST12. Replicate BEST12. HardPlastics BEST12. SoftPlastics BEST12. PlasticLines BEST12. Styrofoam BEST12. Pellets BEST12. TotalPlastics BEST12. DriftingWood BEST12. Pumice BEST12. Cs BEST12.;
 datalines;
1 1 1 0 0 0 0 1 0 0 653.5089
1 2 1 0 0 0 0 1 0 0 691.9619
1 3 1 0 0 0 0 1 0 4 566.7916
2 1 1 0 0 0 0 1 1 0 950.4462
2 2 3 0 0 0 0 3 3 0 2198.9015
;;;;

data want(keep=NetStation Replicate materials_collected count);
  set SURVEY;
  materials_collected='1';
  count=sum(HardPlastics, SoftPlastics, PlasticLines, Styrofoam, Pellets);
  output;
  materials_collected='2';
  count=DriftingWood;
  output;
  materials_collected='3';
  count=Pumice;
  output;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Jun 2019 06:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564377#M158300</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-06-07T06:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables , then assign a numeric to the renamed variable to eventually recode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564634#M158401</link>
      <description>&lt;P&gt;Thank you Patrick ! that was amazing&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have one more question for you if you dont mind&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to produce a graph that compares the freq of the new variable substance by nettype that shows the substance&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;wondering which sort of a graph would be most appropriate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried a 3 way proc freq table which didnt really look good.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im thinking more in terms of a vbar for each nettype by substance that has count on the y axis&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please also find embedded the data set that im referring to&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WORK.A3;
   infile datalines dsd truncover;
   input Nettype:$23. Substance:$12. count:32.;
 datalines;
 Neuston/ 335/ 1.2 x 0.6 natural 0
 Neuston/ 335/ 1.2 x 0.6 man-made 1
 Neuston/ 335/ 1.2 x 0.6 mixed sample 0
 Neuston/ 335/ 1.2 x 0.6 mixed sample 0
 Neuston/ 335/ 1.2 x 0.6 natural 0
 ;;;;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 08 Jun 2019 07:31:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564634#M158401</guid>
      <dc:creator>axel_p</dc:creator>
      <dc:date>2019-06-08T07:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables , then assign a numeric to the renamed variable to eventually recode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564701#M158421</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/276771"&gt;@axel_p&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reporting is not really my home turf.&amp;nbsp;I suggest you post this as a new questions - eventually under "ODS and Base Reporting".&lt;/P&gt;
&lt;P&gt;Ideally each discussion addresses one question/topic. You can always post a link to a previous discussion if you feel questions are linked or previous discussions will help to clarify what you're after.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2019 22:40:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renamed-variable/m-p/564701#M158421</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-06-08T22:40:25Z</dc:date>
    </item>
  </channel>
</rss>

