Raynald's SPSS website has a neat macro for converting variables from string to numeric and vice versa. You can see it here: http://www.spsstools.net/Syntax/LabelsAndVariableNames/ConvertVariableFormat.txt Here is a modified version that allows you to reformat a *list* of variables rather than just one variable. Note that as it stands, it requires the same type of conversion for every variable in the list (e.g., all of them changing from string to numeric). It could be modified further to allow a list of converion types, but I didn't think that was worth the effort. *------ Start of syntax ---------. * This is a modification of Raynald's !convert macro. * This version allows a list of variables for which you * wish to change the format, not just one variable. * ------ Start macro definition -------- . DEFINE !convert (VLIST !ENCLOSE("(",")") /nformat=!TOKENS(1) /type=!TOKENS(1)) /* where VLIST = a list of variables to change format */ /* nformat = the new format */ /* type of change ss (string to string) ns or sn where n=numeric and s=string */ !DO !V !IN (!VLIST) !IF (!type='ss') !THEN STRING temp1234(!nformat). COMPUTE temp1234=!V. !IFEND !IF (!type='ns') !THEN STRING temp1234(!nformat). COMPUTE temp1234=LTRIM(STRING(!V,F18.0)). !IFEND !IF (!type='sn') !THEN COMPUTE temp1234=NUMBER(!V,F18.0). FORMAT temp1234(!nformat). !IFEND MATCH FILES FILE=* /DROP=!V. RENAME VARIABLE (temp1234=!V). !DOEND !ENDDEFINE. *------ End macro definition ----- . *----- Read in some data ------ . data list list / v1 v2 v3 (3a5). begin data. 12345 23456 34567 end data. *----- Call the macro ------ . * Convert variable V1 from string to numeric. !convert vlist(v1) nformat=F5.0 type=sn. * Convert variables V2 and V3 from string to numeric. !convert vlist (v2 v3) nformat=F5.0 type=sn. * Convert variables V1, V2, and V3 from numeric to string. !convert vlist(v1 v2 v3) nformat=A5 type=ns. *----- End of syntax -------- . -- Bruce Weaver Research Associate, Psychology Lakehead University 955 Oliver Road Thunder Bay, ON Canada P7B 5E1 E-mail: bweaver@lakeheadu.ca Web: www.angelfire.com/wv/bwhomedir