<?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: SAS QUERY in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-QUERY/m-p/337038#M76477</link>
    <description>&lt;P&gt;I am afraid not. &amp;nbsp;You have not provided any information - e.g. test data in the form of a datastep, or what you want the output to look like. &amp;nbsp;This code shows how you could trim off the first and fourth part - assuming your data is all four long:&lt;/P&gt;
&lt;PRE&gt;data want;
  a="Part 1/Cycle 1/Day 1/Pre-Dose";
  b=strip(tranwrd(tranwrd(a,scan(a,4,"/"),""),scan(a,1,"/"),""));
run;&lt;/PRE&gt;
&lt;P&gt;And this "&lt;SPAN&gt;10FEB2015" can be converted by using input("10FEB2015",date9.), or just "10FEB2015"d;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;However further than that I can't say.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Mar 2017 15:51:42 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-03-01T15:51:42Z</dc:date>
    <item>
      <title>SAS QUERY</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-QUERY/m-p/337028#M76471</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can some one guide me with the below query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Part 1/Cycle 1/Day 1/Pre-Dose: I have to output only:&lt;FONT color="#FF6600"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Cycle 1/Day 1&lt;/FONT&gt; from adjacent string(Have to strip off values before the first slash and after the last).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Part 1/Cycle 1/Day 1/6 Hr: &lt;FONT color="#FF6600"&gt;Cycle 1/Day 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Part 1/Cycle 1/Day 15/Pre-Dose: &lt;FONT color="#FF6600"&gt;Cycle 1/Day 15&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Part 1/Cycle 1/Day 8: &lt;FONT color="#FF6600"&gt;Cycle 1/Day 8&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Part 1/Cycle 1/Day 21: &lt;FONT color="#FF6600"&gt;Cycle 1/Day 21&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Also, Can someone please guide in converting &lt;FONT color="#FF6600"&gt;10FEB2015 into SAS DATE&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;Rakesh&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 15:42:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-QUERY/m-p/337028#M76471</guid>
      <dc:creator>rakeshvvv</dc:creator>
      <dc:date>2017-03-01T15:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: SAS QUERY</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-QUERY/m-p/337038#M76477</link>
      <description>&lt;P&gt;I am afraid not. &amp;nbsp;You have not provided any information - e.g. test data in the form of a datastep, or what you want the output to look like. &amp;nbsp;This code shows how you could trim off the first and fourth part - assuming your data is all four long:&lt;/P&gt;
&lt;PRE&gt;data want;
  a="Part 1/Cycle 1/Day 1/Pre-Dose";
  b=strip(tranwrd(tranwrd(a,scan(a,4,"/"),""),scan(a,1,"/"),""));
run;&lt;/PRE&gt;
&lt;P&gt;And this "&lt;SPAN&gt;10FEB2015" can be converted by using input("10FEB2015",date9.), or just "10FEB2015"d;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;However further than that I can't say.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 15:51:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-QUERY/m-p/337038#M76477</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-03-01T15:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: SAS QUERY</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-QUERY/m-p/337052#M76484</link>
      <description>&lt;P&gt;To pull out the middle pieces, here is an approach:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;var = cats(scan(var, 2, '/'), '/', scan(var, 3, '/'));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 16:21:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-QUERY/m-p/337052#M76484</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-03-01T16:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS QUERY</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-QUERY/m-p/337057#M76487</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please find the below sample data. the data highlighted in blue is the sample data and output i would need is highlighted in PINK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#00CCFF"&gt;Part 1/Cycle 1/Day 1/6Hr&lt;/FONT&gt;: &lt;FONT color="#FF00FF"&gt;Cycle 1/Day 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#00CCFF"&gt;Part 1/Cycle 1/Day 15/Pre-Dose&lt;/FONT&gt;: &lt;FONT color="#FF00FF"&gt;Cycle 1/Day 15&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#00CCFF"&gt;Part 1/Cycle 1/Day 8&lt;/FONT&gt;: &lt;FONT color="#FF00FF"&gt;Cycle 1/Day 8&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#00CCFF"&gt;Part 1/Cycle 1/Day 21&lt;/FONT&gt;: &lt;FONT color="#FF00FF"&gt;Cycle 1/Day 21&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 16:32:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-QUERY/m-p/337057#M76487</guid>
      <dc:creator>rakeshvvv</dc:creator>
      <dc:date>2017-03-01T16:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: SAS QUERY</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-QUERY/m-p/337077#M76493</link>
      <description>&lt;P&gt;As your number of slashes is not always the same I would take the rule literally and look for first and last slash:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
	length string $100;
	infile cards dlm='#';
	input string $;
	firstslash=findc(string, '/');
	lastslash=findc(string, '/', '', -100);
	want=substr(string, firstslash+1, lastslash-firstslash-2);
	cards;
Part 1/Cycle 1/Day 1/6Hr
Part 1/Cycle 1/Day 15/Pre-Dose
Part 1/Cycle 1/Day 8
Part 1/Cycle 1/Day 21
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;- Jan&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 17:18:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-QUERY/m-p/337077#M76493</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2017-03-01T17:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: SAS QUERY</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-QUERY/m-p/337079#M76494</link>
      <description>&lt;P&gt;If the data is as described, the SCAN function is sufficient.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 17:20:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-QUERY/m-p/337079#M76494</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-01T17:20:32Z</dc:date>
    </item>
  </channel>
</rss>

