too many occurrences of record or group in a dictionary

Discussions about CSEntry
manishcspro
Posts: 67
Joined: June 26th, 2017, 2:15 pm

too many occurrences of record or group in a dictionary

Post by manishcspro »

I created a data file with write case function in batch application using to edit data.
I use another dictionary which loads the above data and dictionary file to edit the data file.
After editing a case when i move to another case to edit is displays a message
"too many occurrences for record or group for Dictionary Name (Case:xxxxxxxxxx) "
I found "~" symbol before record type value in external data file. If I manually delete records having "~" symbol , the above message does not appears.
But when another case is written the message again appears. Please guide me.
Attachments
occ_error.jpg
occ_error.jpg (55 KiB) Viewed 3669 times
aaronw
Posts: 565
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: too many occurrences of record or group in a dictionary

Post by aaronw »

You asked the identical question here: viewtopic.php?f=1&t=4022&p=12509&hilit= ... ces#p12509

Did Greg's suggestion not work? Did you need clarification on it? In addition, explain the intention of the batch application. Are you wanting to edit the main data file?
manishcspro
Posts: 67
Joined: June 26th, 2017, 2:15 pm

Re: too many occurrences of record or group in a dictionary

Post by manishcspro »

Actually I had developed an application to record monthly progress as well as cumulative progress of various schemes in districts starting from April to March in each financial year.
To calculate the cumulative progress I created another data file in .dat format using write case in batch edit from main data file.
The main data file is in .csdb format. Whenever the application runs it first creates .dat file to calculate cumulative values.
This external .dat file is loaded into main dictionary to display cumulative values (adding current month value with preceding month value).
The main application simultaneously add/edit cases as well as writes the cases in the external .dat file. Some times when a case opens in edit mode
and saved it creates/writes the duplicate cases with "~" symbol in the external .dat file.Therefore when the main application opens it continues to displays the error "too many occurrences of record or group in a dictionary".

Please help me out..
aaronw
Posts: 565
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: too many occurrences of record or group in a dictionary

Post by aaronw »

I am going to have to take a look at what is happening. Can you attach the project here or send it to cspro@lists.census.gov? Please, include detailed instructions, so I can reproduce issue.
aaronw
Posts: 565
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: too many occurrences of record or group in a dictionary

Post by aaronw »

You're writing the case to ACHCASE_DICT. So instead of loading the case, I clear the memory. Let me know if that fixes your issues.
//LOADCASE(ACHCASE_DICT);
clear(ACHCASE_DICT);

CASEDIST=DIST;
CASEDIV=DIV;
CASEACH_MTH=ACH_MTH;
CASEACH_YR=ACH_YR;
CASEDEPT=DEPT;

DO VARYING I = 1 UNTIL I > TOTOCC(ACH_EDT)
CASEACH_ITEM(I)=ACH_ITEM(I);
CASEACH_UNIT(I)=ACH_UNIT(I);
CASEACH_AT(I)=ACH_AT(I);
CASEACH_MP(I)=ACH_MP(I);
CASEACH_CP(I)=ACH_CP(I);
CASEACH_PERCENT(I)=ACH_PERCENT(I);
CASEFREEZE = FREEZECASE;
WRITECASE(ACHCASE_DICT);
ENDDO;
manishcspro
Posts: 67
Joined: June 26th, 2017, 2:15 pm

Re: too many occurrences of record or group in a dictionary

Post by manishcspro »

No the problem still exist...
aaronw
Posts: 565
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: too many occurrences of record or group in a dictionary

Post by aaronw »

I need clear steps to reproduce the issue. I need to know which applications to run and in what order. Also, if I need to enter any fields. what values should I enter.
manishcspro
Posts: 67
Joined: June 26th, 2017, 2:15 pm

Re: too many occurrences of record or group in a dictionary

Post by manishcspro »

The sequence is
1- first it remove the old .dat file and its .dat.idx file
2- Then It creates the new cumulative file in caselist folder , exporting from main data file placed in "UPMPR17\achdata\achdata.csdb"
3- Finally it runs the main application file placed in "achievement\ach\ach.pff"

As the main application opens it loads the main data file in .csdb format as well external data file in .dat format meant to calculate cumulative total.Whenever the application enters in new cases or edits existing cases stored in main data file (in csdb), it also writes the new cases in external data file(in .dat). This helps me to calculate the current month cumulative value.

Please run these commands as bat to execute the main application in the above pointed manner:

@ECHO OFF
CLS

CALL "C:\MonthlyProgress\delcaselist.bat"
CALL "C:\MonthlyProgress\cummulative.bat"
timeout /T 1 /NOBREAK > nul
CALL "C:\MonthlyProgress\ach_entry.bat"

EXIT

If the application enters into new case, it runs smooth but if I edit the existing case, then it starts displaying the message " too many occurrences of record or group in a dictionary".I looked into achcase.dat file it displays "~" symbol before the records of the edited case(attached screenshot)
I have faced another problem today, when the number of case are large enough then, it takes time lag for cursor to move from one field to next.
Received from my districts, have approx 1700 cases but when these cases loads into my application, its slows down the cursor movement.
Please guide me accordingly.
Attachments
error.jpg
error.jpg (11.21 KiB) Viewed 3524 times
text_data.jpg
text_data.jpg (311.34 KiB) Viewed 3525 times
manishcspro
Posts: 67
Joined: June 26th, 2017, 2:15 pm

Re: too many occurrences of record or group in a dictionary

Post by manishcspro »

Please respond about the issue..
aaronw
Posts: 565
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: too many occurrences of record or group in a dictionary

Post by aaronw »

The issue looks to be you're doing writecase inside your loop. I moved the last assignment and the writecase out of the loop. Now when I modify the data and run the batch application I don't get the warning. Check your data though.

Also, since you're only writing to ACHCASE_DICT I don't see a reason to run a loadcase on it. I remove that and instead do a clear. The clear has no affect, because your assigning to every variable. However, if that wasn't the case it would set an unassigned variable to be blank which is convenient.
clear(ACHCASE_DICT);

CASEDIST=DIST;
CASEDIV=DIV;
CASEACH_MTH=ACH_MTH;
CASEACH_YR=ACH_YR;
CASEDEPT=DEPT;

DO VARYING I = 1 UNTIL I > TOTOCC(ACH_EDT)
CASEACH_ITEM(I)=ACH_ITEM(I);
CASEACH_UNIT(I)=ACH_UNIT(I);
CASEACH_AT(I)=ACH_AT(I);
CASEACH_MP(I)=ACH_MP(I);
CASEACH_CP(I)=ACH_CP(I);
CASEACH_PERCENT(I)=ACH_PERCENT(I);
ENDDO;

CASEFREEZE = FREEZECASE;
WRITECASE(ACHCASE_DICT);
I have noticed performance hits when the number of occurrences in a record becomes very big. Try to pick the smallest number of occurrences necessary. If you're looping through an external dictionary (forcase) I could see it slowing things down. However, that's application specific.
Post Reply