b = insert(group_nameʃ(occurrence)ʅ);
b = insert(group_name, first_occurrence)ʃ, last_occurrenceʅ);
The
insert function inserts missing or otherwise needed data records or item occurrences in the current case. It is primarily intended for use in batch applications. It should be used with extreme caution in data entry applications because of possible conflicts between the operator's actions and the program logic.
The first syntax inserts a single occurrence of the record. When inserting a singly-occurring record, it is not necessary to specify the occurrence. The second syntax inserts one or more occurrences of a record, starting with the first_occurrence and inserting up to the last_occurrence. This allows for the mass inserts of record occurrences.
The function returns a logical value of 1 (true) if successful and 0 (false) otherwise.
In the following example there is a data item in the housing record called H13_PERSONS, which contains the total number of people living in the household. We have decided that if the number of population records found in the household is less than this variable, we will insert the missing number of population record(s).
It makes no difference if the population record has been defined in the dictionary as required or not. What is important is that it was defined as a multiply-occurring record.
For this example, we are processing data that did not require housing records to be present. However, now we want to force the existence of housing records. We could implement this as follows:
To accomplish this, the housing record must be set to
"Required=No" in the dictionary. You cannot use this function for a singly-occurring record when the record is required.