Question...I have a variable, Frequency, that represents a period of time for a specific record, either monthly (M) or quarterly (Q). It was created by using actual to/from dates in my data set, which is a list of sales reports by agent by reporting dates (eg. Jan 1, 2009 to Mar 31, 2009). I have few periods for a few agents that are neither monthly or quarterly (currently represented by X) (for example, account 111 submits sales every quarter, except for one, when she submitted it after 43 days..after this submission, she returned to submitting every quarter..., in other situations, the are for 2 days only as the person left the organization and this is the final submission)
I am trying to use prev. and next. steps (I have about a million records) to identify these odd periods...in situations where the odd record is the last one, the fix is simple (using the first. and last. objects) but I am trying to use prev. and next. objects to identify those agents that did not change their reporting period or leave the org...they just had one odd reporting period in their files.
data A_prod1;
set A_prod1;
by frequency;
if frequency=X and prev.frequency=next.frequency then frequency=prev.frequency;
run;
This is telling me that prev. is not an object, but I can see that it is...my issue is syntax I'm sure, but have no idea what to do.
Any help would be appreciated. Thanks