<?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 String concatenation in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/String-concatenation/m-p/54899#M15237</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see three issues.&lt;/P&gt;&lt;P&gt;1) You left out the semi-colon seperator between the cd and find commands.&lt;/P&gt;&lt;P&gt;old = a || b || ';' || c;&lt;/P&gt;&lt;P&gt;2) You have not put the quotes in the find command.&lt;/P&gt;&lt;P&gt;c="find . -mtime +1 -name '*.log'";&lt;/P&gt;&lt;P&gt;3) You need to quote the string you use in the FILENAME statement.&lt;/P&gt;&lt;P&gt;filename comando pipe "&amp;amp;mystring";&lt;/P&gt;&lt;P&gt;or you could use the quote() function.&lt;/P&gt;&lt;P&gt;call symput('mystring',quote(trim(old)));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Nov 2011 15:01:02 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2011-11-28T15:01:02Z</dc:date>
    <item>
      <title>String concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/String-concatenation/m-p/54898#M15236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to concatenate some strings in order to create a command. This is the intial code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename comando pipe "cd mylogdir; find . -mtime +1 -name '*.log'";&lt;/P&gt;&lt;P&gt;data listafile;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; infile comando truncover;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; input @1 nomefile $200.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if index(nomefile,'.log') or index(nomefile,'too long') then output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;filename comando;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would create the command&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;"cd mylogdir; find . -mtime +1 -name '*.log'";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dinamically, I mean a would read each parts of it from a dataset and concatenate them in order to create the complete command. Here you are my code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data dat;&lt;BR /&gt;&amp;nbsp; a='cd ';&lt;BR /&gt;&amp;nbsp; b='mylogdir';&lt;BR /&gt;&amp;nbsp; c='find . -mtime +1 -name *.log';&lt;BR /&gt;&amp;nbsp; old=a || b || c;&lt;BR /&gt;&amp;nbsp; put old=;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%let mystring=;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;&amp;nbsp; set dat;&lt;BR /&gt;&amp;nbsp; call symput('mystring',old);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;put mystring;&lt;/P&gt;&lt;P&gt;filename comando pipe &amp;amp;mystring;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it does not work. Someone has an idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2011 09:56:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/String-concatenation/m-p/54898#M15236</guid>
      <dc:creator>garag</dc:creator>
      <dc:date>2011-11-28T09:56:56Z</dc:date>
    </item>
    <item>
      <title>String concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/String-concatenation/m-p/54899#M15237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see three issues.&lt;/P&gt;&lt;P&gt;1) You left out the semi-colon seperator between the cd and find commands.&lt;/P&gt;&lt;P&gt;old = a || b || ';' || c;&lt;/P&gt;&lt;P&gt;2) You have not put the quotes in the find command.&lt;/P&gt;&lt;P&gt;c="find . -mtime +1 -name '*.log'";&lt;/P&gt;&lt;P&gt;3) You need to quote the string you use in the FILENAME statement.&lt;/P&gt;&lt;P&gt;filename comando pipe "&amp;amp;mystring";&lt;/P&gt;&lt;P&gt;or you could use the quote() function.&lt;/P&gt;&lt;P&gt;call symput('mystring',quote(trim(old)));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2011 15:01:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/String-concatenation/m-p/54899#M15237</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-11-28T15:01:02Z</dc:date>
    </item>
    <item>
      <title>String concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/String-concatenation/m-p/54900#M15238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks Tom, it worked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2011 08:29:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/String-concatenation/m-p/54900#M15238</guid>
      <dc:creator>garag</dc:creator>
      <dc:date>2011-11-29T08:29:01Z</dc:date>
    </item>
  </channel>
</rss>

