<?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 Is it possible to concatenate two values inside Proc SQL? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-concatenate-two-values-inside-Proc-SQL/m-p/394352#M95005</link>
    <description>&lt;P&gt;I have the following Proc SQL:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table dm1 as
	select STUDYID, DOMAIN, dm.SubjectID, &lt;STRONG&gt;USUBJID&lt;/STRONG&gt;&lt;/CODE&gt;&lt;CODE class=" language-sas"&gt; 
	from train.dm,train.cp
	where dm.subjectid=cp.subjectid 
	order by subjectid
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;USUBJID&lt;/STRONG&gt; should be the a concatination of &lt;STRONG&gt;SubjectID&lt;/STRONG&gt; and&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;STUDYID&lt;/STRONG&gt;:&amp;nbsp;&lt;SPAN&gt;&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;USUBJID = STUDYID&amp;nbsp;|| SubjectID &lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;. How can it be&amp;nbsp;actualized&amp;nbsp;inside the Proc SQL? Thank you!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Sep 2017 21:06:28 GMT</pubDate>
    <dc:creator>DmytroYermak</dc:creator>
    <dc:date>2017-09-08T21:06:28Z</dc:date>
    <item>
      <title>Is it possible to concatenate two values inside Proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-concatenate-two-values-inside-Proc-SQL/m-p/394352#M95005</link>
      <description>&lt;P&gt;I have the following Proc SQL:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table dm1 as
	select STUDYID, DOMAIN, dm.SubjectID, &lt;STRONG&gt;USUBJID&lt;/STRONG&gt;&lt;/CODE&gt;&lt;CODE class=" language-sas"&gt; 
	from train.dm,train.cp
	where dm.subjectid=cp.subjectid 
	order by subjectid
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;USUBJID&lt;/STRONG&gt; should be the a concatination of &lt;STRONG&gt;SubjectID&lt;/STRONG&gt; and&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;STUDYID&lt;/STRONG&gt;:&amp;nbsp;&lt;SPAN&gt;&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;USUBJID = STUDYID&amp;nbsp;|| SubjectID &lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;. How can it be&amp;nbsp;actualized&amp;nbsp;inside the Proc SQL? Thank you!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 21:06:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-concatenate-two-values-inside-Proc-SQL/m-p/394352#M95005</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2017-09-08T21:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to concatenate two values inside Proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-concatenate-two-values-inside-Proc-SQL/m-p/394354#M95007</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="  language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;sql&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	create &lt;SPAN class="token statement"&gt;table&lt;/SPAN&gt; dm1 as
	&lt;SPAN class="token statement"&gt;select&lt;/SPAN&gt; STUDYID&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; DOMAIN&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;dm&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;SubjectID&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;EM&gt;&lt;STRONG&gt;SubjectID||STUDYID as USUBJID&lt;/STRONG&gt;&lt;/EM&gt;&lt;/CODE&gt;&lt;CODE class="  language-sas"&gt; 
	&lt;SPAN class="token keyword"&gt;from&lt;/SPAN&gt; train&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;dm&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;train&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;cp
	&lt;SPAN class="token statement"&gt;where&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;dm&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;subjectid&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;cp&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;subjectid 
	order &lt;SPAN class="token statement"&gt;by&lt;/SPAN&gt; subjectid
&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;quit&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Sep 2017 21:06:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-concatenate-two-values-inside-Proc-SQL/m-p/394354#M95007</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-09-08T21:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to concatenate two values inside Proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-concatenate-two-values-inside-Proc-SQL/m-p/394356#M95008</link>
      <description>&lt;P&gt;CATS/CATT functions can be used similarly to any other function within PROC SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 21:13:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-concatenate-two-values-inside-Proc-SQL/m-p/394356#M95008</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-08T21:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to concatenate two values inside Proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-concatenate-two-values-inside-Proc-SQL/m-p/394357#M95009</link>
      <description>Thank you, novinosrin. I asked but even not having checked on my own).</description>
      <pubDate>Fri, 08 Sep 2017 21:20:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-concatenate-two-values-inside-Proc-SQL/m-p/394357#M95009</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2017-09-08T21:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to concatenate two values inside Proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-concatenate-two-values-inside-Proc-SQL/m-p/394367#M95016</link>
      <description>&lt;P&gt;If any of your your SubjectID are shorter than the defined length of the variable you may get unwanted spaces in the middle of the USUBJID variable:&lt;/P&gt;
&lt;PRE&gt;data junk;
   length subjectid $ 10;
   subjectid = 'abc';
   studyid = '123';
run;

proc sql;
   select studyid, subjectid,SubjectID||STUDYID as USUBJID 
   from junk;
run; &lt;/PRE&gt;
&lt;P&gt;If you don't want the space in the middle then use Cats(SubjectId,StudyId) as Usubjid&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 22:11:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-concatenate-two-values-inside-Proc-SQL/m-p/394367#M95016</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-08T22:11:13Z</dc:date>
    </item>
  </channel>
</rss>

