Custom Tables Macro

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Custom Tables Macro

Jason Schoeneberger

Hi All,

 

I was able to adapt the Custom Tables code I found in the archives for my use.  However I get a Warning message each time I run the code, though it accurately generates the table I want.  I’ve tried editing the syntax to keep the Warning from happening, but to no avail.  Here’s my code:

 

**SCHOOL PROBLEMS.

DEFINE !prob(row=!CHAREND('/') /col=!CMDEND)

 

**APPLY APPROPRIATE VALUE LABELS.

TEMPORARY.

VALUE LABELS Q5A 4 'Serious Problem' 3 'Moderate Problem' 2 'Minor Problem' 1 'Not a Problem At All'.

CTABLES  

 /VLABELS VARIABLES= !row DISPLAY=DEFAULT 

 /TABLE !HEAD(!row) !DO !v !IN (!TAIL(!row)) [COUNT 'n' F40.0, ROWPCT.COUNT '%' PCT40.1] + !v [COUNT 'n' F40.0, ROWPCT.COUNT '%' PCT40.1] !DOEND 

 /CLABELS ROWLABELS=OPPOSITE

 /CATEGORIES VARIABLES= !row  ORDER=A KEY=VALUE EMPTY=EXCLUDE. 

!ENDDEFINE.

 

!prob row=Q5A Q5B Q5C Q5D Q5E Q5F Q5G.

 

The warning states that the COUNT and ROWPCT.COUNT is used more than once.  If I remove the second set of brackets, the count and percentages are displayed for only one variable.  Can anyone help?

 

Thanks,

 

Jason