<?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 Want to remove the first &amp;quot;[&amp;quot; in this clause statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Want-to-remove-the-first-quot-quot-in-this-clause-statement/m-p/770936#M244565</link>
    <description>&lt;P&gt;Hi, The variable REFMATS has this information&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;BR /&gt;However, the code i have keeps outputting the first [ as a clause and would like to update the clause code to not take the first "["&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;REFMATS&lt;/P&gt;&lt;P&gt;[Type:ADRG, URL :, Version : , Status : , Date : Notes :,[Type:P21 Report, URL :, Version : , Status : , Date : Notes :,[Type:eSub Source Data Location, URL :, Version : , Status : , Date : Notes :,[Type:eSub Data Package Location, URL :, Version : , Status : , Date : Notes :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data work._ref_mat_info (label = "Reference Materials") ;&lt;BR /&gt;length clause $150 ;&lt;BR /&gt;set test.deliverables(obs=1) ;&lt;BR /&gt;where REFMATS ne "";&lt;BR /&gt;_i = 0 ;&lt;BR /&gt;do until(REFMATS = "") ;&lt;BR /&gt;_i + 1 ;&lt;BR /&gt;if _i &amp;gt;= 100 then stop ;&lt;BR /&gt;_pos = index(REFMATS,'[') ;&lt;BR /&gt;if _pos = 0 then do ;&lt;BR /&gt;clause = REFMATS ;&lt;BR /&gt;REFMATS = "" ;&lt;BR /&gt;end ;&lt;BR /&gt;else do ;&lt;BR /&gt;clause = substr(REFMATS,1,_pos) ;&lt;BR /&gt;REFMATS = substr(REFMATS,sum(_pos,1)) ;&lt;BR /&gt;end ;&lt;BR /&gt;output ;&lt;BR /&gt;end ;&lt;BR /&gt;*keep _ref_mat clause num text ;&lt;BR /&gt;run ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The clause variable keeps outputting this and I would like the first "[" to not be taken.&amp;nbsp;&lt;/P&gt;&lt;P&gt;CLAUSE:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;obs&amp;nbsp; &amp;nbsp; &amp;nbsp; CLAUSE&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Type:ADRG, URL :, Version : , Status : , Date : Notes :,[&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Type:eSub Source Data Location, URL :, Version : , Status : , Date : Notes :,[&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Type:eSub Source Data Location, URL :, Version : , Status : , Date : Notes :,[&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Type:eSub Data Package Location, URL :, Version : , Status : , Date : Notes :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Sep 2021 16:15:31 GMT</pubDate>
    <dc:creator>Dregerator</dc:creator>
    <dc:date>2021-09-28T16:15:31Z</dc:date>
    <item>
      <title>Want to remove the first "[" in this clause statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-remove-the-first-quot-quot-in-this-clause-statement/m-p/770936#M244565</link>
      <description>&lt;P&gt;Hi, The variable REFMATS has this information&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;BR /&gt;However, the code i have keeps outputting the first [ as a clause and would like to update the clause code to not take the first "["&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;REFMATS&lt;/P&gt;&lt;P&gt;[Type:ADRG, URL :, Version : , Status : , Date : Notes :,[Type:P21 Report, URL :, Version : , Status : , Date : Notes :,[Type:eSub Source Data Location, URL :, Version : , Status : , Date : Notes :,[Type:eSub Data Package Location, URL :, Version : , Status : , Date : Notes :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data work._ref_mat_info (label = "Reference Materials") ;&lt;BR /&gt;length clause $150 ;&lt;BR /&gt;set test.deliverables(obs=1) ;&lt;BR /&gt;where REFMATS ne "";&lt;BR /&gt;_i = 0 ;&lt;BR /&gt;do until(REFMATS = "") ;&lt;BR /&gt;_i + 1 ;&lt;BR /&gt;if _i &amp;gt;= 100 then stop ;&lt;BR /&gt;_pos = index(REFMATS,'[') ;&lt;BR /&gt;if _pos = 0 then do ;&lt;BR /&gt;clause = REFMATS ;&lt;BR /&gt;REFMATS = "" ;&lt;BR /&gt;end ;&lt;BR /&gt;else do ;&lt;BR /&gt;clause = substr(REFMATS,1,_pos) ;&lt;BR /&gt;REFMATS = substr(REFMATS,sum(_pos,1)) ;&lt;BR /&gt;end ;&lt;BR /&gt;output ;&lt;BR /&gt;end ;&lt;BR /&gt;*keep _ref_mat clause num text ;&lt;BR /&gt;run ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The clause variable keeps outputting this and I would like the first "[" to not be taken.&amp;nbsp;&lt;/P&gt;&lt;P&gt;CLAUSE:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;obs&amp;nbsp; &amp;nbsp; &amp;nbsp; CLAUSE&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Type:ADRG, URL :, Version : , Status : , Date : Notes :,[&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Type:eSub Source Data Location, URL :, Version : , Status : , Date : Notes :,[&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Type:eSub Source Data Location, URL :, Version : , Status : , Date : Notes :,[&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Type:eSub Data Package Location, URL :, Version : , Status : , Date : Notes :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 16:15:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-remove-the-first-quot-quot-in-this-clause-statement/m-p/770936#M244565</guid>
      <dc:creator>Dregerator</dc:creator>
      <dc:date>2021-09-28T16:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Want to remove the first "[" in this clause statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-remove-the-first-quot-quot-in-this-clause-statement/m-p/770966#M244582</link>
      <description>&lt;P&gt;What are you attempting to achieve, i.e. what do you want as the output for a given input.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm assuming you don't want the first observation in your output ("[") and probably none of the "["&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a potential solution using the &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p0jshdjy2z9zdzn1h7k90u99lyq6.htm" target="_self"&gt;scan&lt;/A&gt; function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
	string="[Type:ADRG, URL :, Version : , Status : , Date : Notes :,[Type:P21 Report, URL :, Version : , Status : , Date : Notes :,[Type:eSub Source Data Location, URL :, Version : , Status : , Date : Notes :,[Type:eSub Data Package Location, URL :, Version : , Status : , Date : Notes :" ;
	n=1 ;
	word=scan(string,n,"[") ;
	do while (word ne "") ;
		output ;
		n=n+1 ;
		word=scan(string,n,"[") ;
	end ;
run ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Sep 2021 17:38:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-remove-the-first-quot-quot-in-this-clause-statement/m-p/770966#M244582</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2021-09-28T17:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Want to remove the first "[" in this clause statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-remove-the-first-quot-quot-in-this-clause-statement/m-p/770999#M244597</link>
      <description>&lt;P&gt;Hi &lt;A class="trigger-hovercard" style="color: #007dc3;" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301047" target="_blank"&gt;Dregerator&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;Here is a pair of complementary blog posts that I wrote recently:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A title="Removing leading characters from SAS strings" href="https://blogs.sas.com/content/sgf/2021/08/23/removing-leading-characters-from-sas-strings/" target="_self"&gt;Removing leading characters from SAS strings&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A title="Removing trailing characters from SAS strings" href="https://blogs.sas.com/content/sgf/2021/09/02/removing-trailing-characters-from-sas-strings/" target="_self"&gt;Removing trailing characters from SAS strings&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 19:09:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-remove-the-first-quot-quot-in-this-clause-statement/m-p/770999#M244597</guid>
      <dc:creator>LeonidBatkhan</dc:creator>
      <dc:date>2021-09-28T19:09:13Z</dc:date>
    </item>
  </channel>
</rss>

