[EpiData-list] Re: Fording 3 digit ID numbers

epidata-list at lists.umanitoba.ca epidata-list at lists.umanitoba.ca
Sun Feb 17 20:34:09 CST 2008

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. 


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 at lists.umanitoba.ca
[mailto:epidata-list-bounces at lists.umanitoba.ca] On Behalf Of
epidata-list-request at lists.umanitoba.ca
Sent: Sunday, 17 February 2008 3:33 AM
To: epidata-list at lists.umanitoba.ca
Subject: EpiData-list Digest, Vol 52, Issue 7

Send EpiData-list mailing list submissions to
	epidata-list at lists.umanitoba.ca

To subscribe or unsubscribe via the World Wide Web, visit
or, via email, send a message with subject or body 'help' to
	epidata-list-request at lists.umanitoba.ca

You can reach the person managing the list at
	epidata-list-owner at 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 at lists.umanitoba.ca)


Message: 1
Date: Sat, 16 Feb 2008 00:42:00 +0100
From: epidata-list at lists.umanitoba.ca
Subject: Re: [EpiData-list] forcing 3-digit id numbers
To: epidata-list at lists.umanitoba.ca
Message-ID: <47B62348.2070106 at tbrieder.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed


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:


idn ###
id ___
sex #

In the CHK file you write:

  RANGE 1 150
    IF idn<10 THEN
    IF (idn>9) and (idn<100) THEN


and you have your ID as unique identifier in the format you want it to



epidata-list at 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

> 15. 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>

Hans L Rieder, MD, MPH
Jetzikofenstr. 12
3038 Kirchlindach

Tel: +41 31 829 4577
Mob: +41 79 321 9122
Web: http://www.tbrieder.org


EpiData-list at lists.umanitoba.ca

End of EpiData-list Digest, Vol 52, Issue 7

More information about the EpiData-list mailing list