Re: Fording 3 digit ID numbers
This proposed solution has the problem that ID is then a string variable, which will be confusing when you transfer it to STATA, SPSS etc. Another solution would be to not worry about the leading zeros until you have transferred it into STATA, at which point you could use the STATA format command to force it to display as 3 digits.
Regards
Dr Josh Davis
NH&MRC Scholar Menzies School of Health Research
Staff Specialist in Infectious Diseases and General Medicine Royal Darwin Hospital -----Original Message----- From: epidata-list-bounces@lists.umanitoba.ca [mailto:epidata-list-bounces@lists.umanitoba.ca] On Behalf Of epidata-list-request@lists.umanitoba.ca Sent: Sunday, 17 February 2008 3:33 AM To: epidata-list@lists.umanitoba.ca Subject: EpiData-list Digest, Vol 52, Issue 7
Send EpiData-list mailing list submissions to epidata-list@lists.umanitoba.ca
To subscribe or unsubscribe via the World Wide Web, visit http://lists.umanitoba.ca/mailman/listinfo/epidata-list or, via email, send a message with subject or body 'help' to epidata-list-request@lists.umanitoba.ca
You can reach the person managing the list at epidata-list-owner@lists.umanitoba.ca
When replying, please edit your Subject line so it is more specific than "Re: Contents of EpiData-list digest..."
EpiData-list mailing list ___________________________________
Today's Topics:
1. Re: forcing 3-digit id numbers (epidata-list@lists.umanitoba.ca)
----------------------------------------------------------------------
Message: 1 Date: Sat, 16 Feb 2008 00:42:00 +0100 From: epidata-list@lists.umanitoba.ca Subject: Re: [EpiData-list] forcing 3-digit id numbers To: epidata-list@lists.umanitoba.ca Message-ID: 47B62348.2070106@tbrieder.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Vicky:
I reproduced your problem, and while perhaps awkward, this seems to be a
possible solution:
Make an IDN as a numeric field and your ID as a text field:
QES:
idn ### id ___ sex #
In the CHK file you write:
idn RANGE 1 150 MUSTENTER AFTER ENTRY id=idn IF idn<10 THEN id="00"+id ENDIF IF (idn>9) and (idn<100) THEN id="0"+id ENDIF END END
id KEY UNIQUE 1 NOENTER END
and you have your ID as unique identifier in the format you want it to be.
Regards,
Hans
epidata-list@lists.umanitoba.ca wrote:
<div class="moz-text-flowed" style="font-family: -moz-fixed">I am using a unique ID for individuals in a study. The ID must be between 001 and 150 and it is a 3-character string field to ensure 054 is entered, for instance, rather than 54. Certain numbers can be entered with fewer than 3 digits without generating an error message. Without trying every possible combination, it seems that these numbers are 1, 10, 11, 12, 13, 14 and
- The thing that these seven numbers have in common is that they
could all be extended to 3 digits by filling in only zeroes, and still
meet the criteria for the field (100, 100 again, 110, 120, 130, 140, 150). 160 is too big for the range, so 16 generates an error message.
200 is too big, so 2 is not allowed. This is just a guess to explain why these seven numbers slip through the filter. If I'm right, is there anything I can do about it? If I'm wrong, what's the explanation? Thanks for your help, Vicky Simms
King's College London
</div>
participants (1)
-
epidata-list@lists.umanitoba.ca