<?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: how to find whether string1 is  in the string2 or not? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/641582#M191234</link>
    <description>&lt;P&gt;at the moment since there are no matching values the macro returns a dataset with zero observations. so please update the macro variables values to below and run the macro so it returns a dataset with 4 observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let smq=Anaemia|Diarrhoea|Insomnia;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Apr 2020 11:58:21 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2020-04-21T11:58:21Z</dc:date>
    <item>
      <title>how to find whether string1 is  in the string2 or not?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/641573#M191229</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;My code wants to find whether string1(smq) is&amp;nbsp;in the string2(AEDECOD) or not?&lt;/P&gt;
&lt;P&gt;which doesn't work normally, why? how to change the code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;************smq list***********&lt;/P&gt;
&lt;P&gt;SMQ&lt;/P&gt;
&lt;P&gt;**bleep** fissure haemorrhage&lt;/P&gt;
&lt;P&gt;**bleep** haemorrhage&lt;/P&gt;
&lt;P&gt;**bleep** ulcer haemorrhage&lt;/P&gt;
&lt;P&gt;Anastomotic haemorrhage&lt;/P&gt;
&lt;P&gt;Anastomotic ulcer haemorrhage&lt;/P&gt;
&lt;P&gt;......&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;**********what I have**********;
data have;
input subjid $ 1-7 aeseq 9  aestdtc $ 13-21 AEDECOD $ 25-57;
cards;
01-004	1	2018/10/8	Anaemia
01-004	2	2018/10/8	Hyperkalaemia
01-004	3	2018/10/8	Peritoneal dialysis complication
01-006	1	2018/11/27	Blood phosphorus increased
01-007	1	2018/12/18	Faeces discoloured
01-016	1	2019/3/26	Diarrhoea
01-016	2	2019/3/29	Diarrhoea
01-018	1	2019/4/16	Arteriovenous fistula occlusion
01-018	2	2019/3/13	Faeces discoloured
01-018	3	2019/4/16	Hyperparathyroidism
01-018	4	2019/4/24	Rash
01-020	1	2019/3/19	Pruritus generalised
01-031	1	2019/6/13	Constipation
01-032	1	2019/7/20	Mouth ulceration
01-033	1	2019/8/12	Herpes zoster
01-037	1	2019/8/8	Vertigo
01-040	1	2019/8/9	Diarrhoea
01-040	2	2019/8/30	Insomnia
01-042	1	2019/9/11	Faeces discoloured
01-043	1	2019/9/11	Faeces discoloured
;
run;

***here just list three kinds of smq to test the code;
%let smq=**bleep** fissure haemorrhage/**bleep** haemorrhage/**bleep** ulcer haemorrhage/;

***find the smq in the AEDECOD;
%macro find_smq(in, out);
data &amp;amp;out;
	set &amp;amp;in;
	if find("&amp;amp;smq",AEDECOD,"i") or index("&amp;amp;smq",AEDECOD) then AESIFL="Y";
	if AESIFL="Y";
run;
%mend;

%find_smq(have, want);&lt;/PRE&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 11:32:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/641573#M191229</guid>
      <dc:creator>blueskyxyz</dc:creator>
      <dc:date>2020-04-21T11:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to find whether string1 is  in the string2 or not?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/641575#M191230</link>
      <description>&lt;P&gt;&lt;SPAN class="tran" style="font: 14px/21px Arial, 'Microsoft YaHei', '微软雅黑', '宋体', 'Malgun Gothic', Meiryo, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; box-sizing: border-box; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;" data-group="19_13"&gt;garbage code&lt;/SPAN&gt;&lt;SPAN style="font: 14px/21px Arial, 'Microsoft YaHei', '微软雅黑', '宋体', 'Malgun Gothic', Meiryo, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; float: none; display: inline !important; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="tran" style="font: 14px/21px Arial, 'Microsoft YaHei', '微软雅黑', '宋体', 'Malgun Gothic', Meiryo, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; box-sizing: border-box; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;" data-group="17_14"&gt;displays&lt;/SPAN&gt; above, update as following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;***here just list three kinds of smq to test the code;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; smq=**bleep** fissure haemorrhage/**bleep** haemorrhage/**bleep** ulcer haemorrhage/;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 11:36:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/641575#M191230</guid>
      <dc:creator>blueskyxyz</dc:creator>
      <dc:date>2020-04-21T11:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to find whether string1 is  in the string2 or not?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/641577#M191231</link>
      <description>&lt;P&gt;Sorry, sensitive words, picture is&amp;nbsp;here:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="捕获.JPG" style="width: 771px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/38529iE0A154B81242DBA9/image-size/large?v=v2&amp;amp;px=999" role="button" title="捕获.JPG" alt="捕获.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 11:40:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/641577#M191231</guid>
      <dc:creator>blueskyxyz</dc:creator>
      <dc:date>2020-04-21T11:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to find whether string1 is  in the string2 or not?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/641578#M191232</link>
      <description>&lt;P&gt;I'm afraid I'm having trouble understanding the problem, and what you are trying to do and what the desired results are. Could you take a simple example or two or three and show what the inputs are and what the desired output is?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 11:43:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/641578#M191232</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-04-21T11:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to find whether string1 is  in the string2 or not?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/641580#M191233</link>
      <description>&lt;P&gt;please try the below code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;**********what I have**********;
data have;
input subjid $ 1-7 aeseq 8  aestdtc $ 10-19 AEDECOD $ 20-57;
cards;
01-004 1 2018/10/8	Anaemia
01-004 2 2018/10/8	Hyperkalaemia
01-004 3 2018/10/8	Peritoneal dialysis complication
01-006 1 2018/11/27	Blood phosphorus increased
01-007 1 2018/12/18	Faeces discoloured
01-016 1 2019/3/26	Diarrhoea
01-016 2 2019/3/29	Diarrhoea
01-018 1 2019/4/16	Arteriovenous fistula occlusion
01-018 2 2019/3/13	Faeces discoloured
01-018 3 2019/4/16	Hyperparathyroidism
01-018 4 2019/4/24	Rash
01-020 1 2019/3/19	Pruritus generalised
01-031 1 2019/6/13	Constipation
01-032 1 2019/7/20	Mouth ulceration
01-033 1 2019/8/12	Herpes zoster
01-037 1 2019/8/8	Vertigo
01-040 1 2019/8/9	Diarrhoea
01-040 2 2019/8/30	Insomnia
01-042 1 2019/9/11	Faeces discoloured
01-043 1 2019/9/11	Faeces discoloured
;
run;

***here just list three kinds of smq to test the code;
%let smq=anal fissure haemorrhage|anal haemorrhage|Anal ulcer haemorrhage;

***find the smq in the AEDECOD;
%macro find_smq(in, out);
data &amp;amp;out;
	set &amp;amp;in;
	if prxmatch("m/&amp;amp;smq/oi",aedecod) then aesifl='Y';
	if AESIFL="Y";
run;
%mend;

%find_smq(have, want);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Apr 2020 11:56:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/641580#M191233</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2020-04-21T11:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to find whether string1 is  in the string2 or not?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/641582#M191234</link>
      <description>&lt;P&gt;at the moment since there are no matching values the macro returns a dataset with zero observations. so please update the macro variables values to below and run the macro so it returns a dataset with 4 observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let smq=Anaemia|Diarrhoea|Insomnia;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 11:58:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/641582#M191234</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2020-04-21T11:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to find whether string1 is  in the string2 or not?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/641587#M191238</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a few different ways to do this and here is another way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data smq;&lt;BR /&gt;infile cards truncover;&lt;BR /&gt;input smq $100.;&lt;BR /&gt;cards;&lt;BR /&gt;**bleep** fissure haemorrhage&lt;BR /&gt;**bleep** haemorrhage&lt;BR /&gt;**bleep** ulcer haemorrhage&lt;BR /&gt;Anastomotic haemorrhage&lt;BR /&gt;Anastomotic ulcer haemorrhage&lt;BR /&gt;Insomnia&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input subjid $ 1-7 aeseq 9 aestdtc $ 13-21 AEDECOD $ 25-57;&lt;BR /&gt;cards;&lt;BR /&gt;01-004 1 2018/10/8 Anaemia&lt;BR /&gt;01-004 2 2018/10/8 Hyperkalaemia&lt;BR /&gt;01-004 3 2018/10/8 Peritoneal dialysis complication&lt;BR /&gt;01-006 1 2018/11/27 Blood phosphorus increased&lt;BR /&gt;01-007 1 2018/12/18 Faeces discoloured&lt;BR /&gt;01-016 1 2019/3/26 Diarrhoea&lt;BR /&gt;01-016 2 2019/3/29 Diarrhoea&lt;BR /&gt;01-018 1 2019/4/16 Arteriovenous fistula occlusion&lt;BR /&gt;01-018 2 2019/3/13 Faeces discoloured&lt;BR /&gt;01-018 3 2019/4/16 Hyperparathyroidism&lt;BR /&gt;01-018 4 2019/4/24 Rash&lt;BR /&gt;01-020 1 2019/3/19 Pruritus generalised&lt;BR /&gt;01-031 1 2019/6/13 Constipation&lt;BR /&gt;01-032 1 2019/7/20 Mouth ulceration&lt;BR /&gt;01-033 1 2019/8/12 Herpes zoster&lt;BR /&gt;01-037 1 2019/8/8 Vertigo&lt;BR /&gt;01-040 1 2019/8/9 Diarrhoea&lt;BR /&gt;01-040 2 2019/8/30 Insomnia&lt;BR /&gt;01-042 1 2019/9/11 Faeces discoloured&lt;BR /&gt;01-043 1 2019/9/11 Faeces discoloured&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql nolist;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;select smq into :smq1-:smq999&lt;BR /&gt;&amp;nbsp; &amp;nbsp;from smq;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%let numsmqs=&amp;amp;sqlobs.;&lt;/P&gt;&lt;P&gt;%macro findem;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table havesmqs as&lt;BR /&gt;&amp;nbsp; &amp;nbsp;select *&lt;BR /&gt;&amp;nbsp; &amp;nbsp;from have&lt;BR /&gt;where lowcase(aedecod) ? "%lowcase(&amp;amp;smq1.)"&lt;BR /&gt;%do i=1 %to &amp;amp;numsmqs.;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;or lowcase(aedecod) ? "%lowcase(&amp;amp;&amp;amp;smq&amp;amp;i.)"&lt;BR /&gt;%end;&lt;BR /&gt;;quit;&lt;/P&gt;&lt;P&gt;%mend findem;&lt;BR /&gt;%findem;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 12:23:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/641587#M191238</guid>
      <dc:creator>BrianVarney</dc:creator>
      <dc:date>2020-04-21T12:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to find whether string1 is  in the string2 or not?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/650345#M195014</link>
      <description>&lt;DIV id="tinyMceEditorWen_23_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/333"&gt;@BrianVarney&lt;/a&gt;&amp;nbsp; Brain, thanks for your reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my code, I also use the same mehod.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="捕获.JPG" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39876iE2E7556F6F1F09B0/image-size/large?v=v2&amp;amp;px=999" role="button" title="捕获.JPG" alt="捕获.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2020 05:25:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/650345#M195014</guid>
      <dc:creator>blueskyxyz</dc:creator>
      <dc:date>2020-05-25T05:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to find whether string1 is  in the string2 or not?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/650348#M195015</link>
      <description>Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/129283"&gt;@jag&lt;/a&gt; for your help.</description>
      <pubDate>Mon, 25 May 2020 05:38:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-whether-string1-is-in-the-string2-or-not/m-p/650348#M195015</guid>
      <dc:creator>blueskyxyz</dc:creator>
      <dc:date>2020-05-25T05:38:44Z</dc:date>
    </item>
  </channel>
</rss>

