[EpiData-list] IF... THEN LEGAL

epidata-list at lists.umanitoba.ca epidata-list at lists.umanitoba.ca
Tue Aug 30 19:22:55 CDT 2011


Hi Thomaz,

It seems you can't use the LEGAL command with IF. Below is another way,
which actually may be more informative for data entry. CLEAR deletes the
incorrect entry from countryid while "GOTO countryid" keeps the cursor
in that field.

countryid
  IF (stateid=1) AND (countryid<>1) AND (countryid<>4) THEN
   HELP "Where stateid=1, the only legal values for countryid are 1 and
4." TYPE=ERROR
   CLEAR
   GOTO countryid
  ENDIF
END

Regards,

Suzanna Vidmar
Senior Research Officer
Clinical Epidemiology and Biostatistics Unit

Murdoch Childrens Research Institute 
Royal Children's Hospital
Flemington Road Parkville Victoria 3052 Australia 

telephone: +61 3 9345 6372
facsimile: +61 3 9345 6000
email: suzanna.vidmar at mcri.edu.au
www.mcri.edu.au

-----Original Message-----
From: epidata-list-bounces at lists.umanitoba.ca
[mailto:epidata-list-bounces at lists.umanitoba.ca] On Behalf Of
epidata-list at lists.umanitoba.ca
Sent: Wednesday, 31 August 2011 7:09 AM
To: epidata-list at lists.umanitoba.ca
Subject: [EpiData-list] IF... THEN LEGAL

Hi all,

I'm trying to combine IF... THEN with LEGAL but somehow I'm having
problems
with it. Basically, what I want to do is to determine valid values for
one
variable based on the answer given to another variable. In the example
below, the two vars are stateid and countyid: If stateid = 1 then
countyid
could be 01 or 04; if stateid = 2 then countyid could be 02, 03 or 05.

Example:

countyid
  IF stateid = 1 THEN
    LEGAL
      01
      04
  END
  ENDIF
  IF stateid = 2 THEN
    LEGAL
      02
      03
      05
  END
  ENDIF
  MUSTENTER
END
-- 
Thomaz A.
_______________________________________________
EpiData-list mailing list
EpiData-list at lists.umanitoba.ca
http://lists.umanitoba.ca/mailman/listinfo/epidata-list

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 

If you have any question, please contact MCRI IT Helpdesk for further
assistance.
______________________________________________________________________

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________


More information about the EpiData-list mailing list