dictionary with record length that does agree with the variables

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

dictionary with record length that does agree with the variables

Post by AriSilva »

I know I should not edit a data dictionary in an editor, but...
I had a dictionary and used a text editor to include some variables by hand, but I forgot to change the record length, which became very short.
When using this dictionary there is no warning message that the record length is smaller than the sum of the variable sizes.
Besides that, there is no place in the dictionary editor showing the record length for each record type.
Best
Ari
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: dictionary with record length that does agree with the variables

Post by josh »

I know I should not edit a data dictionary in an editor
I think you have your answer. We have bigger tasks to deal with than handle dictionaries edited outside CSPro. Is there something missing in the dictionary editor that caused you to use a text editor? We would rather improve the dictionary editor than try to handle all the different things that can go wrong when a dictionary is edited outside CSPro.
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

Re: dictionary with record length that does agree with the variables

Post by AriSilva »

You are right, I should never had bothered you with such a tiny problem.
We users are a bunch of weird animals that almost all the time do some crazy things.
In my specific case I tried to copy some variables using a text editor because I thought at the time it would be faster. I had several fields in another dictionary that were subitems, and I needed to copy them. I might have used the copy and paste from one dictionary to the other, but then, if I tried to copy the specific subitems to the new dictionary the software would not allow me, giving some error message regarding a copy of subitems. I could also have copied the whole item, and then deleted the ones I would not use. A third factor that pushed me to use the text editor was that there were already variables with the same name in the output dictionary, so I would have to edit them and change their names one by one. I thought I would save time doing that in the text editor but that was not the case, because I forgot to touch the record length.
By looking at a CSPro dictionary, the record length is the only element that is not shown for the user to see (even though s/he should not change it). By having access to that information might help somebody who has to migrate data from the CSPro environment to see the length of the records it would export.
I thought that, as a suggestion, when saving the dictionary, the system might check the record length against the record layout and issue a warning message in case the check failed. I think I was misinterpreted, my intention was to strengthen the software and make it better, more robust and user-proof.
This will not happen again.
Best
Ari
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: dictionary with record length that does agree with the variables

Post by Gregory Martin »

Ari, does the record length not get recalculated if you save the dictionary?

That is, if you open your text editor modified dictionary, make a change so that CSPro thinks that you modified the dictionary (edit a label and cancel the editing), and then save the dictionary, I would think that the record length field would get recalculated and saved correctly. If not, we'll change the code so that it is correct.
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: dictionary with record length that does agree with the variables

Post by htuser »

Thank you Greg.
Ari's suggestion is very important. I, also, use notepad++ to design dictionary because multiple persons can help and it's more fast
than Cspro designer. If also we can have detailed errmsg on errors when opening a dictionary, it will be the best.
Thanks in advance!
G.VOLNY, a CSProuser from Haiti, since 2004
Post Reply