Dear Nicki, Just set the type of data to STRING,then "0" will not be ingored.You can connect several strings directly.so:
v1=2 v2=105 v3=27 v4=7
V5=v1+v2+v3+v4=2105277
note that v1-v5 are all strings! of course u can input "0" in the fields and they are all identified as strings. also you can try function string(), which can convert interger to string.
regards, Justin
2009-05-19
alasiri17
发件人: epidata-list-request 发送时间: 2009-05-19 01:01:30 收件人: epidata-list 抄送: 主题: EpiData-list Digest, Vol 67, Issue 6
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. Consistency in number of digits (epidata-list@lists.umanitoba.ca) 2. Re: Consistency in number of digits (epidata-list@lists.umanitoba.ca) ---------------------------------------------------------------------- Message: 1 Date: Mon, 18 May 2009 14:28:12 +0100 From: epidata-list@lists.umanitoba.ca Subject: [EpiData-list] Consistency in number of digits To: epidata-list@lists.umanitoba.ca Message-ID: 6.2.5.6.0.20090518141625.03381728@ucl.ac.uk Content-Type: text/plain; charset="us-ascii"; format=flowed Dear All, I apologise if this question is simple but I really can't figure it out. In creating my chk file, I need to ensure that four of the variables contain a certain number of digits. I know this is normally controlled by number fields the .qes file. However, in this instance I need zeros to be included at the beginning (eg. 0003) so that all responses contain the same number of digits. This is because I will be putting these 4 variables together to create a 10 digit identifier later in the chk file. At the moment, whenever I enter 0003, the zeros are removed and I am left with just 3. Does anyone know if there is a way to ensure the zeros remain, and to ensure that each variable entered contains 4 digits? Many thanks in advance for your advice! Nicki Nicki Bailey Centre Administrator Leonard Cheshire Disability and Inclusive Development Centre Department of Epidemiology and Public Health University College London 4 Taviton Street, London, WC1H 0BT, UK Tel: +44 (0) 207 679 5589 Fax: +44 (0) 207 388 2291 www.lcdisability.org/idc ------------------------------ Message: 2 Date: Mon, 18 May 2009 16:05:12 +0200 From: epidata-list@lists.umanitoba.ca Subject: Re: [EpiData-list] Consistency in number of digits To: epidata-list@lists.umanitoba.ca Message-ID: 4A116B18.2010104@fifas.de Content-Type: text/plain; charset="iso-8859-1" Dear Nicki, how will your identifier look like? Why doesn`t it work like this? v1=2 v2=105 v3=27 v4=7 ident= v1*1000000000 + v2*1000000 + v3*1000 + v4 = 2105027007 (with 3 digits/variable) Regards Juergen epidata-list@lists.umanitoba.ca schrieb:
Dear All,
I apologise if this question is simple but I really can't figure it out.
In creating my chk file, I need to ensure that four of the variables contain a certain number of digits. I know this is normally controlled by number fields the .qes file. However, in this instance I need zeros to be included at the beginning (eg. 0003) so that all responses contain the same number of digits. This is because I will be putting these 4 variables together to create a 10 digit identifier later in the chk file.
At the moment, whenever I enter 0003, the zeros are removed and I am left with just 3.
Does anyone know if there is a way to ensure the zeros remain, and to ensure that each variable entered contains 4 digits?
Many thanks in advance for your advice!
Nicki
Nicki Bailey Centre Administrator Leonard Cheshire Disability and Inclusive Development Centre Department of Epidemiology and Public Health University College London 4 Taviton Street, London, WC1H 0BT, UK Tel: +44 (0) 207 679 5589 Fax: +44 (0) 207 388 2291 www.lcdisability.org/idc _______________________________________________ EpiData-list mailing list EpiData-list@lists.umanitoba.ca http://lists.umanitoba.ca/mailman/listinfo/epidata-list