<?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: Remove every second occurrence of &amp;quot;/&amp;quot; in string in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Remove-every-second-occurrence-of-quot-quot-in-string/m-p/758674#M10107</link>
    <description>&lt;P&gt;And once you have these long strings created properly, then what are you going to do with them? How would you use them?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems to me that creating this data structure, with numbers as a part of a long string, is horribly inefficient and destroys any further simplicity of programming.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;So, you might be wise to consider more useful data structures, which could require much simpler programming. What that might be, I don't know, because I don't know what you are planning to do next.&lt;/P&gt;</description>
    <pubDate>Sun, 01 Aug 2021 21:30:04 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-08-01T21:30:04Z</dc:date>
    <item>
      <title>Remove every second occurrence of "/" in string</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Remove-every-second-occurrence-of-quot-quot-in-string/m-p/758660#M10105</link>
      <description>&lt;P&gt;Below is the code I'm using now to concatenate (up to) 12 pairs of numeric variables, labeled BP_Systolic 1 -12 and BP_Diastolic 1-12.&amp;nbsp; There is always a pair, no onesies.&lt;/P&gt;
&lt;P&gt;length BP_string&amp;nbsp; &amp;nbsp; &amp;nbsp;$84.;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* maximum length with "/" is 83.&lt;/P&gt;
&lt;P&gt;BP_string = strip(catx('/',put(BP_SYSTOLIC1,best3.),put(BP_DIASTOLIC1,best3.))) || "," ||&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;strip(catx('/',put(BP_SYSTOLIC2,best3.),put(BP_DIASTOLIC2,best3.))) || "," ||&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strip(catx('/',put(BP_SYSTOLIC3,best4.),put(BP_DIASTOLIC3,best3.))) || "," ||&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;strip(catx('/',put(BP_SYSTOLIC4,best3.),put(BP_DIASTOLIC4,best3.))) || "," ||&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;...This goes on for twelve total sets.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I'd like to do is this:&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;BP_string&amp;nbsp;= catx("/", of _numeric_);&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which is superior then the method above:&lt;/P&gt;
&lt;P&gt;Way shorter.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there only one pair of readings, the result is 120/80,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;not 120/80,,,,,,,,, - additional "," for all the missing sets of pairs as in the previous method.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using&amp;nbsp; &amp;nbsp;BP_string&amp;nbsp;= catx("/", of _numeric_);&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;results in six pairs of reading as:&amp;nbsp; &amp;nbsp;120/80/115/75/135/82/140/85/130/84/125/81.&amp;nbsp; &amp;nbsp;That is very good, except I need to replace every 2nd/4th/6th/8th,10th occurrence of&amp;nbsp; "/" with a comma, as below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;120/80,115/75,135/82,140/85,130/84,125/81.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Experimenting with some way to use&amp;nbsp;&amp;nbsp;BP_string&amp;nbsp;= catx("/", of _numeric_); to concatenate Systolic1, "/", with it's counterpart&amp;nbsp; Diastolic1, and then Systolic2, "/", with Diastolic2, and so on, until (up to) 12 pairs are read, and then combine them all together separated by a "," - but the below didn't work:&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;BP_string&amp;nbsp;= catx("/", BP_SYSTOLIC1-12, BP_DIASTOLIC1-12);&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is important if there aren't 12 pairs of readings (or any number more than one pair, but less than 12),&amp;nbsp; there should not be any additional characters.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do have a variable that stores the number of pairs (readings) for each record in the data set .&amp;nbsp; The average is less then one pair (26% of all observations), but 8 % of the records have the full 12.&amp;nbsp;&amp;nbsp;Pretty certain the answer resides in an array of some kind.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Aug 2021 16:43:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Remove-every-second-occurrence-of-quot-quot-in-string/m-p/758660#M10105</guid>
      <dc:creator>Jumboshrimps</dc:creator>
      <dc:date>2021-08-01T16:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Remove every second occurrence of "/" in string</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Remove-every-second-occurrence-of-quot-quot-in-string/m-p/758663#M10106</link>
      <description>&lt;P&gt;This would be simpler:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;option missing=" ";
array sys BP_SYSTOLIC1-BP_SYSTOLIC12;
array dia BP_DIASTOLIC1-BP_DIASTOLIC12;
do i = 1 to dim(sys);
	BP_string = catx(",", BP_string, catx("/", sys{i}, dia{i}));
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(untested)&lt;/P&gt;</description>
      <pubDate>Sun, 01 Aug 2021 17:32:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Remove-every-second-occurrence-of-quot-quot-in-string/m-p/758663#M10106</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2021-08-01T17:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Remove every second occurrence of "/" in string</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Remove-every-second-occurrence-of-quot-quot-in-string/m-p/758674#M10107</link>
      <description>&lt;P&gt;And once you have these long strings created properly, then what are you going to do with them? How would you use them?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems to me that creating this data structure, with numbers as a part of a long string, is horribly inefficient and destroys any further simplicity of programming.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;So, you might be wise to consider more useful data structures, which could require much simpler programming. What that might be, I don't know, because I don't know what you are planning to do next.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Aug 2021 21:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Remove-every-second-occurrence-of-quot-quot-in-string/m-p/758674#M10107</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-01T21:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Remove every second occurrence of "/" in string</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Remove-every-second-occurrence-of-quot-quot-in-string/m-p/758775#M10119</link>
      <description>&lt;P&gt;Excellent!!!&lt;/P&gt;
&lt;P&gt;The function is combining the two numeric readings one at a time, but errors out when the two numerics are&lt;/P&gt;
&lt;P&gt;combined with a "/".&amp;nbsp; Data set returned a blank bp_string column for all records, and an additional column labeled "i" with the number 13 for every record.&amp;nbsp; Here is my attempt to concatenate the numerics with&amp;nbsp; put statements:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;BP_string = catx(",", BP_string, put(catx("/", sys{i}, dia{i}),best3.)));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Log reads,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "NOTE 484-185: Format $BEST was not found or could not be loaded."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know best3. works as I used it in the old way as:&lt;/P&gt;
&lt;P&gt;strip(catx('/',put(BP_SYSTOLIC1,best3.),put(BP_DIASTOLIC1,best3.))) || "," ||&lt;/P&gt;
&lt;P&gt;which produced the correct result, but not really pushing the envelope in terms of SAS.&lt;/P&gt;
&lt;P&gt;Using format comma10.0 also gave the same error.&lt;/P&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;
&lt;P&gt;&lt;BR /&gt;NOTE: Invalid numeric data, '119/59' , at line 33 column 14.&lt;BR /&gt;NOTE: Invalid numeric data, '131/74' , at line 33 column 14.&lt;BR /&gt;NOTE: Invalid numeric data, '122/66' , at line 33 column 14.&lt;BR /&gt;NOTE: Invalid numeric data, '126/74' , at line 33 column 14.&lt;BR /&gt;NOTE: Invalid numeric data, '142/80' , at line 33 column 14.&lt;BR /&gt;NOTE: Invalid numeric data, '104/70' , at line 33 column 14.&lt;BR /&gt;NOTE: Invalid numeric data, '120/70' , at line 33 column 14.&lt;BR /&gt;NOTE: Invalid numeric data, '125/71' , at line 33 column 14.&lt;BR /&gt;NOTE: Invalid numeric data, '126/72' , at line 33 column 14.&lt;BR /&gt;NOTE: Invalid numeric data, '116/69' , at line 33 column 14.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 12:50:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Remove-every-second-occurrence-of-quot-quot-in-string/m-p/758775#M10119</guid>
      <dc:creator>Jumboshrimps</dc:creator>
      <dc:date>2021-08-02T12:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Remove every second occurrence of "/" in string</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Remove-every-second-occurrence-of-quot-quot-in-string/m-p/758786#M10120</link>
      <description>This works:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;	BP_string = catx(",", BP_string, put(catx("/", sys{i}, dia{i}),3.));&lt;BR /&gt;&lt;BR /&gt;There is a God.&lt;BR /&gt;&lt;BR /&gt;Thank everyone!!!!&lt;BR /&gt;best3. was some kind of custom format somewhere in this 10,000 lines of goo I inherited.</description>
      <pubDate>Mon, 02 Aug 2021 13:40:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Remove-every-second-occurrence-of-quot-quot-in-string/m-p/758786#M10120</guid>
      <dc:creator>Jumboshrimps</dc:creator>
      <dc:date>2021-08-02T13:40:58Z</dc:date>
    </item>
  </channel>
</rss>

