<?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: how to merge formats to dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-merge-formats-to-dataset/m-p/418431#M102781</link>
    <description>&lt;P&gt;First off post test data using a code window - its the {i} above the post area.&lt;/P&gt;
&lt;P&gt;Secondly, there doesn't seem to be anything in common between the two data you provided - aval/c is not in main, and none of main is in anl2.&lt;/P&gt;
&lt;P&gt;Thirdly, are you creating SDTM or ADaM here?&amp;nbsp; If it is ADaM then the code value should come in from SDTM as text, then in ADaM you can also have a numeric.&amp;nbsp; If its SDTM, then yes you would have a text codelist.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Dec 2017 11:07:12 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-12-05T11:07:12Z</dc:date>
    <item>
      <title>how to merge formats to dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-merge-formats-to-dataset/m-p/418429#M102780</link>
      <description>&lt;P&gt;I have 2 datasets one with format which has char and numeric values and other main dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I waant to make the numeric value to character in main dataset and use the sorting of formatted nueric value in anl2 as sort variable to get the sort. Tried many ways bit could nt figure out. Any help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;attached 2 test datasets.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 10:34:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-merge-formats-to-dataset/m-p/418429#M102780</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2017-12-05T10:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to merge formats to dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-merge-formats-to-dataset/m-p/418431#M102781</link>
      <description>&lt;P&gt;First off post test data using a code window - its the {i} above the post area.&lt;/P&gt;
&lt;P&gt;Secondly, there doesn't seem to be anything in common between the two data you provided - aval/c is not in main, and none of main is in anl2.&lt;/P&gt;
&lt;P&gt;Thirdly, are you creating SDTM or ADaM here?&amp;nbsp; If it is ADaM then the code value should come in from SDTM as text, then in ADaM you can also have a numeric.&amp;nbsp; If its SDTM, then yes you would have a text codelist.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 11:07:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-merge-formats-to-dataset/m-p/418431#M102781</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-12-05T11:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to merge formats to dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-merge-formats-to-dataset/m-p/418435#M102782</link>
      <description>&lt;P&gt;To create a format from anl2, do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WORK.ANL2;
  infile datalines dsd truncover;
  input AVALC:$200. AVAL:32.;
datalines4;
Adverse event,1
Lack of efficacy,2
Non-compliance with IMP,3
Protocol violation,4
Withdrawal of consent,5
Lost to follow-up,6
Did not fulfill inclusion criteria for Period B,7
Other,8
;;;;
run;

data cntlin;
set anl2 (rename=(aval=start avalc=label));
fmtname = 'aval';
type = 'n';
run;

proc format library=work cntlin=cntlin;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can now apply that format like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format primreas aval.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or create a new variable&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;primreasc = put(primreas,aval.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Dec 2017 11:26:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-merge-formats-to-dataset/m-p/418435#M102782</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-12-05T11:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to merge formats to dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-merge-formats-to-dataset/m-p/418436#M102783</link>
      <description>&lt;P&gt;Hi Kurt,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In fact i did that but i need the order to be as it is in aval. for that i need to make a sort variable to sort but unfortunately i dont have any common observation to merge.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 11:28:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-merge-formats-to-dataset/m-p/418436#M102783</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2017-12-05T11:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to merge formats to dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-merge-formats-to-dataset/m-p/418437#M102784</link>
      <description>&lt;P&gt;Applying the format to primreas will not change the order of a proc sort. Procedures that can order by formatted values usually have options to suppress this.&lt;/P&gt;
&lt;P&gt;Or you create a new variable and leave primreas itself untouched.&lt;/P&gt;
&lt;P&gt;No merge is needed to apply a format.&lt;/P&gt;
&lt;P&gt;If you still have problems, supply an example for the expected result, based on your example data.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 11:32:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-merge-formats-to-dataset/m-p/418437#M102784</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-12-05T11:32:17Z</dc:date>
    </item>
  </channel>
</rss>

