<?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 3 datasets with different data formats in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451837#M113991</link>
    <description>&lt;P&gt;Thanks so much for the response&lt;/P&gt;</description>
    <pubDate>Fri, 06 Apr 2018 11:52:16 GMT</pubDate>
    <dc:creator>Dinkepile</dc:creator>
    <dc:date>2018-04-06T11:52:16Z</dc:date>
    <item>
      <title>Merging 3 datasets with different data formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451813#M113978</link>
      <description>&lt;P&gt;Good day&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to merge the following datasets, what is the easiest way to end up having the final output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;Table 1:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Identity&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;GRADE&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;KEY&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;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&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;T3&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Mild&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;T3&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Moderate&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;T3&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Severe&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;T3&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 09:41:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451813#M113978</guid>
      <dc:creator>Dinkepile</dc:creator>
      <dc:date>2018-04-06T09:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Merging 3 datasets with different data formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451814#M113979</link>
      <description>&lt;P&gt;Post test data in the form of a datastep.&amp;nbsp; I can't tell from what is posted what the datatypes are, is GR in the second numeric?&amp;nbsp; Also you say you want to merge these - but have not provided a join mechanism and from the text it looks like you want to set them together one under the other?&amp;nbsp; If so:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table want as
  select identity,
         grade,
         key
  from   table1
  union all
  select id as identity,
         case when gr=0 then "None"
              when gr=1 then "Mild"
              when gr=2 then moderate
              else "Severe" end as grade,
         key
  from   table2
  union all
  select uid as identity,
         case when grad="0(None)" then "None"
              when grad=....  end as grade,   /* Note I haven't type them all out, expand! */ 
         key
  from   table3;
quit;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Apr 2018 10:04:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451814#M113979</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-04-06T10:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Merging 3 datasets with different data formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451828#M113984</link>
      <description>&lt;P&gt;I would lean toward a DATA step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set table_1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;table_2 (rename=(id=identity gr=grade))&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;table_3 (rename=(uid=identity grad=grade));&lt;/P&gt;
&lt;P&gt;if grade =: '0' then grade='None';&lt;/P&gt;
&lt;P&gt;else if grade =: '1' then grade='Mild';&lt;/P&gt;
&lt;P&gt;else if grade =: '2' then grade='Moderate';&lt;/P&gt;
&lt;P&gt;else if grade =: '3' then grade='Severe';&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Being able to use =: makes the coding a little simpler.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 11:28:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451828#M113984</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-04-06T11:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Merging 3 datasets with different data formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451829#M113985</link>
      <description>&lt;P&gt;Thank you for the response. Mind explaining the function of equal sign with ':' ?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 11:35:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451829#M113985</guid>
      <dc:creator>Dinkepile</dc:creator>
      <dc:date>2018-04-06T11:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Merging 3 datasets with different data formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451830#M113986</link>
      <description>&lt;P&gt;I wanted to set them together. Thank you for the response it will assist.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 11:37:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451830#M113986</guid>
      <dc:creator>Dinkepile</dc:creator>
      <dc:date>2018-04-06T11:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Merging 3 datasets with different data formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451831#M113987</link>
      <description>&lt;P&gt;The colon can follow any character comparison (not just an equal sign).&amp;nbsp; It addresses what should happen when the two character strings being compared have different lengths.&amp;nbsp; The normal action (without a colon) is to pad the shorter string with blanks so that the two strings have equal length before making the comparison.&amp;nbsp; The colon reverses that:&amp;nbsp; truncate the longer string down to the length of the shorter string before making the comparison.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 11:40:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451831#M113987</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-04-06T11:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: Merging 3 datasets with different data formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451832#M113988</link>
      <description>&lt;P&gt;I created an example based on the datasets I am working on in a project, I haven't merged the datasets on the post per se they are used as an example based on what I have in the current project working on.&lt;/P&gt;&lt;P&gt;I used a datastep in my project&amp;nbsp;and renamed the columns then used DO LOOPS and ARRAYS for formatting the values. Below is one of the statements I have in my datastep:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;array Grad{5} $40 ('1' '2' '3' '4' '5');&lt;BR /&gt;&amp;nbsp; array Tgrad{5} $40 ('GRADE 1 (MILD)' 'GRADE 2 (MODERATE)' 'GRADE 3 (SEVERE)' 'GRADE 4 (LIFE-THREATENING)' 'GRADE 5 (DEATH)');&lt;BR /&gt;&amp;nbsp; array GR{5} $40 ('GRADE I (MILD)' 'GRADE II (MODERATE)' 'GRADE III (SEVERE)' 'GRADE IV (POTENTIALLY LIFE-THREATENING)' 'GRADE V (DEATH)');&lt;/P&gt;&lt;P&gt;&amp;nbsp; If AESEV in ('1', '2','3','4','GRADE 1 (MILD)', 'GRADE 2 (MODERATE)' ,'GRADE 3 (SEVERE)' ,'GRADE 4 (LIFE-THREATENING)', 'GRADE 5 (DEATH)') then do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to 5;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *Creating numeric fields;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if AESEV = Grad[i] then AESEVC = GR[i];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ELSE if AESEV = Tgrad[i] then AESEVC = GR[i];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;IF AESEV in ('1', '2','3','4') THEN AESEVCN = input(AESEV,best12.);&lt;BR /&gt;&amp;nbsp; End;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 11:47:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451832#M113988</guid>
      <dc:creator>Dinkepile</dc:creator>
      <dc:date>2018-04-06T11:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Merging 3 datasets with different data formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451837#M113991</link>
      <description>&lt;P&gt;Thanks so much for the response&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 11:52:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451837#M113991</guid>
      <dc:creator>Dinkepile</dc:creator>
      <dc:date>2018-04-06T11:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Merging 3 datasets with different data formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451934#M114018</link>
      <description>&lt;P&gt;If the purpose is to display a specific text value for a given numeric value then a common method in SAS is to create a custom display format.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
value react
0 = 'None'
1 = 'Mild'
2 = 'Moderate'
3 = 'Severe'
;
run;

data example;
   do x= 0 to 3;
   output;
   end;
run;
proc print data=example;
format x react.;
run;
&lt;/PRE&gt;
&lt;P&gt;Formats have a couple of advantages over merging data for lookups. First once the format is available it can be applied to multiple variables that have the same code meanings. See:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data example2;
   do x= 0 to 3;
      do y = 1 to 3;
         output;
      end;
   end;
run;
proc print data=example2;
format x y react.;
run;&lt;/PRE&gt;
&lt;P&gt;Another example is that a change in format can create a different grouping for analysis. Suppose you want to get counts of None vs Some reaction (one interpretation of the mild/moderate/severe)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
value reactnone
0='None'
other='Some'
;
run;
proc freq data=example2;
   tables x*y /nocol norow nopercent;
   format x y reactnone.;
run;&lt;/PRE&gt;
&lt;P&gt;Which completely avoids another merge step and/or adding new variables everytime you want look at different combinations of the values. Minor caution: other in the Proc format code will assing missing to 'Some', if you have missing data it is usually a good idea to consider a specific assignment with formats.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The information in your first two tables could be combined to create a data set that can be read by proc format with the cntlin option.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 15:07:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/451934#M114018</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-04-06T15:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Merging 3 datasets with different data formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/452454#M114189</link>
      <description>&lt;P&gt;Thank you so much&lt;/P&gt;</description>
      <pubDate>Mon, 09 Apr 2018 10:05:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/452454#M114189</guid>
      <dc:creator>Dinkepile</dc:creator>
      <dc:date>2018-04-09T10:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: Merging 3 datasets with different data formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/453575#M114637</link>
      <description>&lt;P&gt;It is good practice to mark the person who posted the correct answer as the correct answer, not your own response.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 14:42:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/453575#M114637</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-04-12T14:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: Merging 3 datasets with different data formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/453581#M114640</link>
      <description>&lt;P&gt;Good day&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see what you mean, I actually thought I mark on the responder. Can I edit this to mark correct one?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 14:46:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/453581#M114640</guid>
      <dc:creator>Dinkepile</dc:creator>
      <dc:date>2018-04-12T14:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Merging 3 datasets with different data formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/453585#M114641</link>
      <description>&lt;P&gt;No probs, I see you got it.&amp;nbsp; Just keeps the answer up with the question that way, and of course rewards the poster.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 14:49:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/453585#M114641</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-04-12T14:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Merging 3 datasets with different data formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/453586#M114642</link>
      <description>&lt;P&gt;&amp;nbsp;Thanks for highlighting, it helps, I am new in the community :). I rectified it.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 14:50:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-with-different-data-formats/m-p/453586#M114642</guid>
      <dc:creator>Dinkepile</dc:creator>
      <dc:date>2018-04-12T14:50:01Z</dc:date>
    </item>
  </channel>
</rss>

