<?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 Changing the table alignment? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-table-alignment/m-p/828703#M327359</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm wondering if I could get the Dataout_CNT and Dataout_PCT results from Datain.&amp;nbsp; &amp;nbsp;I tried the proc transpose, my codes didn't work.&amp;nbsp; Maybe I didn't get the correct ones.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dataIN;
   infile datalines dsd;
   input PT_class : $50. Dema  : $100. CNT PCT;
   datalines;
	ED_RSV_Pos,0_Neg5 months,100,20
	ED_RSVH,0_Neg5 months,200,35
	IPT_RSV_Pos,0_Neg5 months,400,30
	IPT_RSV_Neg,0_Neg5 months,1000,45
	ED_RSV_Pos,12_Neg23 months,100,20
	ED_RSV_Neg,12_Neg23 months,200,35
	IPT_RSV_Pos,12_Neg23 months,400,30
	IPT_RSV_Neg,12_Neg23 months,1000,45
	ED_RSV_Pos,6_Neg11 months,100,20
	ED_RSV_Neg,6_Neg11 months,200,35
	IPT_RSV_Pos,6_Neg11 months,400,30
	IPT_RSV_Neg,6_Neg11 months,1000,45
	ED_RSV_Pos,24_Neg59 months,100,20
	ED_RSV_Neg,24_Neg59 months,200,35
	IPT_RSV_Pos,24_Neg59 months,400,30
	IPT_RSV_Neg,24_Neg59 months,1000,45
	ED_RSV_Pos,Female,100,20
	ED_RSV_Neg,Female,200,35
	IPT_RSV_Pos,Female,400,30
	IPT_RSV_Neg,Female,1000,45
	ED_RSV_Pos,Male,100,20
	ED_RSV_Neg,Male,200,35
	IPT_RSV_Pos,Male,400,30
	IPT_RSV_Neg,Male,1000,45
;

Data dataout_CNT;
	infile datalines dsd;
   input Dema : $100.  ED_RSV_Pos  ED_RSV_Neg  IPT_RSV_Pos  IPT_RSV_Neg ;
   datalines;
	0_Neg5 months,100,200,400,1000
	6_Neg11 months,100,200,400,1000
	12_Neg23 months,100,200,400,1000
	24_Neg59 months,100,200,400,1000
	Female,100,200,400,1000
	Male,100,200,400,1000
;

Data dataout_PCT;
	infile datalines dsd;
   input Dema : $100.  ED_RSV_Pos  ED_RSV_Neg  IPT_RSV_Pos  IPT_RSV_Neg ;
   datalines;
	0_Neg5 months,20,35,30,45
	6_Neg11 months,20,35,30,45
	12_Neg23 months,20,35,30,45
	24_Neg59 months,20,35,30,45
	Female,20,35,30,45
	Male,20,35,30,45
;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 15 Aug 2022 15:53:07 GMT</pubDate>
    <dc:creator>ybz12003</dc:creator>
    <dc:date>2022-08-15T15:53:07Z</dc:date>
    <item>
      <title>Changing the table alignment?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-table-alignment/m-p/828703#M327359</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm wondering if I could get the Dataout_CNT and Dataout_PCT results from Datain.&amp;nbsp; &amp;nbsp;I tried the proc transpose, my codes didn't work.&amp;nbsp; Maybe I didn't get the correct ones.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dataIN;
   infile datalines dsd;
   input PT_class : $50. Dema  : $100. CNT PCT;
   datalines;
	ED_RSV_Pos,0_Neg5 months,100,20
	ED_RSVH,0_Neg5 months,200,35
	IPT_RSV_Pos,0_Neg5 months,400,30
	IPT_RSV_Neg,0_Neg5 months,1000,45
	ED_RSV_Pos,12_Neg23 months,100,20
	ED_RSV_Neg,12_Neg23 months,200,35
	IPT_RSV_Pos,12_Neg23 months,400,30
	IPT_RSV_Neg,12_Neg23 months,1000,45
	ED_RSV_Pos,6_Neg11 months,100,20
	ED_RSV_Neg,6_Neg11 months,200,35
	IPT_RSV_Pos,6_Neg11 months,400,30
	IPT_RSV_Neg,6_Neg11 months,1000,45
	ED_RSV_Pos,24_Neg59 months,100,20
	ED_RSV_Neg,24_Neg59 months,200,35
	IPT_RSV_Pos,24_Neg59 months,400,30
	IPT_RSV_Neg,24_Neg59 months,1000,45
	ED_RSV_Pos,Female,100,20
	ED_RSV_Neg,Female,200,35
	IPT_RSV_Pos,Female,400,30
	IPT_RSV_Neg,Female,1000,45
	ED_RSV_Pos,Male,100,20
	ED_RSV_Neg,Male,200,35
	IPT_RSV_Pos,Male,400,30
	IPT_RSV_Neg,Male,1000,45
;

Data dataout_CNT;
	infile datalines dsd;
   input Dema : $100.  ED_RSV_Pos  ED_RSV_Neg  IPT_RSV_Pos  IPT_RSV_Neg ;
   datalines;
	0_Neg5 months,100,200,400,1000
	6_Neg11 months,100,200,400,1000
	12_Neg23 months,100,200,400,1000
	24_Neg59 months,100,200,400,1000
	Female,100,200,400,1000
	Male,100,200,400,1000
;

Data dataout_PCT;
	infile datalines dsd;
   input Dema : $100.  ED_RSV_Pos  ED_RSV_Neg  IPT_RSV_Pos  IPT_RSV_Neg ;
   datalines;
	0_Neg5 months,20,35,30,45
	6_Neg11 months,20,35,30,45
	12_Neg23 months,20,35,30,45
	24_Neg59 months,20,35,30,45
	Female,20,35,30,45
	Male,20,35,30,45
;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Aug 2022 15:53:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-table-alignment/m-p/828703#M327359</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2022-08-15T15:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the table alignment?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-table-alignment/m-p/828709#M327363</link>
      <description>&lt;P&gt;Didn't work is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the "&amp;lt;/&amp;gt;" to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the "&amp;lt;/&amp;gt;" icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't even show what your code looked like. However when you show two different values with the same variable names it would not happen with a single proc transpose.&lt;/P&gt;
&lt;P&gt;Your output does not show what you expect to do with the ED_RSVH values. Were those even considered?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this. If this is sufficient it should be workable pattern for the second set.&lt;/P&gt;
&lt;PRE&gt;proc sort data=datain;
   by dema pt_class;
run;
proc transpose data=datain (where=(Pt_class ne'ED_RSVH'))
   out=dataout_cnt (drop=_name_);
  by dema;
  id PT_class;
  var cnt;
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Aug 2022 16:17:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-table-alignment/m-p/828709#M327363</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-08-15T16:17:57Z</dc:date>
    </item>
  </channel>
</rss>

