<?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: Want to merge datasets with 0 observations with the help of dummy dataset and _null_ in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951798#M372041</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/455448"&gt;@chaitanyagaddam&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;The actual point is obs3 and obs4 datasets have 0 obs I have to create a dummy for 0 observations dataset by using _null_ and make it merge with obs1 and obs2 datset.in final dataset i want to have records for obs3 and obs4 datasets updates with 0 along with 19 obs&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Still does not make sense.&lt;/P&gt;
&lt;P&gt;Are you just talking about make a REPORT of the number of observations in each dataset?&lt;/P&gt;
&lt;PRE&gt;NOBS DATASET
10 WORK.OB1
 9 WORK.OB2
 0 WORK.OB3
 0 WORK.OB4&lt;/PRE&gt;
&lt;P&gt;Or are you talking about adding extra observations?&lt;/P&gt;
&lt;P&gt;So perhaps something like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data skeleton;
  length sex $5 ;
  do sex='F','M','Other','Trans';
    output;
  end;
run;

data want;
  merge skeleton ob1-ob4;
  by sex;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Why do you need either of those? What analysis are you trying to do?&lt;/P&gt;
&lt;P&gt;Have you looked at the PRELOADFMT option of proc summary?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/completetypes-preloadfmt-vs-completetypes/td-p/83674" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/completetypes-preloadfmt-vs-completetypes/td-p/83674&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Nov 2024 13:29:25 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2024-11-25T13:29:25Z</dc:date>
    <item>
      <title>Want to merge datasets with 0 observations with the help of dummy dataset and _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951749#M372015</link>
      <description>Data ob1;&lt;BR /&gt;Set sashelp.class;&lt;BR /&gt;Where sex="M";&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;Data ob2;&lt;BR /&gt;Set sashelp.class;&lt;BR /&gt;Where sex="F";&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;Data ob3;&lt;BR /&gt;Set sashelp.class;&lt;BR /&gt;Where sex="Trans";&lt;BR /&gt;/*This dataset get 0 obs*/;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;Data ob4;&lt;BR /&gt;Set sashelp.class;&lt;BR /&gt;Where sex="Other";&lt;BR /&gt;/*This dataset get 0 obs*/;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;I wanted to merge 4 datasets in that 2 of them having 0 obs.and 0 obs dataset should also get merge and get record with null values.need to create dummy dataset to get 0 obs dataset and should use _null_.&lt;BR /&gt;Can anyone help?&lt;BR /&gt;&lt;BR /&gt;I tried, but I didn't get the answer,can anyone help me out of this.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 25 Nov 2024 04:29:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951749#M372015</guid>
      <dc:creator>chaitanyagaddam</dc:creator>
      <dc:date>2024-11-25T04:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Want to merge datasets with 0 observations with the help of dummy dataset and _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951750#M372016</link>
      <description>&lt;P&gt;If your source data set got zero rows then it can't add any rows to the target data set.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the zero row data set contains a variable (column) that doesn't exist in any of the other merged source data sets then this variable will get added to the target data set and be all missing.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 05:09:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951750#M372016</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-11-25T05:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Want to merge datasets with 0 observations with the help of dummy dataset and _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951782#M372031</link>
      <description>&lt;P&gt;Do you mean something like this:&lt;/P&gt;
&lt;P&gt;Code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data all4together;
  set ob1 ob2 ob3 ob4;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1   data all4together;
2     set ob1 ob2 ob3 ob4;
3   run;

NOTE: There were 10 observations read from the data set WORK.OB1.
NOTE: There were 9 observations read from the data set WORK.OB2.
NOTE: There were 0 observations read from the data set WORK.OB3.
NOTE: There were 0 observations read from the data set WORK.OB4.
NOTE: The data set WORK.ALL4TOGETHER has 19 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.01 seconds
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 11:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951782#M372031</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-11-25T11:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Want to merge datasets with 0 observations with the help of dummy dataset and _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951783#M372032</link>
      <description>Yes, sorry its my mistake I forgot to mention.</description>
      <pubDate>Mon, 25 Nov 2024 11:27:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951783#M372032</guid>
      <dc:creator>chaitanyagaddam</dc:creator>
      <dc:date>2024-11-25T11:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Want to merge datasets with 0 observations with the help of dummy dataset and _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951787#M372036</link>
      <description>&lt;P&gt;So what is the issue ? Because the code clearly reads all the files, even the empty ones.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 11:35:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951787#M372036</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-11-25T11:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: Want to merge datasets with 0 observations with the help of dummy dataset and _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951789#M372037</link>
      <description>The actual point is obs3 and obs4 datasets have 0 obs I have to create a dummy for 0 observations dataset by using _null_ and make it merge with obs1 and obs2 datset.in final dataset i want to have records for obs3 and obs4 datasets updates with 0 along with 19 obs</description>
      <pubDate>Mon, 25 Nov 2024 11:52:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951789#M372037</guid>
      <dc:creator>chaitanyagaddam</dc:creator>
      <dc:date>2024-11-25T11:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Want to merge datasets with 0 observations with the help of dummy dataset and _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951790#M372038</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data shell; /* create shell datasets */
  length sex $ 5;
  sex="M"; output;
  sex="F"; output;
  sex="Trans"; output;
  sex="Other"; output;
Run;

/* sort by sex */
proc sort data=shell; 
  by sex;
run;

proc sort data=sashelp.class out=class_sorted; 
  by sex;
run;

data combined;
  merge shell class_sorted;
  by sex;
run;

proc print data=combined;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Nov 2024 12:22:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951790#M372038</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-11-25T12:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Want to merge datasets with 0 observations with the help of dummy dataset and _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951798#M372041</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/455448"&gt;@chaitanyagaddam&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;The actual point is obs3 and obs4 datasets have 0 obs I have to create a dummy for 0 observations dataset by using _null_ and make it merge with obs1 and obs2 datset.in final dataset i want to have records for obs3 and obs4 datasets updates with 0 along with 19 obs&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Still does not make sense.&lt;/P&gt;
&lt;P&gt;Are you just talking about make a REPORT of the number of observations in each dataset?&lt;/P&gt;
&lt;PRE&gt;NOBS DATASET
10 WORK.OB1
 9 WORK.OB2
 0 WORK.OB3
 0 WORK.OB4&lt;/PRE&gt;
&lt;P&gt;Or are you talking about adding extra observations?&lt;/P&gt;
&lt;P&gt;So perhaps something like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data skeleton;
  length sex $5 ;
  do sex='F','M','Other','Trans';
    output;
  end;
run;

data want;
  merge skeleton ob1-ob4;
  by sex;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Why do you need either of those? What analysis are you trying to do?&lt;/P&gt;
&lt;P&gt;Have you looked at the PRELOADFMT option of proc summary?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/completetypes-preloadfmt-vs-completetypes/td-p/83674" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/completetypes-preloadfmt-vs-completetypes/td-p/83674&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 13:29:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951798#M372041</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-11-25T13:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Want to merge datasets with 0 observations with the help of dummy dataset and _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951807#M372047</link>
      <description>While creating the tables i got created 4 datasets with proc freq one dataset have 7 records one dataset have 8 records and 2 datasets have 0 records and need to merge them vertically in final dataset along with 7 records and 8 records ,zero obs dataset records need to present and update with 0 for those records and they told me to create dummy dataset for that and use _null_</description>
      <pubDate>Mon, 25 Nov 2024 14:09:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951807#M372047</guid>
      <dc:creator>chaitanyagaddam</dc:creator>
      <dc:date>2024-11-25T14:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Want to merge datasets with 0 observations with the help of dummy dataset and _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951812#M372051</link>
      <description>&lt;P&gt;Can you show an example of the output dataset you want to create?&amp;nbsp; You're using the word MERGE, but that has a specific meaning in SAS, which I don't think is what you intent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It sounds like you want to vertically concatenate / stack the four datasets, and get an output dataset where you have 21 records, which are 10 records from males, 9 records from females, and two records with all missing values, from no trans and no other.&amp;nbsp; Is that right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SAS, a 0 obs dataset has no rows.&amp;nbsp; This is different from having one row with missing values.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to create a dataset with one row of missing values when a WHERE condition is false, you could do it like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data foo;
  if last then output ;
  set sashelp.class end=last;
  where sex="Other";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;During compile time, the compiler will set the variable LAST to the value 1 if there are no records that meet the WHERE statement.&amp;nbsp; (Side note: the documentation claims the end= variable is always initialized to zero and will not be set to 1 until the SET statement executes, which is incorrect.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Above will output one record, but it will also only output one&amp;nbsp; record if you change the where clause to sex="M".&amp;nbsp; So you can make the output statement conditional to only output a record with missing values when on the first iteration of the data step, before the SET statement has executed, LAST=1.&amp;nbsp; And you have to add another OUTPUT statement at the bottom of the loop, which will output records that do meet the WHERE clause.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you could your four steps like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ob1;
  if _N_=1 and last then output ;
  set sashelp.class end=last;
  where sex="M";
  output ;
run;

data ob2;
  if _N_=1 and last then output ;
  set sashelp.class end=last;
  where sex="F";
  output ;
run;

data ob3;
  if _N_=1 and last then output ;
  set sashelp.class end=last;
  where sex="Trans";
  output ;
run;

data ob4;
  if _N_=1 and last then output ;
  set sashelp.class end=last;
  where sex="Other";
  output ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then concatenation them:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
   set ob1-ob4 ;
run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result is:&lt;/P&gt;
&lt;PRE&gt;Obs    Name       Sex    Age    Height    Weight

  1    Alfred      M      14     69.0      112.5
  2    Henry       M      14     63.5      102.5
  3    James       M      12     57.3       83.0
  4    Jeffrey     M      13     62.5       84.0
  5    John        M      12     59.0       99.5
  6    Philip      M      16     72.0      150.0
  7    Robert      M      12     64.8      128.0
  8    Ronald      M      15     67.0      133.0
  9    Thomas      M      11     57.5       85.0
 10    William     M      15     66.5      112.0
 11    Alice       F      13     56.5       84.0
 12    Barbara     F      13     65.3       98.0
 13    Carol       F      14     62.8      102.5
 14    Jane        F      12     59.8       84.5
 15    Janet       F      15     62.5      112.5
 16    Joyce       F      11     51.3       50.5
 17    Judy        F      14     64.3       90.0
 18    Louise      F      12     56.3       77.0
 19    Mary        F      15     66.5      112.0
 20                        .       .          .
 21                        .       .          .

&lt;/PRE&gt;
&lt;P&gt;If you want Sex to have the value "T" or "O", you could add an assignment statement to the top of the DATA step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are probably easier ways to make a row of missing values.&amp;nbsp; For example, you could make a dataset with four records with values of sex "M" "F" "T" "O" and merge/join that against sashelp.class, and that would do it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data grid ;
  do sex="M","F","T","O" ;
    output ;
  end ;
run ;

proc sql ;
  create table want2 as
  select a.sex as sex_grid, b.* from 
  grid as a left join sashelp.class as b
  on a.sex=b.sex
  ;
quit ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 14:48:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951812#M372051</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-11-25T14:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Want to merge datasets with 0 observations with the help of dummy dataset and _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951821#M372054</link>
      <description>&lt;P&gt;Given the 19 obs in sashelp.class have only sex='M' or 'F', you want to add two more obs, with SEX='Trans' or 'Other', and all other variables missing. I.e you want 21 obs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Along the lines of&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;'s suggestion but &lt;U&gt;&lt;STRONG&gt;without&lt;/STRONG&gt;&lt;/U&gt; the proc sort:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data obs1 (where=(sex='F'))
     obs2 (where=(sex='M'))
     obs3 (where=(sex='Trans'))
     obs4 (where=(sex='Other'));
  length sex $5;
  set sashelp.class;
run;

data want (drop=i);
  set obs1-obs4  end=end_of_data;

  array genders {4} $5 _temporary_ ('M','F','Trans','Other');
  i=whichc(sex,of genders{*});
  if i&amp;gt;0 then call missing(genders{i});
  output;

  if end_of_data;
  call missing(of _all_);
  do i=1 to dim(genders);
    sex=genders{i};
    if sex^=' ' then output;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This uses a temporary array with all the expected values of SEX.&amp;nbsp; Any values found in the incoming data are deleted from the array, leaving only those analogous to your zero-obs datasets.&amp;nbsp; Those are added after the "if end_of_data;" statement.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 18:50:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951821#M372054</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2024-11-25T18:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: Want to merge datasets with 0 observations with the help of dummy dataset and _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951878#M372075</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/455448"&gt;@chaitanyagaddam&lt;/a&gt;&amp;nbsp;Suggest you post the desired target dataset for the sample source data you shared. That should clarify what you need.&lt;/P&gt;
&lt;P&gt;Adding rows for source tables that have no rows feels like a sub-optimal approach. The main reason for such an approach I can think of is for some reporting requirement. IF this is for reporting and it is about ensuring that in reports all possible values for a class variable get printed then consider creating a classdata set instead. &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n18cg5nn785mrnn1semjee5eaywe.htm" target="_self"&gt;One example here&lt;/A&gt;.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data ob1;
  Set sashelp.class;
  Where sex="M";
Run;

Data ob2;
  Set sashelp.class;
  Where sex="F";
Run;

Data ob3;
  Set sashelp.class;
  Where sex="Trans";
Run;

Data ob4;
  Set sashelp.class;
  Where sex="Other";
Run;

data all_obs;
  length sex $5;
  set ob1-ob4;
run;

data all_class;
  length sex $5;
  do sex='M','F','Trans','Other';
    output;
  end;
run;

/* sample reports */
proc means data=work.all_obs classdata=work.all_class ;
    class Sex;
    var;
run;

proc tabulate data=work.all_obs classdata=work.all_class noseps;
  class sex;
  table sex;
run;

/*proc report ....*/
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1732577093138.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/102512i6FF6D1AD37F2F30F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1732577093138.png" alt="Patrick_0-1732577093138.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 23:24:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-merge-datasets-with-0-observations-with-the-help-of/m-p/951878#M372075</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-11-25T23:24:54Z</dc:date>
    </item>
  </channel>
</rss>

