Page 1 of 1

Exporting from Data Viewer

Posted: March 25th, 2018, 10:22 am
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?

Re: Exporting from Data Viewer

Posted: March 27th, 2018, 10:33 am
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.