You could do that, but if all of your missing variable strings are
coded as "-66", I would just make a new set of variables, recode the
"-66" to a blank string, and then concatenate the variables all
together. Below is an example.
**********************************.
data list free ("|") / oldvar1 TO oldvar4 (4A10).
begin data
blablabla|-66|-66|-66
-66|-66|-66|blablabla
-66|-66|blablabla |-66
-66|blablabla|-66|-66
end data.
vector oldvarR(4,A10).
recode oldvar1 to oldvar4 ("-66" = "")(ELSE = COPY) into oldvarR1 to
oldvarR4.
execute.
*the use of RTRIM makes it so any blank spaces are removed in the
empty strings.
string newvar (A40).
compute newvar =
CONCAT(RTRIM(oldvarR1),RTRIM(oldvarR2),RTRIM(oldvarR3),RTRIM(oldvarR4)).
execute.
*************************************.
If your missing value codes aren't all "-66" this wouldn't work as
well. You could do it using if statements as well, although it the
stars align correctly in your example this may be slightly less work.
Andy W