<?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: Creating userid from full name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-userid-from-full-name/m-p/733653#M228591</link>
    <description>Hi, thanks for the solution..but i need a solution where by ill be able to change the username manually into the userid that i want..check below&lt;BR /&gt;&lt;BR /&gt;Apologies i ddnt mention it from the initial description&lt;BR /&gt;&lt;BR /&gt;data QA_summary;&lt;BR /&gt;   set Qa_summary_fix;&lt;BR /&gt;     if username= 'sol sebela' then userid = 'ssebela1';&lt;BR /&gt;     if username= 'jack mabaso' then userid = 'jmabaso';&lt;BR /&gt;run;</description>
    <pubDate>Wed, 14 Apr 2021 09:44:36 GMT</pubDate>
    <dc:creator>Solly7</dc:creator>
    <dc:date>2021-04-14T09:44:36Z</dc:date>
    <item>
      <title>Creating userid from full name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-userid-from-full-name/m-p/733647#M228588</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need help in created a new column named &lt;STRONG&gt;'userid'&lt;/STRONG&gt; from &lt;STRONG&gt;usersname&lt;/STRONG&gt; column&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data Users;
input Users $20.;
datalines;
sol sebela

jack mabaso

ally maima

marry anne

jin sol

;
run;&lt;/PRE&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;LI-CODE lang="sas"&gt;data have;
input policy_no risk contents motor home cycle username $20.;
datalines;
1 1 0 1 0 0  sol sebela
2 0 0 0 0 1  jack mabaso
3 0 1 1 2 1  ally maima
4 1 0 0 0 0  marry anne
5 1 0 0 0 1  jin sol
6 0 1 1 2 0  sin bad
7 1 0 0 2 1  ole man
8 1 2 0 1 0  kim kad
;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql;

&amp;nbsp; &amp;nbsp; &amp;nbsp; create table data as

select a.* from have as a

where a.username in (select users from users)

;quit;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DATA WANT&lt;/STRONG&gt;&lt;/P&gt;
&lt;TABLE width="527"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="105"&gt;policy_no&lt;/TD&gt;
&lt;TD width="29"&gt;risk&lt;/TD&gt;
&lt;TD width="61"&gt;contents&lt;/TD&gt;
&lt;TD width="45"&gt;motor&lt;/TD&gt;
&lt;TD width="43"&gt;home&lt;/TD&gt;
&lt;TD width="38"&gt;cycle&lt;/TD&gt;
&lt;TD width="81"&gt;&lt;STRONG&gt;userid&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="125"&gt;username&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="105"&gt;1&lt;/TD&gt;
&lt;TD width="29"&gt;1&lt;/TD&gt;
&lt;TD width="61"&gt;0&lt;/TD&gt;
&lt;TD width="45"&gt;1&lt;/TD&gt;
&lt;TD width="43"&gt;0&lt;/TD&gt;
&lt;TD width="38"&gt;0&lt;/TD&gt;
&lt;TD width="81"&gt;ssebela&lt;/TD&gt;
&lt;TD width="125"&gt;sol sebela&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="105"&gt;2&lt;/TD&gt;
&lt;TD width="29"&gt;0&lt;/TD&gt;
&lt;TD width="61"&gt;0&lt;/TD&gt;
&lt;TD width="45"&gt;0&lt;/TD&gt;
&lt;TD width="43"&gt;0&lt;/TD&gt;
&lt;TD width="38"&gt;1&lt;/TD&gt;
&lt;TD width="81"&gt;jmabaso&lt;/TD&gt;
&lt;TD width="125"&gt;jack mabaso&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="105"&gt;3&lt;/TD&gt;
&lt;TD width="29"&gt;0&lt;/TD&gt;
&lt;TD width="61"&gt;1&lt;/TD&gt;
&lt;TD width="45"&gt;1&lt;/TD&gt;
&lt;TD width="43"&gt;2&lt;/TD&gt;
&lt;TD width="38"&gt;1&lt;/TD&gt;
&lt;TD width="81"&gt;amaima&lt;/TD&gt;
&lt;TD width="125"&gt;ally maima&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="105"&gt;4&lt;/TD&gt;
&lt;TD width="29"&gt;1&lt;/TD&gt;
&lt;TD width="61"&gt;0&lt;/TD&gt;
&lt;TD width="45"&gt;0&lt;/TD&gt;
&lt;TD width="43"&gt;0&lt;/TD&gt;
&lt;TD width="38"&gt;0&lt;/TD&gt;
&lt;TD width="81"&gt;manne&lt;/TD&gt;
&lt;TD width="125"&gt;marry anne&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="105"&gt;5&lt;/TD&gt;
&lt;TD width="29"&gt;1&lt;/TD&gt;
&lt;TD width="61"&gt;0&lt;/TD&gt;
&lt;TD width="45"&gt;0&lt;/TD&gt;
&lt;TD width="43"&gt;0&lt;/TD&gt;
&lt;TD width="38"&gt;1&lt;/TD&gt;
&lt;TD width="81"&gt;jsol&lt;/TD&gt;
&lt;TD width="125"&gt;jin sol&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 09:19:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-userid-from-full-name/m-p/733647#M228588</guid>
      <dc:creator>Solly7</dc:creator>
      <dc:date>2021-04-14T09:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Creating userid from full name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-userid-from-full-name/m-p/733649#M228589</link>
      <description>&lt;P&gt;how about this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  length userid $20;
  userid=substr(scan(username,1),1,1)||scan(username,2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Apr 2021 09:33:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-userid-from-full-name/m-p/733649#M228589</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-04-14T09:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Creating userid from full name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-userid-from-full-name/m-p/733653#M228591</link>
      <description>Hi, thanks for the solution..but i need a solution where by ill be able to change the username manually into the userid that i want..check below&lt;BR /&gt;&lt;BR /&gt;Apologies i ddnt mention it from the initial description&lt;BR /&gt;&lt;BR /&gt;data QA_summary;&lt;BR /&gt;   set Qa_summary_fix;&lt;BR /&gt;     if username= 'sol sebela' then userid = 'ssebela1';&lt;BR /&gt;     if username= 'jack mabaso' then userid = 'jmabaso';&lt;BR /&gt;run;</description>
      <pubDate>Wed, 14 Apr 2021 09:44:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-userid-from-full-name/m-p/733653#M228591</guid>
      <dc:creator>Solly7</dc:creator>
      <dc:date>2021-04-14T09:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Creating userid from full name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-userid-from-full-name/m-p/733655#M228593</link>
      <description>&lt;P&gt;The second IF is not necessary, as that (I assume default) constellation is handled by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/226565"&gt;@japelin&lt;/a&gt;&amp;nbsp;'s solution. Just add your first IF to the code that&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/226565"&gt;@japelin&lt;/a&gt;&amp;nbsp;provided, and handle similar extraordinary situations the same way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Setting everything manually is a human task, not suited for programming.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 09:52:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-userid-from-full-name/m-p/733655#M228593</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-04-14T09:52:53Z</dc:date>
    </item>
  </channel>
</rss>

