2
votes

I have two intertwined questions:

My goal is to combine 12 columns of string data into one cleaned column.

This is using survey data, so each column represents a different group of respondents, aka if one has data, the others will not.

But...a lot of the columns are showing NA instead of being blank. So it's now showing a string where it should be blank.

Question 1: How can I tell SPSS that IF Column A to L="NA" THEN $SYSMIS.

Question 2: Once I have my columns without NA, how do I combine them all into one column?

See below for an example: enter image description here

As you can see, my goal is to clear out the NA and make them blank cells. Then I want to take the value from each column (highlighted in red here) and combine them into the new column (again, they will never have two values from different columns in the same row, so it shouldnt be difficult to combine, I'm just not sure how).

Thanks! (:

1

1 Answers

2
votes

Untested, but see if the following works for you:

EDIT: Revised to incorporate the improvements mentioned in the comments.

RECODE A TO L ('NA' = '') .
STRING NewColumn (A25) .
COMPUTE NewColumn = Concat(A, B, C, D, E, F, G, H, I, J, K, L) .
EXE .