<?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: how to get full name in different variable in sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-full-name-in-different-variable-in-sas/m-p/813710#M321173</link>
    <description>&lt;P&gt;not giving the desired result. I have run the code below is the output:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="poojasv20_0-1652774820781.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71528i278796F55228481B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="poojasv20_0-1652774820781.png" alt="poojasv20_0-1652774820781.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I want a variable full_name as anushka sharma etc..&lt;/P&gt;</description>
    <pubDate>Tue, 17 May 2022 08:07:38 GMT</pubDate>
    <dc:creator>poojasv20</dc:creator>
    <dc:date>2022-05-17T08:07:38Z</dc:date>
    <item>
      <title>how to get full name in different variable in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-full-name-in-different-variable-in-sas/m-p/813693#M321161</link>
      <description>&lt;P&gt;I have one dataset there is only one variable name.&lt;/P&gt;&lt;P&gt;Name&lt;/P&gt;&lt;P&gt;anushka&lt;/P&gt;&lt;P&gt;sharma&lt;/P&gt;&lt;P&gt;priyanka&lt;/P&gt;&lt;P&gt;chopra&lt;/P&gt;&lt;P&gt;alia&lt;/P&gt;&lt;P&gt;bhatt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want a full name in different variable. How to do that in SAS.&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 05:29:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-full-name-in-different-variable-in-sas/m-p/813693#M321161</guid>
      <dc:creator>poojasv20</dc:creator>
      <dc:date>2022-05-17T05:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to get full name in different variable in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-full-name-in-different-variable-in-sas/m-p/813695#M321163</link>
      <description>&lt;P&gt;There is only one value in each observation, so there is nothing to expand it with.&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 05:54:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-full-name-in-different-variable-in-sas/m-p/813695#M321163</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-05-17T05:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to get full name in different variable in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-full-name-in-different-variable-in-sas/m-p/813697#M321165</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/262721"&gt;@poojasv20&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have one dataset there is only one variable name.&lt;/P&gt;
...&lt;BR /&gt;
&lt;P&gt;I want a full name in different variable. How to do that in SAS.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is impossible. Where should the names come from?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: Is the first name in the first obs and the last name in the next obs?&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 06:01:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-full-name-in-different-variable-in-sas/m-p/813697#M321165</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-05-17T06:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to get full name in different variable in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-full-name-in-different-variable-in-sas/m-p/813706#M321170</link>
      <description>&lt;P&gt;Yes . it is like&amp;nbsp;&lt;SPAN&gt;first name in the first obs and the last name in the next obs.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;and how can we get the full name.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 06:48:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-full-name-in-different-variable-in-sas/m-p/813706#M321170</guid>
      <dc:creator>poojasv20</dc:creator>
      <dc:date>2022-05-17T06:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to get full name in different variable in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-full-name-in-different-variable-in-sas/m-p/813708#M321172</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
length full_name $40;
retain full_name;
if full_name &amp;gt; ""
then do;
  full_name = catx(" ",full_name,name);
  output;
  full_name = "";
end;
else full_name = name;
keep full_name;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 May 2022 06:56:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-full-name-in-different-variable-in-sas/m-p/813708#M321172</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-05-17T06:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to get full name in different variable in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-full-name-in-different-variable-in-sas/m-p/813710#M321173</link>
      <description>&lt;P&gt;not giving the desired result. I have run the code below is the output:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="poojasv20_0-1652774820781.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71528i278796F55228481B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="poojasv20_0-1652774820781.png" alt="poojasv20_0-1652774820781.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I want a variable full_name as anushka sharma etc..&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 08:07:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-full-name-in-different-variable-in-sas/m-p/813710#M321173</guid>
      <dc:creator>poojasv20</dc:creator>
      <dc:date>2022-05-17T08:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to get full name in different variable in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-full-name-in-different-variable-in-sas/m-p/813717#M321174</link>
      <description>&lt;P&gt;Then you haven't run my code, or you provided wrong data, or you failed to adapt the code to your data (different variable/dataset names).&lt;/P&gt;
&lt;P&gt;Proof:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input name :$10.;
datalines;
anushka
sharma
priyanka
chopra
alia
bhatt
;

data want;
set have;
length full_name $40;
retain full_name;
if full_name &amp;gt; ""
then do;
  full_name = catx(" ",full_name,name);
  output;
  full_name = "";
end;
else full_name = name;
keep full_name;
run;

proc print data=want noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;full_name
anushka sharma
priyanka chopra
alia bhatt&lt;/PRE&gt;
&lt;P&gt;As you were told in the welcome mail you got when registering here, you must (&lt;STRONG&gt;MUST&lt;/STRONG&gt;) provide example data in usable form (in a &lt;U&gt;data step with datalines&lt;/U&gt;) to get tested code. Otherwise we have to make guesses.&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 08:32:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-full-name-in-different-variable-in-sas/m-p/813717#M321174</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-05-17T08:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to get full name in different variable in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-full-name-in-different-variable-in-sas/m-p/813849#M321250</link>
      <description>&lt;P&gt;Thankyou So much for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 16:09:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-full-name-in-different-variable-in-sas/m-p/813849#M321250</guid>
      <dc:creator>poojasv20</dc:creator>
      <dc:date>2022-05-17T16:09:35Z</dc:date>
    </item>
  </channel>
</rss>

