<?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: Not sure how to isolate variable from merged data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Not-sure-how-to-isolate-variable-from-merged-data/m-p/687012#M208541</link>
    <description>&lt;P&gt;Is it possible to get those datasets from somewhere?&lt;/P&gt;
&lt;P&gt;If not, would you please provide examples in usable form (data steps with datalines), so we have something to develop and test code?&lt;/P&gt;</description>
    <pubDate>Sun, 27 Sep 2020 09:23:48 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-09-27T09:23:48Z</dc:date>
    <item>
      <title>Not sure how to isolate variable from merged data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Not-sure-how-to-isolate-variable-from-merged-data/m-p/687005#M208536</link>
      <description>&lt;P&gt;Good evening,&lt;/P&gt;&lt;P&gt;I'm trying to isolate a variable from my merged data from two specific data sets that have been merged into the data. I want to&amp;nbsp;use SAS output to check the variable RIDAGEYR but i'm not sure how to do that. I'm not getting any errors, but the results I want aren't happening. Here is my code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname libref 'C:\Users\bamfo\Downloads';
run;
	options nodate center orientation=landscape;
run;
/*#1*/
data demo_j;
	set libref.demo_j;
run;
proc means data = work.demo_j;
TITLE 'The Contents of the DEMO_J Data Set';
run;
data bpx_j;
	set libref.bpx_j;
run;
proc means data = work.bpx_j;
TITLE 'The Contents of the BPX_J Data Set';
run;
proc contents data = work.bpx_j;
run;
data bmx_j_ge2yrs;
	set libref.bmx_j_ge2yrs;
run;
proc means data = work.bmx_j_ge2yrs;
TITLE 'The Contents of the BMX_J_GE2YRS Data Set';
run;
proc contents data = work.bmx_j_ge2yrs;
run;
data bmx_j_lt2yrs;
	set libref.bmx_j_lt2yrs;
run;
proc means data = work.bmx_j_lt2yrs;
TITLE 'The Contents of the BMX_J_LT2YRS Data Set';
run;
proc contents data = work.bmx_j_lt2yrs;
run;


/*#2*/
proc means data = work.bmx_j_ge2yrs;
TITLE 'The Contents of the BMX_J_GE2YRS Data Set';
run;
proc contents data = work.bmx_j_ge2yrs;
run;
proc sort data = work.bmx_j_ge2yrs out = work.bmx_j_ge2yrs;
	by SEQN;
run;
proc means data = work.bmx_j_lt2yrs;
TITLE 'The Contents of the BMX_J_LT2YRS Data Set';
run;
proc contents data = work.bmx_j_lt2yrs;
run;
proc sort data = work.bmx_j_lt2yrs out = work.bmx_j_lt2yrs;
	by SEQN;
run;
data all;
	set work.demo_j work.bpx_j work.bmx_j_ge2yrs work.bmx_j_lt2yrs;
	by SEQN;
run;
proc contents data = work.all;
TITLE 'The Contents of All Specified Data Sets';
run;
data all;
	merge work.demo_j work.bpx_j work.bmx_j_ge2yrs work.bmx_j_lt2yrs;
	by SEQN;
run;
proc contents data = work.all;
TITLE 'The Contents of All Specified Data Sets';
run;
/*#3*/
data all;
	merge work.demo_j (in=a) work.bpx_j(in=b) work.bmx_j_ge2yrs(in=d) work.bmx_j_lt2yrs(in=c);
	by SEQN;
	demo=a;
	bp=b;
	bodymeasure=(c=1 or d=1);
run;
proc contents data =work.all;
TITLE 'The Contents of All Specified Data Sets for #3';
run;
proc print data = work.all;
run;
proc freq data = work.all;
	tables demo bp bodymeasure;
run;
/*#4*/
data all;
	merge work.demo_j (in=a) work.bpx_j(in=b) work.bmx_j_ge2yrs(in=d) work.bmx_j_lt2yrs(in=c);
	by SEQN;
	demo=a;
	bp=b;
	bodymeasure=(c=1 or d=1);
	demobpbm=a+b+c+d;
run;
proc freq data = work.all;
	tables demo bp bodymeasure demobpbm;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What should I do? Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Sep 2020 06:26:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Not-sure-how-to-isolate-variable-from-merged-data/m-p/687005#M208536</guid>
      <dc:creator>ashb</dc:creator>
      <dc:date>2020-09-27T06:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Not sure how to isolate variable from merged data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Not-sure-how-to-isolate-variable-from-merged-data/m-p/687012#M208541</link>
      <description>&lt;P&gt;Is it possible to get those datasets from somewhere?&lt;/P&gt;
&lt;P&gt;If not, would you please provide examples in usable form (data steps with datalines), so we have something to develop and test code?&lt;/P&gt;</description>
      <pubDate>Sun, 27 Sep 2020 09:23:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Not-sure-how-to-isolate-variable-from-merged-data/m-p/687012#M208541</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-27T09:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Not sure how to isolate variable from merged data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Not-sure-how-to-isolate-variable-from-merged-data/m-p/687043#M208551</link>
      <description>&lt;P&gt;I am not sure what your question is.&amp;nbsp; If you want to do something with just that variable then include appropriate code to do that.&amp;nbsp; Like a VAR statement in PROC MEANS or a TABLES statement in PROC FREQ.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data= libref.demo_j;
  var RIDAGEYR ;
run;
proc freq data= libref.demo_j;
  tables RIDAGEYR ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 27 Sep 2020 15:03:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Not-sure-how-to-isolate-variable-from-merged-data/m-p/687043#M208551</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-09-27T15:03:00Z</dc:date>
    </item>
  </channel>
</rss>

