Page 1 of 1

Comparing a dcf dictionary with the one embedded in the csdb

Posted: October 28th, 2018, 12:19 pm
by AriSilva
Hi Folks,
I´m running an edit program that reads a csdb file, and the messages that are shown does not match with the file contents if I use a dataviewer/frequency tool. For example, I have an edit saying

if not invalueset($) then
errmsg("PCV4: %d",$); //debugging
endif;
All the records fail this, but with the frequency I can see that the variable has regular values.
I wonder if the csdb input file was not written with a different dictionary.
Is there a way to compare a dcf dictionary with the one which is embedded in the csdb?
Or, is there a way to generate a dcf dictionary file from the information stored in the csdb?
Best
Ari

Re: Comparing a dcf dictionary with the one embedded in the csdb

Posted: October 29th, 2018, 1:13 am
by Gregory Martin
This is not straightforward, but what you could do is:

1) Open the Tabulate Frequencies tool.

2) Select your CSPro DB file.

3) Select something to tabulate.

4) Add this as the universe: accept("1","1")

5) Click Run.

6) When the accept box comes up, go to your temporary directory. You can go it my entering %temp% in Windows Explorer.

7) Sort by date modified. You should have new files, CSFrqRun...

8) Open the .ord file in a text editor.

9) Look at the [Dictionaries] section. You'll see something like: File=.\CSP....tmp

10) Copy that file somewhere else and change the extension to .dcf. That's the dictionary from your CSPro DB file.

Alternatively, you can use a SQLite browser tool to extract the dictionary.

Re: Comparing a dcf dictionary with the one embedded in the csdb

Posted: October 29th, 2018, 1:16 am
by Gregory Martin
I should note that the accept call isn't some secret thing to extract the dictionary. It's only there to give you time to go to the temporary directory to get the dictionary. If you don't have that call, the tabulation program might finish before you can get the dictionary. Those temporary files (CSFrqRun... and the dictionary) are deleted one the frequency is run.

Re: Comparing a dcf dictionary with the one embedded in the csdb

Posted: November 24th, 2018, 12:38 pm
by AriSilva
Thanks, Greg, it works!
That's what I needed.
I do not have much experience with SQL (if any) to be able to use it to read a csdb file. Where can I find some documentation on that?
Best
Ari

Re: Comparing a dcf dictionary with the one embedded in the csdb

Posted: November 24th, 2018, 2:51 pm
by josh
We don't document it because we don't really want to encourage people to use SQL on the csdb file. We may change the way data is stored in the SQLite database format in future versions so we don't we don't want people writing programs that will break if we do that.