<?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: creating one to many merge- for lab shift table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/creating-one-to-many-merge-for-lab-shift-table/m-p/950038#M371553</link>
    <description>&lt;P&gt;I do not understand what you want the output to look like.&amp;nbsp; Please show what it would look like for the sample data you have provided.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Nov 2024 15:33:42 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2024-11-06T15:33:42Z</dc:date>
    <item>
      <title>creating one to many merge- for lab shift table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-one-to-many-merge-for-lab-shift-table/m-p/950035#M371552</link>
      <description>&lt;P&gt;i have two datasets. 1. dum1 2. all_freqs&lt;/P&gt;&lt;P&gt;data dum1;length btoxgr $7.;&lt;BR /&gt;btoxgr='Grade 0'; output;&lt;BR /&gt;btoxgr='Grade 1'; output;&lt;BR /&gt;btoxgr='Grade 2'; output;&lt;BR /&gt;btoxgr='Grade 3'; output;&lt;BR /&gt;btoxgr='Grade 4'; output;&lt;BR /&gt;btoxgr='T_Btoxg'; output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data all_freqs;&lt;BR /&gt;PARCAT3='HAEMATOLOGY';btoxgr='Grade0';TRT01A='LZA';PARAMCD='GRAN';cnt=12;output;&lt;BR /&gt;PARCAT3='HAEMATOLOGY';btoxgr='Grade2';TRT01A='LZA';PARAMCD='GRAN';cnt=20;output;&lt;BR /&gt;PARCAT3='HAEMATOLOGY';btoxgr='Grade1';TRT01A='LZA';PARAMCD='LYMP';cnt=19;output;&lt;BR /&gt;PARCAT3='HAEMATOLOGY';btoxgr='Grade2';TRT01A='LZA';PARAMCD='KKSP';cnt=90;output;&lt;/P&gt;&lt;P&gt;PARCAT3='&lt;SPAN&gt;LIVER AND KIDNEY&lt;/SPAN&gt;';btoxgr='Grade0';TRT01A='LZA';PARAMCD='PLAT';cnt=12;output;&lt;BR /&gt;PARCAT3='&lt;SPAN&gt;LIVER AND KIDNEY&lt;/SPAN&gt;';btoxgr='Grade2';TRT01A='LZA';PARAMCD='WBC';cnt=22;output;&lt;BR /&gt;PARCAT3='&lt;SPAN&gt;LIVER AND KIDNEY&lt;/SPAN&gt;';btoxgr='Grade1';TRT01A='LZA';PARAMCD='WBC';cnt=24;output;&lt;BR /&gt;PARCAT3='&lt;SPAN&gt;LIVER AND KIDNEY&lt;/SPAN&gt;';btoxgr='Grade3';TRT01A='LZA';PARAMCD='AST';cnt=11;output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would need a dataset that can take all the rows of&amp;nbsp;&amp;nbsp;all_freqs merged with dum1 in all possible combination i.e. in&amp;nbsp;all_freqs dataset under 1 parmcd we have btoxgr='Grade0' present only, in that case all other grades must be coming for the same paramcd with values 0 in cnt variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tried using the below code, but nor working.&lt;/P&gt;&lt;P&gt;data dummy;&amp;nbsp;&lt;BR /&gt;merge all_freqs(KEEP=parcat3 param paramcd trt01an trt01a btoxgr IN=A) dum1(in=b); */&lt;BR /&gt;BY BTOXGR;if a or b;&amp;nbsp;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any help?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 15:19:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-one-to-many-merge-for-lab-shift-table/m-p/950035#M371552</guid>
      <dc:creator>sitaram</dc:creator>
      <dc:date>2024-11-06T15:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: creating one to many merge- for lab shift table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-one-to-many-merge-for-lab-shift-table/m-p/950038#M371553</link>
      <description>&lt;P&gt;I do not understand what you want the output to look like.&amp;nbsp; Please show what it would look like for the sample data you have provided.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 15:33:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-one-to-many-merge-for-lab-shift-table/m-p/950038#M371553</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2024-11-06T15:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: creating one to many merge- for lab shift table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-one-to-many-merge-for-lab-shift-table/m-p/950045#M371558</link>
      <description>&lt;P&gt;How about a multlabel format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data all_freqs;
PARCAT3='HAEMATOLOGY';btoxgr='Grade0';TRT01A='LZA';PARAMCD='GRAN';cnt=12;output;
PARCAT3='HAEMATOLOGY';btoxgr='Grade2';TRT01A='LZA';PARAMCD='GRAN';cnt=20;output;
PARCAT3='HAEMATOLOGY';btoxgr='Grade1';TRT01A='LZA';PARAMCD='LYMP';cnt=19;output;
PARCAT3='HAEMATOLOGY';btoxgr='Grade2';TRT01A='LZA';PARAMCD='KKSP';cnt=90;output;

PARCAT3='LIVER AND KIDNEY';btoxgr='Grade0';TRT01A='LZA';PARAMCD='PLAT';cnt=12;output;
PARCAT3='LIVER AND KIDNEY';btoxgr='Grade2';TRT01A='LZA';PARAMCD='WBC';cnt=22;output;
PARCAT3='LIVER AND KIDNEY';btoxgr='Grade1';TRT01A='LZA';PARAMCD='WBC';cnt=24;output;
PARCAT3='LIVER AND KIDNEY';btoxgr='Grade3';TRT01A='LZA';PARAMCD='AST';cnt=11;output;
run;
proc sort;
   by parcat3 paramcd trt01a;
   run;

proc format;
   value $txg(notsorted multilabel)
      'Grade0' = 'Grade 0'
      'Grade1' = 'Grade 1'
      'Grade2' = 'Grade 2'
      'Grade3' = 'Grade 3'
      'Grade4' = 'Grade 4'
      'Grade0'-'Grade4' = 'Total'
      ;
   quit;

proc summary data=all_freqs nway missing completetypes;
   by parcat3 paramcd trt01a;
   class btoxgr / mlf order=data preloadfmt;
   format btoxgr $txg.;
   freq cnt;
   output out=summary;
   run;
proc print;
   run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 413px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101993i7C3BE8BA84BEAED1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 16:04:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-one-to-many-merge-for-lab-shift-table/m-p/950045#M371558</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2024-11-06T16:04:11Z</dc:date>
    </item>
  </channel>
</rss>

