Reformatting dictionary multiplying IDs

Discussions about tools to complement CSPro data processing
Post Reply
AriSilva
Posts: 594
Joined: July 22nd, 2016, 3:55 pm

Reformatting dictionary multiplying IDs

Post by AriSilva »

Hi folks,
The general problem is the following:
I have a dictionary where the cases are identified by segment, vivienda (building) and hogar (household), And the record key is defined AFTER de id fields, as shown in the attached dictionary (RDCenso22.dcf), That is, each case is a household
By the way, I´m trying to help the Dominican Republic census, and this dictionary was built for the data entry people before my "arrival" in the picture.
As a building can have more than one household, I would like to have a file where the case was the building, as in the attached dictionary (RDCenso22_Vivienda.dcf). I just cpoied the PHOGAR field outside the _IDSO to all the record types, and removed it from the _IDSO.
The idea was to use the Reformat utility to copy the data from the original file (household case) to an output file where the case is identified by the building (vivienda).
But, as I realized later, the reformat just copies fields with the same names, so, the PHOGAR was deleted, and the PHOGAR1, PHOGAR2, etc are blanks.
I used to do that very easily where the record key was the first field in the dictionary, and where the data file where a .DAT (text) file. So, it was just a problem of having two dictionaries pointing to the same file.
But now, besides doing a copy field by field (or creating group fileds to help copying), I do not know how to do that.
Best
Ari
Attachments
RDCenso22_Vivienda.zip
(28.08 KiB) Downloaded 105 times
Best
Ari
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: Reformatting dictionary multiplying IDs

Post by sherrell »

Hi Ari,

You want to copy ("move") the value of the ID PHOGAR into two records, yes? So why not just move it by retaining the name for the first record (PORTADA) and then run it through a batch app to copy (if that's all you're doing?) the same value to the second record, SECCION2.

>And the record key is defined AFTER de id fields,

I'm not sure what you mean by "record key" and what the problem is with regard to the demotion of the ID field to a "regular" record field.

>I used to do that very easily where the record key was the first field in the dictionary, and where the data file where a .DAT (text) file.
>So, it was just a problem of having two dictionaries pointing to the same file.

Which you can totally do now, just use a .dat file instead of a .csdb file.

I feel like I'm not quite understanding your problem, please LMK what I'm missing.

Sherrell
Post Reply