Kobo to SPSS Variable Name and Value Considerations

Dear everybody,
I have collected data with Kobo and have now opened it in SPSS (as XLSX file) but unfortunately the column “values” is missing completely. I read here in the forum that you have to download the SPSS labels separately and then run them in the program. I have done this, but

many error messages and no SPSS labels appear. I attached a Screenshot of the error messages. Unfortunately I do not know what the problem is… Has anyone else had this problem before?

I am greatful for any advice.
Anne

Hello Anne,
just some ideas.
At the end of your screenshot: I am not sure, if _ is valid at the beginning of a SPSS variable name, see IBM Documentation

Variable names can be up to 64 bytes long, and the first character must be a letter or one of the characters @, #, or $. Subsequent characters can be any combination of letters, numbers, nonpunctuation characters, and a period (.). … Letters include any nonpunctuation characters used in writing ordinary words in the languages supported in the platform’s character set. .

See also a previous post: Open data in SPSS - #2 by Kal_Lam

Maybe also to try import as UTF-8.

Could the […] brackets in the labels create a problems? You might try with a simple example and change them to (…) or remove them. You may just try: start "start {test}'.
All your error msg refer to Spalte 3 (column 3) and all cases have a [ …] there. But I think, it’s ok, as

Variable labels can contain any characters, including blanks. To enter an apostrophe as part of a label, enclose the label in double quotes or enter a two apostrophes (two single quotes). See IBM Documentation

Also, your variable named Date might create a conflict with the SPSS DATE command.

Would like to hear about your solution, please.
Kind regards

1 Like

hello, here i have had the same issue, except i am not yet very familiar with the use of syntax in spss, but i have collected a huge form and if i could import it in spss without having to edit and add the labels and values it would really be helpful, i have the same issues, the syntax is not working after i have imported the CSV file into spss for all the labels i get something that looks like this:

Warning # 4464 in column 3. Text: _
An invalid symbol appeared on the VAR LABELS command where a variable name was
expected. All text through the next slash will be ignored.
/_2_Sex ’ Sex’

and for all values i get something that looks like this:

Warning # 4492 in column 2. Text: _
The (ADD) VALUE LABELS command included a symbol other than a value where a
value (either numeric or string) was expected. For compatibility with
previous systems, a parenthesized value would have been acceptable. All value
labels up to the next slash will be ignored.
‘AUTOMATIC’ ‘Male’
‘female’ ‘Female’
‘prefer_not_to_say’ ‘Prefer not to say’
/_3_Marital_status
can someone help me here please?
thanks in advance!!

Welcome to the community @mugaboema! Would you mind having a look at the post discussed previously (it should help you solve your issue):

1 Like

Hi @mugaboema
I hope you have gone through the topic shared by @Kal_Lam. In addition, you should always ensure that the name of your question in XLSform should always fit the convention set for SPSS variable names which in summary are as follows.

  • Each variable name must be unique.
  • The maximum variable name length is 64 characters.
  • The first character must be a letter or the character @.
  • The characters # or $ are acceptable if the data file is opened with these characters as the first position of the variable name.
  • Middle characters of the variable name can be any combination of letters, numbers, @, #, $, comma (,), period (.) or underscore (_).
  • The last character of a variable name cannot be a period (.) or underscore (_).
  • Spaces are not allowed in variable names.
  • SPSS reserved keywords cannot be used as variable names. SPSS reserved keywords are ALL, AND, BY, EQ, GE, GT, LE, LT, NE, NOT, OR, TO, and WITH.
  • Variable names can contain any mixture of uppercase and lowercase characters and the case will be preserved in the SPSS data file.
  • Variable names cannot use reserved key words. S1, E1, C1, NET, SUB, TN, CALC are all examples of Reserved Key Words.
  • Do not use A, C, E, F, H, I, M, R, S or V, followed by a number (example, S3), for variable names.

Regards,
Stephane

2 Likes

Hello @stephanealoo,
Would be great, if we can also collect those hints for SPSS variable LABELS, esp. in combination with the label KoBo export channel. For ex. things like / or … (dots) or - or right-left languages etc. in KoBo choice labels.
Thanks in advance.
Kind regards

2 Likes

Hi @wroos
On the SPSS labels, I left it out simply because the current values and value label restrictions provided by XLSForms matches exactly what SPSS and even STATA restricts for response values. So in essence, as long as your form passes the check, the values and labels would be accepted on SPSS.

The only thing is for long text entries where your text breaks such as visible in some cvs’s. However for this, it is a simple GiGo, if the csv is broken so shall the SPSS and STATA be broken. So I would not make this an SPSS or STATA issue but rather an issue of checking csv to ensure that there is no broken lines i.e. added cases than what is expected.

Stephane

2 Likes

hello@Kal_Lam, thank you for the comment, so for me the csv file did not name the variables the same way, actually i had to edit the variable names, because what i found out was that it seems when SPSS automatically renames the variables so that they can be imported it does not rename them like the syntax, i am not sure why, but if you name them correctly from kobo while making the questions then they fall in perfectly both in the syntax code and in SPSS, the problem is the label will also look like the question which is not good for the tables when making a report for example! , if only there was a label option in kobo when making the questions up the same way there are values it would really be Nice, but again thank you for the comment i had to check the CSV file many times just to be sure, and by the way the XLS file from KOBO does it better with the labelling automatically even without the running the syntax then you can work on the values after.
cheers :slightly_smiling_face:

image

Hi @mugaboema,

Could you also share with us a screenshot of the xlsform (survey tab- your variable names)?

1 Like

@mugaboema
When you have a moment, could you please download the XLS form from the project itself and share it as is. I think the issue could be your variables were renamed prior to deployment.

Stephane

1 Like