SAS Users Group for Institutional Researchers (SUGIR)

Reply
This is an open group. Sign in and click the "Join Group" button to become a group member and start posting.
Highlighted
New Contributor
Posts: 4
Left justify proc tabulate tables in gridded layout

I am working in EG 7.1 with a gridded ods layout where I place one proc tabulate in each region of a 2-column x 2-row grid and I want each table to be left justified within its region. Below is my code and an image of my output. Does anyone know how I can accomplish this?

 

 



/********* SETS NUMBER OF COLUMNS AND ROWS FOR OUTPUT *********/
ods layout gridded rows = 2 columns = 2;

TITLE1 "Withdrawal Dates and Reasons";
FOOTNOTE1 "Where a column does not exist in a table, no withdrawals were recorded for that group during that period.";

/********* ROW 1 OF COLUMN 1 – TELLS WHERE TO PUT THE DATA BELOW IN THE GRID CREATED ABOVE IN THE ODS LAYOUT GRIDDED *********/
ods region row = 1 column = 1;

PROC TABULATE
DATA=WORK.APPEND_WD_WEEK_NO_SP16
	
	;
	
	WHERE WEEKS='01-04';
	VAR COUNT;
	CLASS CATEGORY /	ORDER=UNFORMATTED MISSING;
	CLASS REASON /	ORDER=UNFORMATTED MISSING;
	TABLE 
		/* ROW Statement */
		REASON 
		all = 'Total'  ,
		/* COLUMN Statement */
		CATEGORY={LABEL="2016SP, Weeks 1-4"}  *(COUNT={LABEL=""} * Sum={LABEL="N"} COUNT={LABEL=""} * ColPctSum={LABEL="COL %"} ) 		;
FORMAT REASON $REASON. CATEGORY CATEGORY.;
	;

RUN;
RUN; QUIT;

/********* ROW 1 OF COLUMN 2 – TELLS WHERE TO PUT THE DATA BELOW IN THE GRID CREATED ABOVE IN THE ODS LAYOUT GRIDDED *********/

ods region row = 1 column = 2;

PROC TABULATE
DATA=WORK.APPEND_WD_WEEK_NO_SP16
	
	;
	
	WHERE WEEKS='05-08';
	VAR COUNT;
	CLASS CATEGORY /	ORDER=UNFORMATTED MISSING;
	CLASS REASON /	ORDER=UNFORMATTED MISSING;
	TABLE 
		/* ROW Statement */
		REASON 
		all = 'Total'  ,
		/* COLUMN Statement */
		CATEGORY={LABEL="2016SP, Weeks 5-8"}  *(COUNT={LABEL=""} * Sum={LABEL="N"} COUNT={LABEL=""} * ColPctSum={LABEL="COL %"} ) 		;
FORMAT REASON $REASON. CATEGORY CATEGORY.;
	;

RUN;
RUN; QUIT;

/********* ROW 2 OF COLUMN 1 – TELLS WHERE TO PUT THE DATA BELOW IN THE GRID CREATED ABOVE IN THE ODS LAYOUT GRIDDED *********/

ods region row = 2 column = 1;

PROC TABULATE
DATA=WORK.APPEND_WD_WEEK_NO_SP16
	
	;
	
	WHERE WEEKS='09-12';
	VAR COUNT;
	CLASS CATEGORY /	ORDER=UNFORMATTED MISSING;
	CLASS REASON /	ORDER=UNFORMATTED MISSING;
	TABLE 
		/* ROW Statement */
		REASON 
		all = 'Total'  ,
		/* COLUMN Statement */
		CATEGORY={LABEL="2016SP, Weeks 9-12"}  *(COUNT={LABEL=""} * Sum={LABEL="N"} COUNT={LABEL=""} * ColPctSum={LABEL="COL %"} ) 		;
FORMAT REASON $REASON. CATEGORY CATEGORY.;
	;

RUN;
RUN; QUIT;

/********* ROW 2 OF COLUMN 2 – TELLS WHERE TO PUT THE DATA BELOW IN THE GRID CREATED ABOVE IN THE ODS LAYOUT GRIDDED *********/

ods region row = 2 column = 2;

PROC TABULATE
DATA=WORK.APPEND_WD_WEEK_NO_SP16
	
	;
	
	WHERE WEEKS='13-16';
	VAR COUNT;
	CLASS CATEGORY /	ORDER=UNFORMATTED MISSING;
	CLASS REASON /	ORDER=UNFORMATTED MISSING;
	TABLE 
		/* ROW Statement */
		REASON 
		all = 'Total'  ,
		/* COLUMN Statement */
		CATEGORY={LABEL="2016SP, Weeks 13-16"}  *(COUNT={LABEL=""} * Sum={LABEL="N"} COUNT={LABEL=""} * ColPctSum={LABEL="COL %"} ) 		;
FORMAT REASON $REASON. CATEGORY CATEGORY.;
	;

RUN;
RUN; QUIT;

ODS LAYOUT END; ODS PDF CLOSE;

grid.JPG

 

Thanks,

 

Jeff Martin-Moreno