Comparing a dcf dictionary with the one embedded in the csdb

Other discussions about CSPro
Forum rules
New release: CSPro 8.0
Post Reply
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

Comparing a dcf dictionary with the one embedded in the csdb

Post 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
Best
Ari
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

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

Post 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.
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

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

Post 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.
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

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

Post 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
Best
Ari
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

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

Post 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.
Post Reply