LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2005)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 13 Sep 2005 13:00:36 -0400
Reply-To:     "Conor, R." <surveys@SCU.EDU>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         "Conor, R." <surveys@SCU.EDU>
Subject:      MACRO:using DO index as a value specification in ctables

Hi All,

When I run the macro below with a numeric value, e.g. 1 in the syntax: /CATEGORIES VARIABLES=Degree_received_from [n] EMPTY=INCLUDE instead of n, the macro performs as expected. However, I want to cycle ctables through a range of values indexed by the DO command, i.e. n=1,then n=2, then n=3... When I substitute any type of variable in place of the value, e.g. as written, there is an error & the macro terminates: CATEGORIES: Text n. An invalid subcommand, keyword, or option was specified.

Any solution or work around? Thx.

DEFINE !DEPT_RPT() !DO !CNT=1 !TO 30 compute n=!CNT. CTABLES /VLABELS VARIABLES=department Degree_received_from Current_Status 60 DISPLAY=DEFAULT /TABLE Current_Status BY department [COUNT F40.0, COLPCT.COUNT PCT40.1] + Degree_received_from [COUNT F40.0, COLPCT.COUNT PCT40.1] /CATEGORIES VARIABLES=department [2] EMPTY=INCLUDE /CATEGORIES VARIABLES=Degree_received_from [n] EMPTY=INCLUDE /CATEGORIES VARIABLES=Current_Status ORDER=A KEY=VALUE EMPTY=INCLUDE TOTAL=YES POSITION=AFTER MISSING=EXCLUDE. !DOEND !ENDDEFINE.


Back to: Top of message | Previous page | Main SPSSX-L page