Need feature import spss variables into cspro

What would you like to see in CSPro?
Forum rules
New release: CSPro 8.0
Tuan
Posts: 29
Joined: November 18th, 2013, 6:42 pm

Need feature import spss variables into cspro

Post by Tuan »

Dear

I could not find the import feature that import spss variables into cspro. Any suggestions? as I am new for cspro.

Best

Tuan :)
Adnane
Posts: 30
Joined: November 22nd, 2012, 4:45 am

Re: Need feature import spss variables into cspro

Post by Adnane »

There is no option on cspro that can do this directly, like there is to export data to SPSS, but you can do it in the following manner:
save your SPSS file as a file that Excel can read, and then from Excel save the excel file in format "Formatted text (Space delimited) *.prn." This will save the data as a text file that CSPro can read if you create a dictionary for it.

Note:do not forget to add a column in the Excel file to add the numeric character "1" (the idea is to transform your files as the same as cspro saves the data on the text file.

See attached for some instructions on how to do this.
Attachments
Lookup File Exercise.docx
(18.37 KiB) Downloaded 592 times
Tuan
Posts: 29
Joined: November 18th, 2013, 6:42 pm

Re: Need feature import spss variables into cspro

Post by Tuan »

Dear Adnane
Many thanks for the information.
Have tried per your guidance but could import none of the items. After added look up file, it only showed the 1st ID item. Any help appreciated.

Best
Tuan
Adnane
Posts: 30
Joined: November 22nd, 2012, 4:45 am

Re: Need feature import spss variables into cspro

Post by Adnane »

The key idea is to transform your SPSS file to a text file but in the same form as the data file of CSPro,
well, I'll try to detail a little more clearly with the following steps:

1) Save your spss file as excel file,
2) Open the Excel file then you need to add a column (put it as the first column) then put on this column the charactere numeric "1" from beginning to the end of this column (as cspro puts on his data file)
3) save the excel file as text file with the form "space delimited", like that you will have a text file in the same form of the cspro data file,

important note:
1) before saving the excel file to a text file, it is necessary that the width of the columns on the excel file is the same as it is defined on your dictionary (size width of columns is equal to item len),
exemple: if the item sex on your dicsionary takes 2 len (01, 02),then the column width of the variable sex on the excel file must be equal to 2 (to make it , right clicke on this column and then change the width equal to 2)
2) the first column that you add to the Character numeric "1" must be equal to 1 (the cspro put it like that by default),

I hope I was clear, just tell me one thing, do your dicsionary has more than one record or more than one level ?
Tuan
Posts: 29
Joined: November 18th, 2013, 6:42 pm

Re: Need feature import spss variables into cspro

Post by Tuan »

Dear Adnane

Many thanks for your additional information. I have the spss file with few hundreds variables and wish to import into cspro without creating data file in cspro. Do you mean I need to create manually all these variables in cspro similar to of SPSS variables then import? That will take some times. Actually I have done like that and exported to SPSS then checked with the other spss file. Any other suggestions are appreciated and many thanks.
Best
Tuan
Tuan
Posts: 29
Joined: November 18th, 2013, 6:42 pm

Re: Need feature import spss variables into cspro

Post by Tuan »

Dear Adnane

I forgot to inform that I my dictionary has only one level and one record.
Best
Adnane
Posts: 30
Joined: November 22nd, 2012, 4:45 am

Re: Need feature import spss variables into cspro

Post by Adnane »

in fact, the opposite (that is to say import an spss file to cspro) does this not done automatically as is done to export, you must do this manually, if you have 100 variable in SPSS to import that to cspro you must first prepare an Cspro application with 100 item on the dictionary manually.

exemple:
you have a spss file with the following variables (name, surname, sex, age) and you want to import this to cspro,
first, you must make manually an Cspro application with dictionary which carries the same item on your SPSS file that is to say an Cspro application with the item (name, surname, sex, age).
Tuan
Posts: 29
Joined: November 18th, 2013, 6:42 pm

Re: Need feature import spss variables into cspro

Post by Tuan »

Dear Adnane

Many thanks for your advice. I got it.
Bets
Tuan
naylinnsoe
Posts: 31
Joined: June 22nd, 2012, 7:14 am
Location: Yangon

Re: Need feature import spss variables into cspro

Post by naylinnsoe »

Dear Tuan,

I would like to explain how to import Variables from SPSS to CSPro directly without spending more times.
I also faced that problem and CSPro can't support that feature.
But I can import SPSS Variables with my own technique.

Here step by step :
1. Copy Variable Name,Variable Width, Variable Label from SPSS and Paste to Microsoft Excel.
Image
Image

2. Prepare Excel File as follow
1st Column with " [item]"
2nd Column with "Label="
3rd Column with Labels from SPSS
4th Column with "Name="
5th column with Variable Name form SPSS
6th Column with "Start="
7th column with some value 3,4,5 as you like
8th Column with "Len="
9th Column with Width from SPSS
10th Column CONCATENATE Function to Combine previous Columns (See Attached file)


After That
Copy all text form Combine column and pasted in Word
after pasted to Word to convert Table to Text format 1. courser on table Layout Tab==> Convert to text
Image

Use Find and Replace==>Special >>Manual Line Brake to make manually enter
e.g Find [item] and Replace [item]^l
[img]D:\Pictures\Word_3.png[/img]
[img]D:\Pictures\Word_4.png[/img]


Finally U will get as follow



[item]
Label=Question Number
Name=Question_No
Start=4
Len=4

[item]
Label=Gender of respondent
Name=Gender
Start=8
Len=1

[item]
Label=Age of respondent
Name=Age
Start=9
Len=3

[item]
Label=High level of Education
Name=Education
Start=12
Len=2
[item]
Label=Marital Status of respondent
Name=Marital_Status
Start=14
Len=2

[item]
Label=Occupation
Name=Occupation
Start=16
Len=2

[item]
Label=Race of respondent
Name=Race
Start=18
Len=2

[item]
Label=Religion of Respondent
Name=Religion
Start=20
Len=2

Create New CSPro DataEntry Application

Open Dictionary File with some text editor software : (I use Notepad++ , UltraEdit)


Find

[Record]
Label=xxxxxx
Name=xxxxx
RecordTypeValue='1'
RecordLen=xxx

Copy from word and Paste that
Save and Close text editor

Open CSPro normally
Now U can see all SPSS variables are Imported to CSPro
Attachments
Import Variables form SPSS to CSPro sample Excel 1.xls
(29 KiB) Downloaded 534 times
Myanmar
Tuan
Posts: 29
Joined: November 18th, 2013, 6:42 pm

Re: Need feature import spss variables into cspro

Post by Tuan »

Dear naylinnsoe

Very sorry that could not reply earlier. I will look through it and let you know if any query. Many thanks for your time.

Best
Tuan
Post Reply