Syntax/ Production facility - Converting many .csv data files into .sav

#1
Hello every one!

I am writing here because I am having some difficulties with the SPSS syntax and maybe someone here has gone under the same situation and found a solution.

I have 30 data files is csv format; all have the same raw variables but each of them is referred to a different individual. I need to recode the variables in the datasets in the same way and I need to recode all the 30 data files by just running the syntax once just using SPSS (no python nor other extensions). I thought that the solution would be to include a function telling spss to open the csv data files and to convert them into sav format, and finally to recode them as it is specified in the following syntax. As I understood this can be done using the “Production facility” instrument in the “utilities” menu. I read some explanations, I created a “new job” where I inputted the following syntax and where I set the directory of the data file as interactive (@location). For better clarity I pasted part of the syntax below.

GET DATA /TYPE=TXT

/FILE= @location

/ENCODING='UTF8'

/DELCASE=LINE

/DELIMITERS=" ;,"

/ARRANGEMENT=DELIMITED

/FIRSTCASE=2

/DATATYPEMIN PERCENTAGE=95.0

/VARIABLES= “

I tried different combinations but still I get the error message “failure in opening the file”. If I run the syntax without using the “production facility” instrument with the actual directory of one of the data files and I get no error.

Could anyone help me to understand what I am doing wrong? I am using SPSS 24 and the csv data file has been created with a recent version of excel. I also attach a picture of what I wrote in the production facility.

Any suggestion is more than welcome, I wish you all a nice day!

Marla


1602420810951.png