The SAS Output Delivery System and reporting techniques

simple definition of FIRST. of many variables

Not applicable
Posts: 0

simple definition of FIRST. of many variables

Dear all,
to detect the first of many vars you have to specify
if first.var1 and first.var2 and first.var3 and ....

can this been done by something very simple ??


if first.(var1 var2 var3 ....)

Frequent Contributor
Posts: 81

Re: simple definition of FIRST. of many variables

Posted in reply to deleted_user

You shouldn't need to test multiple first.var's, as they refer to a hierarchy setup using the BY statement, e.g.:

by State City ZipCode;

Where all the same State values are grouped together, with all the State-City combinations grouped together, and all the State-City-ZipCode combinations group together.

Therefore first.State is also first.City and first.ZipCode, as it is the first record for a new value of State. In a similar way first.City is also first.ZipCode, but first.ZipCode may not be first.City or first.State.

To answer your question, in this case you only need to test first.State.


PS. See for more explanation.
Message was edited by: prholland at Jul 24, 2006 10:27 AM
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation