Re: Strange behavior of VARIABLE LABELS in macro
Posted by
Bruce Weaver on
URL: http://spssx-discussion.165.s1.nabble.com/Revision-control-for-SPSS-source-code-tp4267835p4267976.html
My guess is you need to use !QUOTE, like this:
VARIABLE LABELS
cod_eva !quote(V001)
correlativo !quote(V002)
prioridad !quote(V003)
etc
HTH.
ANDRES ALBERTO BURGA LEON wrote
Hello to everybody:
When I run this simple macro:
************************************************************************.
DEFINE !separar_ie (evaluacion = !CHAREND('/') / codigo =!CHAREND('/')).
DATASET COPY !evaluacion.
DATASET ACTIVATE !evaluacion.
FILTER OFF.
USE ALL.
SELECT IF (cod_eva = !codigo).
EXECUTE.
SORT CASES BY prioridad (A) codgeo (A) corre_med (A) cod_al (A).
DELETE VARIABLES casos_ie_C_10 casos_ie_M_10 cen_pob region26 TO nombres.
COMPUTE correlativo=$CASENUM.
EXECUTE.
ALTER TYPE correlativo (F6.0).
VARIABLE LABELS
cod_eva V001
correlativo V002
prioridad V003
codgeo V004
corre_med V005
cod_mod7 V006
anexo V007
nom_nino V008
ie V009
ubicacion V010
en_cl V011
texto1_C V012
en_m V013
texto1_M V014
se_ubica_C V015
nivel_C V016
texto2_C V017
se_ubica_M V018
nivel_M V019
texto2_M V020
p_g3_ie_C_10 V021
p_g2_ie_C_10 V022
p_g1_ie_C_10 V023
p_g3_ie_M_10 V024
p_g2_ie_M_10 V025
p_g1_ie_M_10 V026.
SORT VARIABLES BY LABEL.
SAVE OUTFILE=!QUOTE(!CONCAT('D:\Censo Alumnos
2010\Documentos\Reportes\Segundo\Padres\Reporte Padres 2do
',!evaluacion,'.sav'))
/COMPRESSED.
DATASET ACTIVATE Reporte_padres.
!ENDDEFINE.
!separar_ie evaluacion = MC / codigo = 2.
************************************************************************.
I get an error message:
Warning # 4463 in column 25. Text: V001 correlativo V002 prioridad V003
codgeo V004 corre_med V005
A label specified on the VAR LABELS command contains more than 256
characters.
The label will be truncated to 256 characters.
If I run the VARIABLE LABELS outside the macro, I don't get the error, and
every variable gets its correct label.
I can run the VARIABLE LABELS like this:
VARIABLE LABELS
cod_eva 'V001'
correlativo 'V002'
prioridad 'V003'
codgeo 'V004'.
inside the macro and works fine. I'm triying to understand why something
like:
VARIABLE LABELS
cod_eva V001
correlativo V002
prioridad V003
codgeo V004.
doesn't works inside the macro,
Kindly
Andrés
Mg. Andrés Burga León
Coordinador de Análisis e Informática
Unidad de Medición de la Calidad Educativa
Ministerio de Educación del Perú
Calle El Comercio s/n (espalda del Museo de la Nación)
Lima 41
Perú
Teléfono 615-5840
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/"When all else fails, RTFM."
PLEASE NOTE THE FOLLOWING:
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (
https://listserv.uga.edu/).