Date: Tue, 19 Sep 2006 21:43:31 +0200
Reply-To: =?us-ascii?Q?Jerabek=20Jindrich?= <JindraJerabek@seznam.cz>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: =?us-ascii?Q?Jerabek=20Jindrich?= <JindraJerabek@seznam.cz>
Subject: =?us-ascii?Q?Re=3AProblems=20with=20CTABLES=20Macros?=
In-Reply-To: <ff4054b20609191056h314e97e9v7b3112919adf3e4c@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-2"; format=flowed
Hello Carlos,
Im affraid your macro definition is not correct - it produced error >A macro expression includes an operator which is syntactically correct but which has not yet been implemented in the macro language. But maybe that is due to my older SPSS version (12) and now is already right.
This is the part of macro:
!DO !V !IN ((!VariaveisNum) + !V) !DOEND (see DEFINE command syntax at your version SPSS help).
There is also a diret... parameter specified but not used in macro what I suspect is wrong.
Not easy to recognize what you wish to do, in case you wont to make the same tables with variable V1 then V2 and V3 the following could work:
DEFINE GeraEstatisticasNumericas (VariaveisNum=!CMDEND)
!DO !V !IN ((!VariaveisNum) )
CTABLES
/VLABELS VARIABLES=BASE VALOR_HIPOTECA_ALIENACAO TEMPO_ATIVIDADE
TEMPO_ATIVIDADE_EMP DISPLAY=DEFAULT
/TABLE !V [S][MEAN, MEDIAN, RANGE, STDDEV] BY BASE [C]
/CATEGORIES VARIABLES=BASE ORDER=A KEY=VALUE EMPTY=EXCLUDE.
!DOEND
!ENDDEFINE.
GeraEstatisticasNumericas VariaveisNum= V1 V2 V3 .
Finaly pls allow me to remind of the command SET mprint=on which can help a lot with macro debugging.
HTH
Jindra
> ------------ Původní zpráva ------------
> Od: Carlos Renato <renato.stat@gmail.com>
> Předmět: Problems with CTABLES Macros
> Datum: 19.9.2006 19:56:48
> ----------------------------------------
> Dear friends of List
>
> I want to make a MACRO that receives a list from variables and after
> that makes the CTABLES.
> For example: (Three variables V1, v2 and V3). The variable BASE is no
> modified.
>
> The paste syntax make:
>
> * Custom Tables.
> CTABLES
> /VLABELS VARIABLES=BASE VALOR_HIPOTECA_ALIENACAO TEMPO_ATIVIDADE
> TEMPO_ATIVIDADE_EMP DISPLAY=DEFAULT
> /TABLE V1 [S][MEAN, MEDIAN, RANGE, STDDEV] + V2 [S][MEAN, MEDIAN, RANGE,
> STDDEV] +
> V3 [S][MEAN, MEDIAN, RANGE, STDDEV] BY BASE [C]
> /CATEGORIES VARIABLES=BASE ORDER=A KEY=VALUE EMPTY=EXCLUDE.
> I am trying using this:
>
> DEFINE NomesVariaveisNumericas()
> V1
> V2
> V3
> !ENDDEFINE.
>
> DEFINE GeraEstatisticasNumericas (DiretorioAnalise=!TOKENS(1) /
> VariaveisNum=!CMDEND)
> CTABLES
> /VLABELS VARIABLES= Base !VariaveisNum
> DISPLAY=DEFAULT
> /TABLE
> !DO !V !IN ((!VariaveisNum) + !V) !DOEND [S][MEAN 'Média', MEDIAN
> 'Mediana', RANGE 'Amplitude', STDDEV]
> BY base [C]
> /CATEGORIES VARIABLES=base ORDER=A KEY=VALUE EMPTY=EXCLUDE.
> !ENDDEFINE.
> GeraEstatisticasNumericas VariaveisNum=NomesVariaveisNumericas.
>
> The error is TABLE: Text [. The syntax contains an invalid sequence of
> operators and parentheses.
> This command is not executed.
>
> Please If you can help me very much thanks.
>
> Carlos Renato.
>
>
>
|