<?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: merging variables in SAS in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712446#M27038</link>
    <description>&lt;P&gt;Are there errors or warnings in the LOG? Please show us the complete LOG, with nothing chopped out, for this data step, pasting it as text into the window that appears when you click on the &amp;lt;/&amp;gt; icon.&amp;nbsp;&lt;STRONG&gt;DO NOT SKIP THIS STEP&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are your values lower case 'yes', or are some of the letters upper case?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jan 2021 16:56:17 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-01-19T16:56:17Z</dc:date>
    <item>
      <title>merging variables in SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712429#M27029</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I currently have a dataset with 3 variables I need to merge, "person" "tele" and "phone". each variable has a yes/no response. I want to create one variable "visit_type" that codes "yes" for person as "1", "yes" for "tele" as "2" and "yes" for phone as "3" while dropping all of the "no"s. Can anyone help with this? Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 16:00:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712429#M27029</guid>
      <dc:creator>lawye010</dc:creator>
      <dc:date>2021-01-19T16:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: merging variables in SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712437#M27032</link>
      <description>&lt;P&gt;What if all three are YES then what do you want to do?&lt;/P&gt;
&lt;P&gt;Please provide example data. Provide input example and what output you want for that input.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 16:32:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712437#M27032</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-19T16:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: merging variables in SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712438#M27033</link>
      <description>&lt;P&gt;All three categories are mutually exclusive, so if the visit was in person it is not tele or phone.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 16:35:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712438#M27033</guid>
      <dc:creator>lawye010</dc:creator>
      <dc:date>2021-01-19T16:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: merging variables in SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712439#M27034</link>
      <description>&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;Input data:&lt;/P&gt;&lt;P&gt;person&amp;nbsp; &amp;nbsp; &amp;nbsp; tele&amp;nbsp; &amp;nbsp; &amp;nbsp; phone&lt;/P&gt;&lt;P&gt;yes&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; no&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;no&lt;/P&gt;&lt;P&gt;no&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; yes&amp;nbsp; &amp;nbsp; &amp;nbsp;no&lt;/P&gt;&lt;P&gt;no&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;no&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; yes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;Visit_Type&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 16:37:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712439#M27034</guid>
      <dc:creator>lawye010</dc:creator>
      <dc:date>2021-01-19T16:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: merging variables in SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712441#M27035</link>
      <description>&lt;P&gt;Straightforward coding and readable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    /* Person, Tele and Phone are mutually exclusive */
    if person='yes' then visit_type=1;
    else if tele='yes' then visit_type=2;
    else if phone='yes' then visit_type=3;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Jan 2021 16:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712441#M27035</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-19T16:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: merging variables in SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712442#M27036</link>
      <description>&lt;P&gt;Alternative, less coding but perhaps not as logically intuitive if you look at it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    /* Person, Tele and Phone are mutually exclusive */
    visit_type=whichc('yes',person,tele,phone);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 16:51:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712442#M27036</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-19T16:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: merging variables in SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712445#M27037</link>
      <description>&lt;P&gt;Hi Paige,&lt;/P&gt;&lt;P&gt;I tried running that code and this is what the output looked like when I attempted to run a chi squared analysis using the new variable:&lt;/P&gt;&lt;P&gt;data dataseta;&lt;BR /&gt;set dataset;&lt;BR /&gt;/* Person, Tele and Phone are mutually exclusive */&lt;BR /&gt;if consentperson='yes' then visit_typeconsent=1;&lt;BR /&gt;else if consenttele='yes' then visit_typeconsent=2;&lt;BR /&gt;else if consentphone='yes' then visit_typeconsent=3;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc freq data=dataseta;&lt;BR /&gt;TABLES visit_typeconsent*consentdeviation/chisq expected nopercent;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc freq data=dataseta;&lt;BR /&gt;tables visit_typeconsent*consent_complete/chisq expected nopercent;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;TABLE border="0" cellspacing="1" cellpadding="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;reach&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;DIV class="c proctitle"&gt;The FREQ Procedure&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV align="center"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;For visit_typeconsent * consentdeviation&lt;BR /&gt;all data are missing because&lt;BR /&gt;all levels of variable visit_typeconsent are missing.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV class="branch"&gt;&lt;TABLE border="0" cellspacing="1" cellpadding="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;reach&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;DIV class="c proctitle"&gt;The FREQ Procedure&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV align="center"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;For visit_typeconsent * consent_complete&lt;BR /&gt;all data are missing because&lt;BR /&gt;all levels of variable visit_typeconsent are missing.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 19 Jan 2021 16:51:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712445#M27037</guid>
      <dc:creator>lawye010</dc:creator>
      <dc:date>2021-01-19T16:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: merging variables in SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712446#M27038</link>
      <description>&lt;P&gt;Are there errors or warnings in the LOG? Please show us the complete LOG, with nothing chopped out, for this data step, pasting it as text into the window that appears when you click on the &amp;lt;/&amp;gt; icon.&amp;nbsp;&lt;STRONG&gt;DO NOT SKIP THIS STEP&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are your values lower case 'yes', or are some of the letters upper case?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 16:56:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712446#M27038</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-19T16:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: merging variables in SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712447#M27039</link>
      <description>&lt;P&gt;Here is the log:&lt;/P&gt;&lt;P&gt;4020 data dataseta;&lt;BR /&gt;4021 set dataset;&lt;BR /&gt;4022 /* Person, Tele and Phone are mutually exclusive */&lt;BR /&gt;4023 if consentperson='yes' then visit_type=1;&lt;BR /&gt;4024 else if consenttele='yes' then visit_type=2;&lt;BR /&gt;4025 else if consentphone='yes' then visit_type=3;&lt;BR /&gt;4026 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 166 observations read from the data set WORK.DATASET.&lt;BR /&gt;NOTE: The data set WORK.DATASETA has 166 observations and 254 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;4027&lt;BR /&gt;4028&lt;BR /&gt;4029 proc freq data=dataseta;&lt;BR /&gt;4030 TABLES consentperson*consentdeviation/chisq expected nopercent;&lt;BR /&gt;4031 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 166 observations read from the data set WORK.DATASETA.&lt;BR /&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;BR /&gt;real time 0.14 seconds&lt;BR /&gt;cpu time 0.09 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;4032&lt;BR /&gt;4033 proc freq data=dataseta;&lt;BR /&gt;4034 tables consentperson*consent_complete/chisq expected nopercent;&lt;BR /&gt;4035 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 166 observations read from the data set WORK.DATASETA.&lt;BR /&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;BR /&gt;real time 0.13 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;4036 data dataseta;&lt;BR /&gt;4037 set dataset;&lt;BR /&gt;4038 /* Person, Tele and Phone are mutually exclusive */&lt;BR /&gt;4039 if consentperson='yes' then visit_typeconsent=1;&lt;BR /&gt;4040 else if consenttele='yes' then visit_typeconsent=2;&lt;BR /&gt;4041 else if consentphone='yes' then visit_typeconsent=3;&lt;BR /&gt;4042 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 166 observations read from the data set WORK.DATASET.&lt;BR /&gt;NOTE: The data set WORK.DATASETA has 166 observations and 254 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;4043&lt;BR /&gt;4044&lt;BR /&gt;4045 proc freq data=dataseta;&lt;BR /&gt;4046 TABLES visit_typeconsent*consentdeviation/chisq expected nopercent;&lt;BR /&gt;4047 run;&lt;/P&gt;&lt;P&gt;NOTE: No statistics are computed for visit_typeconsent * consentdeviation because all data are&lt;BR /&gt;missing.&lt;BR /&gt;NOTE: There were 166 observations read from the data set WORK.DATASETA.&lt;BR /&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;BR /&gt;real time 0.06 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;4048&lt;BR /&gt;4049 proc freq data=dataseta;&lt;BR /&gt;4050 tables visit_typeconsent*consent_complete/chisq expected nopercent;&lt;BR /&gt;4051 run;&lt;/P&gt;&lt;P&gt;NOTE: No statistics are computed for visit_typeconsent * consent_complete because all data are&lt;BR /&gt;missing.&lt;BR /&gt;NOTE: There were 166 observations read from the data set WORK.DATASETA.&lt;BR /&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;BR /&gt;real time 0.10 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 16:56:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712447#M27039</guid>
      <dc:creator>lawye010</dc:creator>
      <dc:date>2021-01-19T16:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: merging variables in SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712448#M27040</link>
      <description>&lt;P&gt;It's important that when you show us the LOG, you show it to us following the instructions given, which formats the LOG properly to maximize readability, and this then gets you results faster. I no longer bother trying to decipher LOGs where the instructions have not been followed. Thus, I repeat, with emphasis:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please show us the complete LOG, with nothing chopped out, for this data step, &lt;FONT color="#FF0000"&gt;pasting it as text into the window that appears when you click on the &amp;lt;/&amp;gt; icon.&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;DO NOT SKIP THIS STEP&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 17:01:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712448#M27040</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-19T17:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: merging variables in SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712449#M27041</link>
      <description>&lt;P&gt;apologies..&lt;/P&gt;&lt;LI-CODE lang="sas"&gt;4036  data dataseta;
4037      set dataset;
4038      /* Person, Tele and Phone are mutually exclusive */
4039      if consentperson='yes' then visit_typeconsent=1;
4040      else if consenttele='yes' then visit_typeconsent=2;
4041      else if consentphone='yes' then visit_typeconsent=3;
4042  run;

NOTE: There were 166 observations read from the data set WORK.DATASET.
NOTE: The data set WORK.DATASETA has 166 observations and 254 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.00 seconds


4043
4044
4045  proc freq data=dataseta;
4046  TABLES visit_typeconsent*consentdeviation/chisq expected nopercent;
4047  run;

NOTE: No statistics are computed for visit_typeconsent * consentdeviation because all data are
      missing.
NOTE: There were 166 observations read from the data set WORK.DATASETA.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.06 seconds
      cpu time            0.00 seconds


4048
4049  proc freq data=dataseta;
4050  tables visit_typeconsent*consent_complete/chisq expected nopercent;
4051  run;

NOTE: No statistics are computed for visit_typeconsent * consent_complete because all data are
      missing.
NOTE: There were 166 observations read from the data set WORK.DATASETA.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.10 seconds
      cpu time            0.03 seconds

&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 17:08:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712449#M27041</guid>
      <dc:creator>lawye010</dc:creator>
      <dc:date>2021-01-19T17:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: merging variables in SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712450#M27042</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Are your values in data set named DATASET lower case 'yes', or are some of the letters upper case?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 17:10:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712450#M27042</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-19T17:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: merging variables in SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712453#M27043</link>
      <description>&lt;P&gt;Thanks so much I did not realize it was case sensitive. I corrected this and it is working great now. Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 17:21:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/merging-variables-in-SAS/m-p/712453#M27043</guid>
      <dc:creator>lawye010</dc:creator>
      <dc:date>2021-01-19T17:21:23Z</dc:date>
    </item>
  </channel>
</rss>

