Date: Fri, 9 Oct 2009 04:11:22 -0700
Reply-To: Bruce Weaver <bruce.weaver@hotmail.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Bruce Weaver <bruce.weaver@hotmail.com>
Subject: Re: Help with a simple IF statement
In-Reply-To: <97D6F0A82A6E894DAF44B9F575305CC90A774364@HCAMAIL03.ochca.com>
Content-Type: text/plain; charset=us-ascii
Pirritano, Matthew-2 wrote:
>
> To all listers!
>
> This statement is not working.
>
>
> This is all on one line:
> if (elig_period = 1) & ((fromdatesvc_s >= app_30_days.1) &
> (fromdatesvc_s >=
> elig_start_date.1) &
>
> This is on a second line indented 31 spaces:
> (fromdatesvc_s < app_first_of_month.1) & (fromdatesvc_s <=
> elig_end_date.1)) no_pay_30 = 1.
>
> It is supposed to identify a claim that occurred with eligibility period
> 1 (individuals can have more than one eligibility period). It should
> then flag only those claims that are within 30 days of the first of the
> month that the application for the program was filed, where the date of
> service is greater than the date of the beginning of eligibility, is
> less than the first of the month when the application was completed, and
> less than the end of the eligibility period.
>
> The problem is that the statement seems to be ignoring some
> stipulations. I've been able to identify that it is not selecting dates
> of service that are less than the first of the month that the
> application took place in. Could my indentation have something to do
> with it? I indent all the time to make my code more readable!
>
> Thanks
> Matt
>
Hi Matt. I find that for complicated conditional statements, it often helps
to make the statement more readable (by reducing clutter) if I use a bunch
of scratch variables for the various conditions. E.g.,
compute #ep1 = (elig_period EQ 1).
compute #fdGEa30 = (fromdatesvc_s GE app_30_days.1).
compute #fdGEesd1 = (fromdatesvc_s GE elig_start_date.1).
etc...
if #ep1 & (#fdGEa30 & #fdGEesd1 & ...
-----
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/
"When all else fails, RTFM."
NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.
--
View this message in context: http://www.nabble.com/Simple-%28I-think%29-problem-with-a-Macro-tp25805207p25819301.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD