<?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: Problem with Concat function in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-with-Concat-function/m-p/567716#M34034</link>
    <description>&lt;P&gt;Right now the 0 gets only added if the length equals 6.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;length(PATIENT_SRC_NO) &amp;lt; 7&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;patient_id =&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'0'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;||strip(PATIENT_SRC_NO);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;else patient_id=strip(PATIENT_SRC_NO);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jun 2019 17:31:31 GMT</pubDate>
    <dc:creator>Kc2</dc:creator>
    <dc:date>2019-06-20T17:31:31Z</dc:date>
    <item>
      <title>Problem with Concat function</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-with-Concat-function/m-p/567713#M34032</link>
      <description>&lt;P&gt;I am trying to add&amp;nbsp; zero for&amp;nbsp; patient number if the length is than 7&lt;/P&gt;
&lt;P&gt;&amp;nbsp;following code gives error&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; fix_ptnt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; FCR_ADUIT_REPORT;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; patient_id &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$20.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; length(PATIENT_SRC_NO) = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; patient_id = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'0'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;||strip(PATIENT_SRC_NO);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;can you please help?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;thanks,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 17:21:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-with-Concat-function/m-p/567713#M34032</guid>
      <dc:creator>avatar</dc:creator>
      <dc:date>2019-06-20T17:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Concat function</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-with-Concat-function/m-p/567714#M34033</link>
      <description>&lt;P&gt;If you simply want to pad the ID with zeros so the value has 7 digits, then simply do&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input patient_id $;
datalines;
1
11
111
1111
11111
111111
;

data want;
   set have;
   new_patient_id=put(input(patient_id, 8.), z7.);
run;&lt;/CODE&gt;&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;</description>
      <pubDate>Thu, 20 Jun 2019 17:31:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-with-Concat-function/m-p/567714#M34033</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-06-20T17:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Concat function</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-with-Concat-function/m-p/567716#M34034</link>
      <description>&lt;P&gt;Right now the 0 gets only added if the length equals 6.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;length(PATIENT_SRC_NO) &amp;lt; 7&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;patient_id =&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'0'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;||strip(PATIENT_SRC_NO);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;else patient_id=strip(PATIENT_SRC_NO);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 17:31:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-with-Concat-function/m-p/567716#M34034</guid>
      <dc:creator>Kc2</dc:creator>
      <dc:date>2019-06-20T17:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Concat function</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-with-Concat-function/m-p/567718#M34035</link>
      <description>&lt;P&gt;What error does it give?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 17:49:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-with-Concat-function/m-p/567718#M34035</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-06-20T17:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Concat function</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-with-Concat-function/m-p/567724#M34036</link>
      <description>&lt;P&gt;&amp;nbsp;oh! I&amp;nbsp; found out the error for previous step . not for my code. it is working fine now t&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you all for your replies. All worked fine!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 18:29:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-with-Concat-function/m-p/567724#M34036</guid>
      <dc:creator>avatar</dc:creator>
      <dc:date>2019-06-20T18:29:09Z</dc:date>
    </item>
  </channel>
</rss>

