<?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 Columns values within column in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Columns-values-within-column/m-p/47935#M6232</link>
    <description>data outst_amt;&lt;BR /&gt;
 input prd_cat : $25. cus_cat &amp;amp; $20. Date_values &amp;amp; $20. Out_amount ;&lt;BR /&gt;
datalines;&lt;BR /&gt;
Hire-Purchase	Business-banking	25thaug2010	234&lt;BR /&gt;
Housing-Loans	Consumer-banking	26-Aug-2010	243&lt;BR /&gt;
Credit-card  	Business-banking	26-Aug-2010	342&lt;BR /&gt;
Personal-Loan	Consumer-banking	25-Aug-2010	456&lt;BR /&gt;
Co-op-Personal-Loan	Business-banking	27-Aug-2010	356&lt;BR /&gt;
Share-Margin-Financing	Consumer-banking	28-Aug-2010	123&lt;BR /&gt;
Revolving-Credits	Business-banking	25-Aug-2010	213	&lt;BR /&gt;
Syndicated-Loans	Consumer-banking	24-Aug-2010	432&lt;BR /&gt;
Trade-Financing		Business-banking	29-Aug-2010	124&lt;BR /&gt;
Term-Loans	Consumer-banking	31-Aug-2010	145	&lt;BR /&gt;
Overdraft	Business-banking	25-Aug-2010	234&lt;BR /&gt;
Other-loans	Consumer-banking	26-Aug-2010	187&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I want the output as follows:&lt;BR /&gt;
&lt;BR /&gt;
  Item Descriptions			        ------Date values-------                                 	          25-Aug  26-Aug   27-aug 	28-Aug		                                                                                     	&lt;BR /&gt;
A.Loans by Business Segment&lt;BR /&gt;
  Business banking		314		345&lt;BR /&gt;
  Consumer banking		234				213&lt;BR /&gt;
  Total Gross Loans&lt;BR /&gt;
&lt;BR /&gt;
B.Gross Loans by Products&lt;BR /&gt;
  Hire Purchase			367		276&lt;BR /&gt;
  Housing Loans	                                               342&lt;BR /&gt;
  Credit card&lt;BR /&gt;
  Personal Loan					243&lt;BR /&gt;
  Co-op Personal Loan&lt;BR /&gt;
  Share Margin Financing		234		567 &lt;BR /&gt;
  Revolving Credits	                                                  546&lt;BR /&gt;
  Syndicated Loans&lt;BR /&gt;
  Trade Financing&lt;BR /&gt;
  Term Loans&lt;BR /&gt;
  Overdraft		345		657		546&lt;BR /&gt;
  Other loans&lt;BR /&gt;
  Total Gross Loans&lt;BR /&gt;
  &lt;BR /&gt;
  Can anyone help me on this, as I was strucked from morning onwards.&lt;BR /&gt;
Thanks in advance</description>
    <pubDate>Fri, 10 Dec 2010 15:28:40 GMT</pubDate>
    <dc:creator>Siddhartha</dc:creator>
    <dc:date>2010-12-10T15:28:40Z</dc:date>
    <item>
      <title>Columns values within column</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Columns-values-within-column/m-p/47935#M6232</link>
      <description>data outst_amt;&lt;BR /&gt;
 input prd_cat : $25. cus_cat &amp;amp; $20. Date_values &amp;amp; $20. Out_amount ;&lt;BR /&gt;
datalines;&lt;BR /&gt;
Hire-Purchase	Business-banking	25thaug2010	234&lt;BR /&gt;
Housing-Loans	Consumer-banking	26-Aug-2010	243&lt;BR /&gt;
Credit-card  	Business-banking	26-Aug-2010	342&lt;BR /&gt;
Personal-Loan	Consumer-banking	25-Aug-2010	456&lt;BR /&gt;
Co-op-Personal-Loan	Business-banking	27-Aug-2010	356&lt;BR /&gt;
Share-Margin-Financing	Consumer-banking	28-Aug-2010	123&lt;BR /&gt;
Revolving-Credits	Business-banking	25-Aug-2010	213	&lt;BR /&gt;
Syndicated-Loans	Consumer-banking	24-Aug-2010	432&lt;BR /&gt;
Trade-Financing		Business-banking	29-Aug-2010	124&lt;BR /&gt;
Term-Loans	Consumer-banking	31-Aug-2010	145	&lt;BR /&gt;
Overdraft	Business-banking	25-Aug-2010	234&lt;BR /&gt;
Other-loans	Consumer-banking	26-Aug-2010	187&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I want the output as follows:&lt;BR /&gt;
&lt;BR /&gt;
  Item Descriptions			        ------Date values-------                                 	          25-Aug  26-Aug   27-aug 	28-Aug		                                                                                     	&lt;BR /&gt;
A.Loans by Business Segment&lt;BR /&gt;
  Business banking		314		345&lt;BR /&gt;
  Consumer banking		234				213&lt;BR /&gt;
  Total Gross Loans&lt;BR /&gt;
&lt;BR /&gt;
B.Gross Loans by Products&lt;BR /&gt;
  Hire Purchase			367		276&lt;BR /&gt;
  Housing Loans	                                               342&lt;BR /&gt;
  Credit card&lt;BR /&gt;
  Personal Loan					243&lt;BR /&gt;
  Co-op Personal Loan&lt;BR /&gt;
  Share Margin Financing		234		567 &lt;BR /&gt;
  Revolving Credits	                                                  546&lt;BR /&gt;
  Syndicated Loans&lt;BR /&gt;
  Trade Financing&lt;BR /&gt;
  Term Loans&lt;BR /&gt;
  Overdraft		345		657		546&lt;BR /&gt;
  Other loans&lt;BR /&gt;
  Total Gross Loans&lt;BR /&gt;
  &lt;BR /&gt;
  Can anyone help me on this, as I was strucked from morning onwards.&lt;BR /&gt;
Thanks in advance</description>
      <pubDate>Fri, 10 Dec 2010 15:28:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Columns-values-within-column/m-p/47935#M6232</guid>
      <dc:creator>Siddhartha</dc:creator>
      <dc:date>2010-12-10T15:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Columns values within column</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Columns-values-within-column/m-p/47936#M6233</link>
      <description>Hi:&lt;BR /&gt;
  Again, I see that you have posted this same question in the SAS Procedures forum. &lt;A href="http://support.sas.com/forums/message.jspa?messageID=47222#47222" target="_blank"&gt;http://support.sas.com/forums/message.jspa?messageID=47222#47222&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
If this question is about reporting (and it seems that it is), then it would be easier for everyone to only track the question(s) and answers in one forum. Pick a forum for your question, one forum is best.&lt;BR /&gt;
 &lt;BR /&gt;
It seems that you want some report output (as opposed to dataset output) so you might want to just leave this question in the ODS and Reporting forum.&lt;BR /&gt;
 &lt;BR /&gt;
Is this question at all related to your two previous questions:&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/message.jspa?messageID=47176#47176" target="_blank"&gt;http://support.sas.com/forums/message.jspa?messageID=47176#47176&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/message.jspa?messageID=47143#47143" target="_blank"&gt;http://support.sas.com/forums/message.jspa?messageID=47143#47143&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
The only difference that I see between this output and some of your previous output is that now, your desired output shows the dates going along the top of the report -- this is the type of report that you might be able to generate with PROC TABULATE. &lt;BR /&gt;
&lt;BR /&gt;
However, I don't see the "A. Loans by Busienss Segment" and "B. Gross Loans by Product" in your data -- so to me this seems like another reason to use PROC REPORT with a COMPUTE BLOCK and a LINE statement to write customized headers. A simple modification of one of the programs that's already been posted in your other forum would allow you to write a custom header before a group. Or, you could use PROC TABULATE with custom BOX labels to put these "extra" report headers.  Since I already posted a PROC REPORT program for you, I am posting a TABULATE program to help you get started.&lt;BR /&gt;
 &lt;BR /&gt;
This actually looks like 2 different summaries...the top of your desired report looks like a summary of the CUS_CAT variable and the bottom half of your desired reports looks like a summary of the PRD_CAT variable.&lt;BR /&gt;
 &lt;BR /&gt;
Perhaps it is time to take a step back and learn a bit more about SAS reporting procedures like PROC REPORT and PROC TABULATE in order for you to figure out which one of these would give you the desired result. If you search the forums, you will find a lot of previous postings with links to user-group papers about the use of PROC REPORT and PROC TABULATE. Perhaps those will get you started.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
data outst_amt;&lt;BR /&gt;
  length prd_cat $25 cus_cat $20 ;&lt;BR /&gt;
  infile datalines dsd dlm=',';&lt;BR /&gt;
input prd_cat $ cus_cat $ Date_values : anydtdte. Out_amount ;&lt;BR /&gt;
return;&lt;BR /&gt;
datalines;&lt;BR /&gt;
"Hire Purchase","Business banking","25-aug-2010",234&lt;BR /&gt;
"Housing Loans","Consumer banking","26-aug-2010",243&lt;BR /&gt;
"Credit card","Business banking","26-aug-2010",342&lt;BR /&gt;
"Personal Loan","Consumer banking","25-aug-2010",456&lt;BR /&gt;
"Co-op Personal Loan","Business banking","27-aug-2010",356&lt;BR /&gt;
"Share Margin Financing","Consumer banking","28-aug-2010",123&lt;BR /&gt;
"Revolving Credits","Business banking","25-aug-2010",213&lt;BR /&gt;
"Syndicated Loans","Consumer banking","24-aug-2010",432&lt;BR /&gt;
"Trade Financing","Business banking","29-aug-2010",124&lt;BR /&gt;
"Term Loans","Consumer banking","31-aug-2010",145&lt;BR /&gt;
"Overdraft","Business banking","25-aug-2010",234&lt;BR /&gt;
"Other loans","Consumer banking","26-aug-2010",187&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
                                        &lt;BR /&gt;
ods listing;&lt;BR /&gt;
proc print data=outst_amt;&lt;BR /&gt;
  title 'what does data look like';&lt;BR /&gt;
  format date_values date6.;&lt;BR /&gt;
run;&lt;BR /&gt;
                               &lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file='c:\temp\two_tables.html' style=sasweb;&lt;BR /&gt;
                                &lt;BR /&gt;
options missing = 0;&lt;BR /&gt;
proc tabulate data=outst_amt;&lt;BR /&gt;
  class date_values / order=internal;&lt;BR /&gt;
  class prd_cat cus_cat / order=data;&lt;BR /&gt;
  var out_amount;&lt;BR /&gt;
  table cus_cat all='Total Gross Loans',&lt;BR /&gt;
        date_values*out_amount=' '*sum /&lt;BR /&gt;
        box='A. Loans by Business Segment';&lt;BR /&gt;
                                     &lt;BR /&gt;
  table prd_cat all='Total Gross Loans',&lt;BR /&gt;
        date_values*out_amount=' '*sum /&lt;BR /&gt;
        box='B. Gross Loans by Product';&lt;BR /&gt;
                         &lt;BR /&gt;
  format date_values date6.;&lt;BR /&gt;
  label prd_cat='Item Descriptions'&lt;BR /&gt;
        cus_cat='Item Descriptions'&lt;BR /&gt;
        date_values='Date Values';&lt;BR /&gt;
  keylabel sum=' ';&lt;BR /&gt;
run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Fri, 10 Dec 2010 16:36:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Columns-values-within-column/m-p/47936#M6233</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-12-10T16:36:53Z</dc:date>
    </item>
  </channel>
</rss>

