substring in data entry check file
Hi,
In epi info 6.04d for DOS it is possible to take a substring using square brackets to index the characters wanted, e.g. firstname[1,1] gives the first letter of the firstname field. Is there anyway to do this in epidata? Using [1,1] like this does not seem to work. It does not throw an error, it just does not do what I want it to do (fill in another field).
Thanks.
David -- David Whiting, PhD | Senior Epidemiology & Public Health Specialist tel +32-2-6437945 | mob +32-496-266436 | David.Whiting@idf.org
International Diabetes Federation 166 Chaussée de la Hulpe, B-1170 Brussels, Belgium tel +32-2-5385511 | fax +32-2-5385114 info@idf.org | www.idf.org | VAT BE 0433.674.528
IDF | Promoting diabetes care, prevention and a cure worldwide
In EpiData Analysis V2.2.1.172:
String variable VARX, value "ABCDEFGH" substr(VARX,2,3) gvies BCD
Press F1 and click "Functions" to see more details.
Hans
On 20:59, epidata-list@lists.umanitoba.ca wrote:
Hi,
In epi info 6.04d for DOS it is possible to take a substring using square brackets to index the characters wanted, e.g. firstname[1,1] gives the first letter of the firstname field. Is there anyway to do this in epidata? Using [1,1] like this does not seem to work. It does not throw an error, it just does not do what I want it to do (fill in another field).
Thanks.
David
Thanks. Sorry, I was not clear in my original post. I need to do this in the chk file during data entry, not during analysis. I see that substr() is available in analysis, but does not seem to be available for chk files during data entry. What I would like to do is something like:
* example.qes firstname A______ lastname A______ id A__
* example.chk lastname AFTER ENTRY LET id=firstname[1,1] + lastname[1,1] END
Then if I enter Fred Bloggs I get id="FB"
David --
David Whiting, PhD | Senior Epidemiology & Public Health Specialist tel +32-2-6437945 | mob +32-496-266436 | David.Whiting@idf.org
International Diabetes Federation 166 Chaussée de la Hulpe, B-1170 Brussels, Belgium tel +32-2-5385511 | fax +32-2-5385114 info@idf.org | www.idf.org | VAT BE 0433.674.528
IDF | Promoting diabetes care, prevention and a cure worldwide
________________________________________ From: epidata-list-bounces@lists.umanitoba.ca [epidata-list-bounces@lists.umanitoba.ca] On Behalf Of epidata-list@lists.umanitoba.ca [epidata-list@lists.umanitoba.ca] Sent: 21 November 2010 19:29 To: epidata-list@lists.umanitoba.ca Subject: Re: [EpiData-list] substring in data entry check file
In EpiData Analysis V2.2.1.172:
String variable VARX, value "ABCDEFGH" substr(VARX,2,3) gvies BCD
Press F1 and click "Functions" to see more details.
Hans
On 20:59, epidata-list@lists.umanitoba.ca wrote:
Hi,
In epi info 6.04d for DOS it is possible to take a substring using square brackets to index the characters wanted, e.g. firstname[1,1] gives the first letter of the firstname field. Is there anyway to do this in epidata? Using [1,1] like this does not seem to work. It does not throw an error, it just does not do what I want it to do (fill in another field).
Thanks.
David
_______________________________________________ EpiData-list mailing list EpiData-list@lists.umanitoba.ca http://lists.umanitoba.ca/mailman/listinfo/epidata-list
The Check function is COPY - works the same as SUBSTR in Analysis
id = copy(firstname,1,1)+lastname(1,1)
Jamie
On 2010-11-21, David wrote:
Thanks. Sorry, I was not clear in my original post. I need to do this in the chk file during data entry, not during analysis. I see that substr() is available in analysis, but does not seem to be available for chk files during data entry. What I would like to do is something like:
- example.qes
firstname A______ lastname A______ id A__
- example.chk
lastname AFTER ENTRY LET id=firstname[1,1] + lastname[1,1] END
Then if I enter Fred Bloggs I get id="FB"
David
Excellent! Thanks.
David --
On Mon, Nov 22, 2010 at 02:08:48AM +0100, epidata-list@lists.umanitoba.ca wrote:
The Check function is COPY - works the same as SUBSTR in Analysis
id = copy(firstname,1,1)+lastname(1,1)
Jamie
On 2010-11-21, David wrote:
Thanks. Sorry, I was not clear in my original post. I need to do this in the chk file during data entry, not during analysis. I see that substr() is available in analysis, but does not seem to be available for chk files during data entry. What I would like to do is something like:
- example.qes
firstname A______ lastname A______ id A__
- example.chk
lastname AFTER ENTRY LET id=firstname[1,1] + lastname[1,1] END
Then if I enter Fred Bloggs I get id="FB"
David
David Whiting, PhD | Senior Epidemiology & Public Health Specialist tel +32-2-6437945 | mob +32-496-266436 | David.Whiting@idf.org
International Diabetes Federation 166 Chaussée de la Hulpe, B-1170 Brussels, Belgium tel +32-2-5385511 | fax +32-2-5385114 info@idf.org | www.idf.org | VAT BE 0433.674.528
IDF | Promoting diabetes care, prevention and a cure worldwide
_______________________________________________
EpiData-list mailing list EpiData-list@lists.umanitoba.ca http://lists.umanitoba.ca/mailman/listinfo/epidata-list
participants (1)
-
epidata-list@lists.umanitoba.ca