[EpiData-list] Select top 3 among 8

epidata-list at lists.umanitoba.ca epidata-list at lists.umanitoba.ca
Mon Aug 5 07:05:06 CDT 2013

I'm not sure why syntax is too long. I ran a test with that no problem.
Your other solution looks good. but shouldn't the after record block have "<>6"?
After record is the better way to do the check anyway. You should be able to program the "2^V1 ..." solution into After Record.
If the line gets too long, just break it up by using a temporary global variable to hold the result

define choices ### global
choices =2^V1 + 2^V2, etc
if choices <> 14 then 


On 2013-08-05, Serge wrote:

> Yeah, I tried that but the syntax was too long and EpiData cuts it after a
> few characters.
> What I'm trying to do now is to program it in the consistency bloc. These
> are the commands I've used:
> after record
> ignoremissing
> if V1 + V2 + V3 + V4 + V5 + V6 + V7 + V8 <>12 then
> help "There may be an error when choosing the top 3 options"
> goto V1
> endif
> end
> consistency block
> report ID
> check "There may be an error when choosing the top 3 options"
> (2^V1+2^V2+2^V3+2^V4+2^V5+2^V6+2^V7+2^V8=14)
> end
> What do you think about that? Can I use shorter commands?

More information about the EpiData-list mailing list