I agree with Scott that generally, you would do this type of report with ACROSS usage for your MONTH variable. However something about your statement is confusing. You said:
Here Type Transaction and Month are headers...All the remaining are Column names.
Are you really saying that X, Y and Z are column NAMES -- or are they VALUES for TYPE?????? Are JAN, FEB, MAR, etc column NAMES or are they VALUES for MONTH -- so that every unique value for MONTH is a separate column on the report????
Here's a concrete example. SASHELP.PRDSALE has 2 years of data for 1993 and 1994. There is a variable called MONTH that is a SAS date variable formatted with the MONNAME3. format. Other variables or columns are COUNTRY (with 3 possible values -- U.S.A., CANADA and GERMANY), REGION (with 2 possible values (EAST and WEST) and DIVISION (with 2 possible values CONSUMER and EDUCATION).
Every observation in the file represents information on ACTUAL and PREDICTED sales for one COUNTRY/REGION/DIVISION/YEAR/MONTH, as shown below (only 10 obs are shown and MONTH is formatted with DATE9 for this list of observations):
COUNTRY REGION DIVISION YEAR MONTH ACTUAL PREDICT
CANADA EAST EDUCATION 1994 01JAN1994 $107.00 $190.00
CANADA EAST EDUCATION 1994 01JAN1994 $267.00 $410.00
CANADA EAST EDUCATION 1994 01JAN1994 $355.00 $497.00
CANADA EAST EDUCATION 1994 01JAN1994 $877.00 $795.00
CANADA EAST EDUCATION 1994 01JAN1994 $942.00 $672.00
CANADA EAST CONSUMER 1994 01JAN1994 $944.00 $965.00
CANADA EAST CONSUMER 1994 01JAN1994 $312.00 $919.00
CANADA EAST CONSUMER 1994 01JAN1994 $585.00 $12.00
CANADA EAST CONSUMER 1994 01JAN1994 $641.00 $425.00
CANADA EAST CONSUMER 1994 01JAN1994 $689.00 $523.00
If you want to create a report with the months for 1994 going across the top of the report -- so there is a unique column for every month, then the following code will accomplish that task -- shows the ACTUAL sales total for every month.
** make a subset for 1994 only;
proc sort data=sashelp.prdsale out=prdsale;
by year month;
where year = 1994;
** create a report with ACROSS usage for MONTH variable;
ods listing close;
ods html file='c:\temp\show_across.html' style=sasweb;
proc report data=prdsale nowd;
title 'Actual Sales by Month in 1994';
column country region division actual,month;
define country / group;
define region / group;
define division / group;
define month / across order=internal f=monname3.;
define actual / sum ' ';
rbreak after / summarize;
ods html close;
The syntax construction ACTUAL,MONTH tells PROC REPORT to use the value of the ACTUAL variable for each month's numbers. If you wanted to get a count of observations for each month, then you would only need to remove the DEFINE statement for ACTUAL from the PROC REPORT code and change the COLUMN statement to:
column country region division month;
Whether you show the values for ACTUAL or get just a COUNT (the N statistic), listing these variables from left to right: COUNTRY REGION DIVISION and giving them all a usage of GROUP tells PROC REPORT that COUNTRY will be the left-most column and unique values for REGION will be nested inside each value of COUNTRY and unique values for DIVISION will be nested inside REGION. A usage of GROUP also "collapses" or summarizes observations. So each report row will represent the summary numbers for CANADA, EAST, CONSUMER and then CANADA, EAST, EDUCATION, etc -- so that even if there were 1000 observations for the unique combination of COUNTRY=CANADA, REGION=EAST, and DIVISION=CONSUMER, those 1000 observations would get summarized down to one report row. (and the same would be true for every unique combination of COUTNRY, REGION and DIVISION).
Perhaps this will give you an idea of how PROC REPORT can create a summary report with every value for a variable being to create a report column.