Delete function

Discussions about editing and cleaning data
Forum rules
New release: CSPro 8.0
Post Reply
Koen86

Delete function

Post by Koen86 »

Hi,

I am cleaning some data. One of my entry operators has filled excess record occurences with "missing" values. The others have just ended the group. This is not a big issue, but when I compare the data (it was entered twice) this obviously shows up as a difference. The list of differences is currently 500 pages, so I tried shortening it by deleting these empty record occurences. Using the delete function. I've used the code from the delete function's help entry, only replacing the item names and the record name. However, on compile I get the following errmsg:

"ERROR: Record, group or multiple item name expected near line 14 in MOD1_1_EDT procedure"

I actually copied the record name, checked it five times, but I can't see the problem. Here's a screenshot:
Image

Anyone ever used the delete function and come across this issue?
Thanks,
Koen
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Delete function

Post by Gregory Martin »

This is a weird quirk of the CSPro language. The delete function actually expects a group name, not a record name. A group is a section of your application that repeats. For a data entry application, think of a roster as a group. Often the name of the group will be the same as the record name, plus three zeros. For example, in the attached image, you'll see that the group name is PERSON000.
groupImage.JPG
groupImage.JPG (16.43 KiB) Viewed 6096 times
You will have to look at your form tree (not the dictionary tree that you've displayed) to figure out the group name for your record.
Koen86

Re: Delete function

Post by Koen86 »

Gregory,

Thanks for the quick reply. It was a batch editing app, so I appended "_EDT" instead of the 000s, and it seems to have worked (it compiled and ran fine, I'll need some time tomorrow to see if it worked as I expected). Thanks for solving the issue!

It is a strange quirk indeed by the way, why would it ask for a record name if it doesn't actually want one? I also mentions it could use a group name, but the two seem to be interchangeable just about everywhere else (I've not had the whole issue before).


Koen
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Delete function

Post by Gregory Martin »

For the most part, especially with batch applications, records and groups are going to be the same thing. Sometimes, however, that isn't the case.

You could have a data entry application that asks for data on people. Perhaps it first asks these things from the population record for the whole household: name, sex, age. Then it asks other questions for each person. You would have two rosters, one for the first three questions, and then another roster for the other questions. If you wanted to just delete an occurrence of the name/sex/age entries, you would then need to use a group name (the roster name) to specify that you are deleting (or inserting) data for that occurrence.

That is, however, why you must take great care when doing deletes and inserts in data entry applications. You need to be sure of exactly where occurrences are being added or removed.


Last bumped by Anonymous on August 27th, 2012, 5:57 pm.
Post Reply