<?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: Assignment variables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Assignment-variables/m-p/133676#M36294</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For example if proc sql you see cat_desc Eastern Region.&amp;nbsp; However it has not cat_id.&amp;nbsp; Now look in data have.&amp;nbsp; I have replicated the cat_des and have added the cat_id.&amp;nbsp; I need to assign cat_id to cat_desc so I can use the original proc sql datastep in a program to manipulate the variables&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Nov 2013 18:52:59 GMT</pubDate>
    <dc:creator>gnt1986</dc:creator>
    <dc:date>2013-11-07T18:52:59Z</dc:date>
    <item>
      <title>Assignment variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Assignment-variables/m-p/133674#M36292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a dataset;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table test as&lt;/P&gt;&lt;P&gt;select cat_desc&lt;/P&gt;&lt;P&gt;from test1;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;output is&lt;/P&gt;&lt;P&gt;cat_desc&lt;/P&gt;&lt;P&gt;Eastern Region&lt;/P&gt;&lt;P&gt;Western Region&lt;/P&gt;&lt;P&gt;North&lt;/P&gt;&lt;P&gt;South&lt;/P&gt;&lt;P&gt;Eastern Region&lt;/P&gt;&lt;P&gt;Western Region&lt;/P&gt;&lt;P&gt;South&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to assign an Id to the variables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input cat_id 1 cat_desc $2-20;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 Eastern Region&lt;/P&gt;&lt;P&gt;2 Western Region&lt;/P&gt;&lt;P&gt;3 North&lt;/P&gt;&lt;P&gt;4 South&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;How can I add the cat_id in data have and apply it to&amp;nbsp; the initial dataset?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 03:37:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Assignment-variables/m-p/133674#M36292</guid>
      <dc:creator>gnt1986</dc:creator>
      <dc:date>2013-11-07T03:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Assignment variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Assignment-variables/m-p/133675#M36293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;Can you tell me that in your data 'have' what you have shown in datalines is&amp;nbsp; your desired output or you want to display regions eg. eastern region by 1?(just for display : Go for Proc Format).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;IF you have requirement of assigning a variable in proc sql in select you can use Case Expression select(cat_desc) in that use&amp;nbsp; when 'eastern region' then 1 and make everything like that and end case expression by end as Cat_id in the select clause.&lt;/LI&gt;&lt;LI&gt;Remain other code as it is, in that case you dont even need to create any new data.&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 06:26:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Assignment-variables/m-p/133675#M36293</guid>
      <dc:creator>MeghnaMorlidhar</dc:creator>
      <dc:date>2013-11-07T06:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Assignment variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Assignment-variables/m-p/133676#M36294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For example if proc sql you see cat_desc Eastern Region.&amp;nbsp; However it has not cat_id.&amp;nbsp; Now look in data have.&amp;nbsp; I have replicated the cat_des and have added the cat_id.&amp;nbsp; I need to assign cat_id to cat_desc so I can use the original proc sql datastep in a program to manipulate the variables&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 18:52:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Assignment-variables/m-p/133676#M36294</guid>
      <dc:creator>gnt1986</dc:creator>
      <dc:date>2013-11-07T18:52:59Z</dc:date>
    </item>
  </channel>
</rss>

