view deleted records in view data
Dear all,
Thank you very much for the various valuable suggestions that I recently received to solve the issues around having both 01 and 1 accepted as legal value for a numerical field. I adopted a combination of strategies and think it is working fine now.
Now I have an issue around deleted records. Because my QES and CHK files are so large I always have to work with related files for single (non-hierarchical) questionnaires. (As reported on this forum before, it is usually the 64k limit of the CHK file that forces me to split up my entry screens, rather than the 999 lines limitation for the QES). Because of this when a record needs to be deleted it will have to be done in both parts. Any error in this will result in orphaned bits of records so I insist the data entry supervisors watch out for this. Is there a fast way that the data entry supervisor can find the deleted files in a record? When I use "document" "view data" I do not see which records are deleted. I think I am probably overlooking something. Is there a way to make the deleted records quickly visible (without having to go through all of them one by one in the entry mode)?
Thanks a lot for any suggestions. Best regards,
Henriette
Dr Henrica A.F.M. (Henriette) Jansen Epidemiologist, WHO Multi-country Study Violence against Women Department of Gender, Women and Health
Tel direct: +41 22 791 3106 Fax direct: +41 22 791 1585 Mobile: +41 78 730 3035 E-mail: jansenh@who.int
World Health Organization 20, avenue Appia CH-1211 Geneva 27 Tel: +41 22 791 2111 Fax: +41 22 791 3111 Visit WHO at: www.who.int
Henrica,
Codebook will tell you how many deleted records there are, but won't show them to you. This count will be useful, but not a guarantee that the same records were deleted.
This can be done in Analysis quite easily.
Run the following commands in Analysis (you can create a .pgm file to do this to automate the process). The idea here is to use relate to find the deleted records. The example is for 'file1.rec'. I hope the comments make it clear.
set echo off set read deleted=off * deleted records will be ignored set replace datafile=on * allow overwriting file1del.rec read file1 * the number of deleted records will be reported
savedata file1del idvar * this copy will not have the deleted records * you only need 'idvar', so it will be a small file close
set read deleted=on * deleted records will be treated as if they were not deleted
read file1 * the total number of records will be reported
relate idvar file1del * file1del will be missing the records * that are marked as deleted records in file1.rec
select idvar1 = . * idvar1 comes from file1del.rec * and will be missing for deleted records
echo The following ID numbers were deleted from FILE1.REC list idvar
close * restore default settings set replace datafile=off set read deleted=off set echo=on
Jamie Hockin Public Health Agency of Canada
Henrica wrote:
Now I have an issue around deleted records. Is there a fast way that the data entry supervisor can find the deleted files in a record? When I use "document" "view data" I do not see which records are deleted. I think I am probably overlooking something. Is there a way to make the deleted records quickly visible (without having to go through all of them one by one in the entry mode)?
Here is a follow up to my earlier reply. Clearly I wasn't thinking in simple terms when I proposed the complicated solution. Analysis has access to two (and maybe more) very useful 'hidden' variables:
RECNUMBER - (real number) the current record number (based on current sort) RECDELETED - (Y/N) the deletion status of the current record You onlly have access to these in LET statements. You cannot LIST or BROWSE them or use commands like FREQ on them.
So the simple solution to finding deleted records in Analysis is:
read file1 list if recdeleted
will list all fields for deleted records only. Of course it make more sense just to list a few of them, or to use browse. However, list will give a written record of them.
A more elegant solution is this:
read file1 gen i file1rec = recnumber // create a new variable to hold recnumber type "Record number and subject ID for deleted records" /h2 list file1rec idvar if recdeleted
Jamie Hockin
Henriette wrote:
Is there a fast way that the data entry supervisor can find the deleted files in a record?
participants (1)
-
epidata-list@lists.umanitoba.ca