Hello,
In case your variables are of number type (rather than text), and using Pete's example for the length of the variables, you can alternatively do:
v4
MUSTENTER
AFTER ENTRY
I6=(v1*1000000000) + (v2*1000000) + (v3*100) + v4
END
END
Good luck!
Yves --------------------------------------------------------------------- Yves MARTIN-PREVEL, Epidemiologist, MD, MSc, PhD 'Nutripass' IRD (WHO Collaborating Center for Nutrition) UMR204 IRD/Montpellier1/Montpellier2/SupAgro Institut de Recherche pour le Développement (IRD) BP 64501 - 911, avenue d'Agropolis 34394 MONTPELLIER CEDEX 5 (France) yves.martin-prevel@ird.fr Tel: +33(0)4.67.41.61.70 - Fax: +33(0)4.67.41.61.57 https://www.mpl.ird.fr/ur106/index.htm http://www.cilss.bf/nusapps/
-----Message d'origine----- De : epidata-list-bounces@lists.umanitoba.ca [mailto:epidata-list-bounces@lists.umanitoba.ca] De la part de epidata-list@lists.umanitoba.ca Envoyé : vendredi 15 mai 2009 19:39 À : epidata-list@lists.umanitoba.ca Objet : Re: [EpiData-list] creating an identifiant from various variables
Here is a simple example:
DATA FILE: C:\Documents and Settings\Owner.YOUR-E92F6775CF\My Documents\EpiData\testindex.rec
File label: Test Indexing
File size: 693 bytes
Last revision: 15. May 2009 1:28 PM
Number of fields: 5
Number of records: 3
Checks applied: Yes (Last revision 15. May 2009 1:27 PM)
Fields in data file:
No. Name Variable label Field type Width Checks
---------------------------------------------------------------------------- ----
1 v1 Text 3 Must enter
2 v2 Text 3 Must enter
3 v3 Text 4 Must enter
4 v4 Number 2 Must enter
More: See check file
5 i6 Text 12 NoEnter
---------------------------------------------------------------------------- ----
and check file:
v1
MUSTENTER
END
v2
MUSTENTER
END
v3
MUSTENTER
END
v4
MUSTENTER
AFTER ENTRY
I6=V1 + v2 + v3 + String(v4)
END
END
i6
NOENTER
END
Data looks like:
List of observations in C:\Documents and Settings\Owner.YOUR-E92F6775CF\My Documents\EpiData\testindex.rec
List created 15. May. 2009 1:28 PM
Records in file: 3
Records in list: All
Deleted records are skipped.
Observation 1 (record # 1)
v1 001 v2 304 v3 4837
v4 12 i6 001304483712
Observation 2 (record # 2)
v1 111 v2 222 v3 3333
v4 44 i6 111222333344
Observation 3 (record # 3)
v1 123 v2 456 v3 7890
v4 12 i6 123456789012
This example uses first three variables as strings, and the fourth as a number converted to a string.
Pete Geddes
epidata-list@lists.umanitoba.ca wrote:
Dear all,
I would have a question about the creation of an identifier for data
entry.
I would like the identifier to be automatically created in the .rec file after entering 4 variables and as an aggregation of these 4
variables.
For instance my identifier is
ID=region number+village number+household number+member in the household
number
Do you have any clue about how to do this?
Thank you for your help.
Jean-Francois
EpiData-list mailing list
EpiData-list@lists.umanitoba.ca
_______________________________________________ EpiData-list mailing list EpiData-list@lists.umanitoba.ca http://lists.umanitoba.ca/mailman/listinfo/epidata-list