Exporting from Data Viewer

Discussions about tools to complement CSPro data processing
Forum rules
New release: CSPro 8.0
Post Reply
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

Exporting from Data Viewer

Post by AriSilva »

I´ve tried to use the DataViewer to export the csdb file to a dat file in cspro format, but apparently it said that 3 cases had duplicate record types (as shown in the attached export.txt file). I do not see any duplication in the records. The error message does not specify which is the record type that is duplicated.
My csdb file has only 11 cases. Is there a way to attach this file to this post in order for someone has a look at it?
Attachments
export.txt
(2.22 KiB) Downloaded 320 times
Best
Ari
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Exporting from Data Viewer

Post by Gregory Martin »

I think you've run into a limitation with the Export Data tool. Not too many people use it to export to CSPro format, so the people who designed this tool probably didn't consider your scenario. If you look at the batch code that is generated to run the export, you'll see this:
EXPORT TO cspro_export_file_var_f
REC_TYPE("26")
CASE_ID(X01_CRAS, X03_CPF, X04_DATA, X05_HORA, X02_QUESTIONARIO)
F01_CONSTRANGIDO, F02_FREQUENCIA, F03_QUEM, F04_PORQUE, F04A_OUTRO, F05_PRINCIPAL, F05A_OUTRO,
F06_ALGUEM, F07_VEZES;

For item_occ in ITEM F04B_PORQUE_INDIVIDUAL do
    If item_occ in 1:19 then
        EXPORT TO cspro_export_file_var_f
        REC_TYPE("26")
        CASE_ID(X01_CRAS, X03_CPF, X04_DATA, X05_HORA, X02_QUESTIONARIO)
        F04B_PORQUE_INDIVIDUAL;
    EndIf;
Enddo;
The export isn't particularly smart so it tries to put your multiply occurring item on a separate record, and thus you have two records that are trying to use the same record type.

What is your motivation to export to CSPro format? Maybe there's a workaround that we can suggest.
Post Reply