<?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 run a code five times in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/run-a-code-five-times/m-p/539854#M148840</link>
    <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to match HRM_L2(a company name variable) with five different company names(i.e., &lt;STRONG&gt;NAME,&amp;nbsp;COMPANY_NAME,&amp;nbsp;COMPANY_NAME_1,&amp;nbsp;COMPANY_NAME___SHORT,&amp;nbsp;PREVIOUS_NAME&lt;/STRONG&gt;) which recorded in the same datasets.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table Sa_step4.Datastream_Patstat&lt;STRONG&gt;1&lt;/STRONG&gt; as 
select distinct 
Pa.HRM_L2,
Type
from Step1.Patstat_gb_hrm_set as Pa
join Dataset.Datastream_gb_full as Da on Da.&lt;STRONG&gt;name&lt;/STRONG&gt;=Pa.HRM_L2
order by HRM_L2
;
quit;

proc sql;
create table Sa_step4.Datastream_Patstat&lt;STRONG&gt;2&lt;/STRONG&gt; as 
select distinct 
Pa.HRM_L2,
Type
from Step1.Patstat_gb_hrm_set as Pa
join Dataset.Datastream_gb_full as Da on Da.&lt;STRONG&gt;COMPANY_NAME&lt;/STRONG&gt;=Pa.HRM_L2
order by HRM_L2
;
quit;


proc sql;
create table Sa_step4.Datastream_Patstat&lt;STRONG&gt;3&lt;/STRONG&gt; as 
select distinct 
Pa.HRM_L2,
Type
from Step1.Patstat_gb_hrm_set as Pa
join Dataset.Datastream_gb_full as Da on Da.&lt;STRONG&gt;COMPANY_NAME_1&lt;/STRONG&gt;=Pa.HRM_L2
order by HRM_L2
;
quit;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;how can I repeat this code five times? could you please give me some suggestion about this ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;</description>
    <pubDate>Sat, 02 Mar 2019 16:55:41 GMT</pubDate>
    <dc:creator>Alexxxxxxx</dc:creator>
    <dc:date>2019-03-02T16:55:41Z</dc:date>
    <item>
      <title>run a code five times</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-a-code-five-times/m-p/539854#M148840</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to match HRM_L2(a company name variable) with five different company names(i.e., &lt;STRONG&gt;NAME,&amp;nbsp;COMPANY_NAME,&amp;nbsp;COMPANY_NAME_1,&amp;nbsp;COMPANY_NAME___SHORT,&amp;nbsp;PREVIOUS_NAME&lt;/STRONG&gt;) which recorded in the same datasets.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table Sa_step4.Datastream_Patstat&lt;STRONG&gt;1&lt;/STRONG&gt; as 
select distinct 
Pa.HRM_L2,
Type
from Step1.Patstat_gb_hrm_set as Pa
join Dataset.Datastream_gb_full as Da on Da.&lt;STRONG&gt;name&lt;/STRONG&gt;=Pa.HRM_L2
order by HRM_L2
;
quit;

proc sql;
create table Sa_step4.Datastream_Patstat&lt;STRONG&gt;2&lt;/STRONG&gt; as 
select distinct 
Pa.HRM_L2,
Type
from Step1.Patstat_gb_hrm_set as Pa
join Dataset.Datastream_gb_full as Da on Da.&lt;STRONG&gt;COMPANY_NAME&lt;/STRONG&gt;=Pa.HRM_L2
order by HRM_L2
;
quit;


proc sql;
create table Sa_step4.Datastream_Patstat&lt;STRONG&gt;3&lt;/STRONG&gt; as 
select distinct 
Pa.HRM_L2,
Type
from Step1.Patstat_gb_hrm_set as Pa
join Dataset.Datastream_gb_full as Da on Da.&lt;STRONG&gt;COMPANY_NAME_1&lt;/STRONG&gt;=Pa.HRM_L2
order by HRM_L2
;
quit;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;how can I repeat this code five times? could you please give me some suggestion about this ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;</description>
      <pubDate>Sat, 02 Mar 2019 16:55:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-a-code-five-times/m-p/539854#M148840</guid>
      <dc:creator>Alexxxxxxx</dc:creator>
      <dc:date>2019-03-02T16:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: run a code five times</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-a-code-five-times/m-p/539855#M148841</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;macro doit(myi=,myvar=);
proc sql;
create table Sa_step4.Datastream_Patstat&amp;amp;myi. as 
select distinct 
Pa.HRM_L2,
Type
from Step1.Patstat_gb_hrm_set as Pa
join Dataset.Datastream_gb_full as Da on Da.&amp;amp;myvar.=Pa.HRM_L2
order by HRM_L2
;
quit;

%mend doit;
%doit(myi=1,myvar=name);
%doit(myi=2,myvar=Company_name);
%doit(myi=3,myvar=company_name_1);
%doit(myi=4,myvar=company_name__short);
%doit(myi=5,myvar=previous_name);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Mar 2019 17:24:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-a-code-five-times/m-p/539855#M148841</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-03-02T17:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: run a code five times</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-a-code-five-times/m-p/539856#M148842</link>
      <description>&lt;P&gt;Dear VDD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;appreciate your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May I ask one more questions? What should I do if I would like to run your code for ten other countries?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, US,CN,CH,BR,CA,CL et cl.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your attention to this matter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Mar 2019 17:28:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-a-code-five-times/m-p/539856#M148842</guid>
      <dc:creator>Alexxxxxxx</dc:creator>
      <dc:date>2019-03-02T17:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: run a code five times</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-a-code-five-times/m-p/539860#M148845</link>
      <description>&lt;P&gt;you could us an array with your list (&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21.33px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;US,CN,CH,BR,CA,CL et cl.&lt;/SPAN&gt;) a in do loop and call the macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Mar 2019 20:04:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-a-code-five-times/m-p/539860#M148845</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-03-02T20:04:26Z</dc:date>
    </item>
  </channel>
</rss>

