<?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: need to replace numbers with template variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/need-to-replace-numbers-with-template-variables/m-p/375642#M90085</link>
    <description>&lt;P&gt;When you do a data step merge, you need to take care of variables that have the same name, but are not included in the by statement.&lt;/P&gt;
&lt;P&gt;Either drop those you do not need, or rename them in a dataset option, so you can use them with the new name in the data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would be helpful if you included how, say, the first 10 rows should look like after the merge.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jul 2017 11:42:32 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-07-13T11:42:32Z</dc:date>
    <item>
      <title>need to replace numbers with template variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-to-replace-numbers-with-template-variables/m-p/375620#M90074</link>
      <description>&lt;P&gt;I have a dataset which attached has description and need to replace it with template which i created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to use set but unsuccessfull. Attached both the datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using below step to merge the numbers in stermfnl with termcat variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help me on this&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 11:17:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-to-replace-numbers-with-template-variables/m-p/375620#M90074</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2017-07-13T11:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: need to replace numbers with template variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-to-replace-numbers-with-template-variables/m-p/375636#M90080</link>
      <description>&lt;P&gt;I can recreate your datasets very fine, but where is the merge code you tried?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 11:33:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-to-replace-numbers-with-template-variables/m-p/375636#M90080</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-13T11:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: need to replace numbers with template variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-to-replace-numbers-with-template-variables/m-p/375638#M90082</link>
      <description>&lt;P&gt;i am using the below code-&lt;/P&gt;
&lt;P&gt;data final;&lt;BR /&gt; merge stermfnl(in=a) termreas;&lt;BR /&gt; by termresn aperiod aperiodc;&lt;BR /&gt; if a;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 11:36:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-to-replace-numbers-with-template-variables/m-p/375638#M90082</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2017-07-13T11:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: need to replace numbers with template variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-to-replace-numbers-with-template-variables/m-p/375642#M90085</link>
      <description>&lt;P&gt;When you do a data step merge, you need to take care of variables that have the same name, but are not included in the by statement.&lt;/P&gt;
&lt;P&gt;Either drop those you do not need, or rename them in a dataset option, so you can use them with the new name in the data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would be helpful if you included how, say, the first 10 rows should look like after the merge.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 11:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-to-replace-numbers-with-template-variables/m-p/375642#M90085</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-13T11:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: need to replace numbers with template variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-to-replace-numbers-with-template-variables/m-p/375648#M90088</link>
      <description>&lt;P&gt;in the current output after merging both the datasets i get 2 variables one with number which has values and the other with 0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;attached example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data = stermfnl;&lt;BR /&gt; by termresn aperiod aperiodc;&lt;BR /&gt;run; &lt;BR /&gt;proc sort data = termreas;&lt;BR /&gt; by termresn aperiod aperiodc;&lt;BR /&gt;run; &lt;BR /&gt;data final;&lt;BR /&gt; merge stermfnl(in=a) termreas(drop=count disc_pct);&lt;BR /&gt; by termresn ;&lt;BR /&gt; if a;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data inc;&lt;BR /&gt; set stermfnl;&lt;BR /&gt; where termresn in (-6,-3);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data final1;&lt;BR /&gt; set final inc;&lt;BR /&gt;run;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/14072i259324F9FFD0456C/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;</description>
      <pubDate>Thu, 13 Jul 2017 11:52:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-to-replace-numbers-with-template-variables/m-p/375648#M90088</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2017-07-13T11:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: need to replace numbers with template variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-to-replace-numbers-with-template-variables/m-p/375654#M90090</link>
      <description>&lt;P&gt;When I run your code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data = stermfnl;
by termresn aperiod aperiodc;
run;

proc sort data = termreas;
by termresn aperiod aperiodc;
run;

data final;
merge
  stermfnl (in=a)
  termreas (drop=count disc_pct)
;
by termresn aperiod aperiodc;
if a;
run;

data inc;
set stermfnl;
where termresn in (-6,-3);
run;

data final1;
set
  final
  inc
;
run;

options pagesize=31767;
proc print data=final1 noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I get this result:&lt;/P&gt;
&lt;PRE&gt;    dose_tot      termcat                                                      APERIOD APERIODC count termresn totcount disc_pct

PHASE A?(N = 466) ENROLLED                                                         1   PHASE A   466      -6      466     100.0 
PHASE B?(N = 632) ENROLLED                                                         2   PHASE B   632      -6      632     100.0 
PHASE C?(N = 425) ENROLLED                                                         3   PHASE C   425      -6      425     100.0 
PHASE D?(N = 266) ENROLLED                                                         4   PHASE D   266      -6      266     100.0 
TOTAL?(N = 731)   ENROLLED                                                        99   TOTAL     731      -6      731     100.0 
PHASE A?(N = 466) DISCONTINUED                                                     1   PHASE A    99      -3      466      21.2 
PHASE B?(N = 632) DISCONTINUED                                                     2   PHASE B   207      -3      632      32.8 
PHASE C?(N = 425) DISCONTINUED                                                     3   PHASE C   159      -3      425      37.4 
PHASE D?(N = 266) DISCONTINUED                                                     4   PHASE D   164      -3      266      61.7 
TOTAL?(N = 731)   DISCONTINUED                                                    99   TOTAL     629      -3      731      86.0 
PHASE A?(N = 466) LOST TO FOLLOW-UP                                                1   PHASE A    16       2      466       3.4 
PHASE B?(N = 632) LOST TO FOLLOW-UP                                                2   PHASE B    44       2      632       7.0 
PHASE C?(N = 425) LOST TO FOLLOW-UP                                                3   PHASE C    21       2      425       4.9 
PHASE D?(N = 266) LOST TO FOLLOW-UP                                                4   PHASE D    13       2      266       4.9 
TOTAL?(N = 731)   LOST TO FOLLOW-UP                                               99   TOTAL      94       2      731      12.9 
PHASE A?(N = 466) ADVERSE EVENTS                                                   1   PHASE A    33       3      466       7.1 
PHASE B?(N = 632) ADVERSE EVENTS                                                   2   PHASE B    63       3      632      10.0 
PHASE C?(N = 425) ADVERSE EVENTS                                                   3   PHASE C    37       3      425       8.7 
TOTAL?(N = 731)   ADVERSE EVENTS                                                  99   TOTAL     133       3      731      18.2 
PHASE C?(N = 425) SPONSOR DISCONTINUED STUDY                                       3   PHASE C     1       4      425       0.2 
PHASE D?(N = 266) SPONSOR DISCONTINUED STUDY                                       4   PHASE D     4       4      266       1.5 
TOTAL?(N = 731)   SPONSOR DISCONTINUED STUDY                                      99   TOTAL       5       4      731       0.7 
PHASE A?(N = 466) SUBJECT MET WITHDRAWAL CRITERIA                                  1   PHASE A    10       5      466       2.1 
PHASE B?(N = 632) SUBJECT MET WITHDRAWAL CRITERIA                                  2   PHASE B    41       5      632       6.5 
PHASE C?(N = 425) SUBJECT MET WITHDRAWAL CRITERIA                                  3   PHASE C    26       5      425       6.1 
PHASE D?(N = 266) SUBJECT MET WITHDRAWAL CRITERIA                                  4   PHASE D    11       5      266       4.1 
TOTAL?(N = 731)   SUBJECT MET WITHDRAWAL CRITERIA                                 99   TOTAL      88       5      731      12.0 
PHASE A?(N = 466) SUBJECT WAS WITHDRAWN FROM PARTICIPATION BY THE INVESTIGATOR     1   PHASE A     3       6      466       0.6 
PHASE B?(N = 632) SUBJECT WAS WITHDRAWN FROM PARTICIPATION BY THE INVESTIGATOR     2   PHASE B     2       6      632       0.3 
PHASE C?(N = 425) SUBJECT WAS WITHDRAWN FROM PARTICIPATION BY THE INVESTIGATOR     3   PHASE C     6       6      425       1.4 
TOTAL?(N = 731)   SUBJECT WAS WITHDRAWN FROM PARTICIPATION BY THE INVESTIGATOR    99   TOTAL      11       6      731       1.5 
PHASE A?(N = 466) SUBJECT WITHDREW CONSENT TO PARTICIPATE                          1   PHASE A    32       7      466       6.9 
PHASE B?(N = 632) SUBJECT WITHDREW CONSENT TO PARTICIPATE                          2   PHASE B    45       7      632       7.1 
PHASE C?(N = 425) SUBJECT WITHDREW CONSENT TO PARTICIPATE                          3   PHASE C    56       7      425      13.2 
PHASE D?(N = 266) SUBJECT WITHDREW CONSENT TO PARTICIPATE                          4   PHASE D    23       7      266       8.6 
TOTAL?(N = 731)   SUBJECT WITHDREW CONSENT TO PARTICIPATE                         99   TOTAL     156       7      731      21.3 
PHASE A?(N = 466) PROTOCOL DEVIATION                                               1   PHASE A     3       8      466       0.6 
PHASE C?(N = 425) PROTOCOL DEVIATION                                               3   PHASE C     5       8      425       1.2 
PHASE D?(N = 266) PROTOCOL DEVIATION                                               4   PHASE D     2       8      266       0.8 
TOTAL?(N = 731)   PROTOCOL DEVIATION                                              99   TOTAL      10       8      731       1.4 
PHASE A?(N = 466) LACK OF EFFICACY                                                 1   PHASE A     2      21      466       0.4 
PHASE B?(N = 632) LACK OF EFFICACY                                                 2   PHASE B    12      21      632       1.9 
PHASE C?(N = 425) LACK OF EFFICACY                                                 3   PHASE C     7      21      425       1.6 
TOTAL?(N = 731)   LACK OF EFFICACY                                                99   TOTAL      21      21      731       2.9 
PHASE D?(N = 266) ADVERSE EVENT WITHOUT RECURRENCE OF ANY MOOD EPISODE             4   PHASE D     8      32      266       3.0 
TOTAL?(N = 731)   ADVERSE EVENT WITHOUT RECURRENCE OF ANY MOOD EPISODE            99   TOTAL       8      32      731       1.1 
PHASE D?(N = 266) RECURRENCE OF ANY MOOD EPISODE WITH ADVERSE EVENT                4   PHASE D    49      33      266      18.4 
TOTAL?(N = 731)   RECURRENCE OF ANY MOOD EPISODE WITH ADVERSE EVENT               99   TOTAL      49      33      731       6.7 
PHASE D?(N = 266) RECURRENCE OF ANY MOOD EPISODE WITHOUT ADVERSE EVENT             4   PHASE D    54      34      266      20.3 
TOTAL?(N = 731)   RECURRENCE OF ANY MOOD EPISODE WITHOUT ADVERSE EVENT            99   TOTAL      54      34      731       7.4 
PHASE A?(N = 466) ENROLLED                                                         1   PHASE A   466      -6      466     100.0 
PHASE B?(N = 632) ENROLLED                                                         2   PHASE B   632      -6      632     100.0 
PHASE C?(N = 425) ENROLLED                                                         3   PHASE C   425      -6      425     100.0 
PHASE D?(N = 266) ENROLLED                                                         4   PHASE D   266      -6      266     100.0 
TOTAL?(N = 731)   ENROLLED                                                        99   TOTAL     731      -6      731     100.0 
PHASE A?(N = 466) DISCONTINUED                                                     1   PHASE A    99      -3      466      21.2 
PHASE B?(N = 632) DISCONTINUED                                                     2   PHASE B   207      -3      632      32.8 
PHASE C?(N = 425) DISCONTINUED                                                     3   PHASE C   159      -3      425      37.4 
PHASE D?(N = 266) DISCONTINUED                                                     4   PHASE D   164      -3      266      61.7 
TOTAL?(N = 731)   DISCONTINUED                                                    99   TOTAL     629      -3      731      86.0 
&lt;/PRE&gt;
&lt;P&gt;No zeroes anywhere.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 12:00:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-to-replace-numbers-with-template-variables/m-p/375654#M90090</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-13T12:00:22Z</dc:date>
    </item>
  </channel>
</rss>

