| Date: | Fri, 10 Nov 2000 01:40:31 GMT |
| Reply-To: | Pete Lund <pete.lund@HOME.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Pete Lund <pete.lund@HOME.COM> |
| Organization: | @Home Network |
| Subject: | Re: funny behavior |
| Content-Type: | text/plain; charset=ISO-8859-1 |
JP-
What you're really saying in your x1=x2=x3=x4=0 is:
x1 = (x2=x3=x4=0)
where "x2=x3=x4=0" is a logical expression that will return false (0).
The expression is basically asking "are x2, x3, x4 and 0 all the
same?" At this point, since x2-x4 have never been referenced, they
are not 0 and so the expression is false.
You're right in your original code - in this case:
x1=0; x2=0; x3=0; x4=0;
Hope this helps-
Pete
home: pete.lund@home.com
On Thu, 09 Nov 2000 21:35:31 GMT, "JP"
<R_E_M_O_V_E_lecruguel@epid.jgh.mcgill.ca> wrote:
>
>Hi all
>
>I tried
>pbhbinc= pbhbinc= pbhbinc2= 0;
>vs.
>pbhbinc= 0; pbhbinc0=0; pbhbinc2= 0;
>thinking it would do the same.
>
>As I run an ARRAY statement later. I thought that I would get the same in
>the end.
>As it was just an initialisation of the 3 variables.
>
>Instead I got: pbhbinc ok but pbhbinc0 & pbhbinc2 ate set to missing for
>all obs.
>
>How does the x1=x2 = x3=x4 = 0 work? what's the logic?
>Should it be used in some case?
>
>JP
>
>here is the code:
>
>DATA c2b;
> SET c2a;
> ARRAY sjr{*} jour1-jour731;
>
> ARRAY dmdt{*} ddde1-ddde8;
> ARRAY dmtp{*} Typeheb1-Typeheb8;
> ARRAY dmf{*} dferm1-dferm8;
>
> ARRAY hbdta{*} dadm1-dadm18;
> ARRAY hbdts{*} dsor1-dsor18;
> ARRAY hbtp{*} typea1-typea18;
> ARRAY hbrd{*} raisond1-raisond18;
>
> ARRAY hpdta{*} datadm1-datadm35;
> ARRAY hpdts{*} datsor1-datsor35;
> * met HEB non fini a '01APR2000'd;
> * met HEB = HOP parfait à HEB = .;
> * détecte chevauchement HEB/HOP, HEB inclus dans HOP, HOP includ dans HEB
>mme jour adm ou me jour sortie;
>pbhbinc= 0; pbhbinc0=0; pbhbinc2= 0;
>
> DO j = 1 TO DIM(hbdta);
> IF hbdta{j} AND hbdts{j} = . THEN hbdts{j} = '01APR2000'd;
> DO k = 1 TO DIM(hpdta);*date sortie heb vide mise a avril 2000;
> IF hbdta{j} AND hpdta{k} AND (hbdta{j} = hpdta{k} AND hbdts{j} =
>hpdts{k}) THEN DO;hbdta{j} =.; hbdts{j} =.;END; *heb = hop heb mis a vide;
> IF hbdta{j} AND hpdta{k} AND ((hbdta{j} >= hpdta{k} AND hbdts{j} >=
>hpdts{k} AND hbdta{j} < hpdts{k})
> OR ( hbdta{j} =< hpdta{k} AND hbdts{j} =< hpdts{k} AND hbdts{j}
>> hpdta{k} )) THEN pbhbinc0 = pbhbinc0+1; *chevauchement;
> IF hbdta{j} AND hpdta{k} AND hbdta{j} >= hpdta{k} AND hbdts{j}=<
>hpdts{k} THEN pbhbinc = pbhbinc+1; *heb inclus dans hosp;
> IF hbdta{j} AND hpdta{k} AND (hbdta{j} = hpdta{k} OR hbdts{j} =
>hpdts{k}) THEN pbhbinc2 = pbhbinc2+1; *entrée hosp = entrée heb ou sortie
>hosp = sortie heb;
> END;
> END;
>
>RUN;
>
|