The SAS Output Delivery System and reporting techniques

simple definition of FIRST. of many variables

Reply
N/A
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 ??

perhaps

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

Greetz,
Herman
Frequent Contributor
Posts: 81

Re: simple definition of FIRST. of many variables

Posted in reply to deleted_user
Hermie,

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.

.......Phil

PS. See http://v8doc.sas.com/sashtml/lrcon/z0761931.htm for more explanation.
Message was edited by: prholland at Jul 24, 2006 10:27 AM
Ask a Question
Discussion stats
  • 1 reply
  • 1673 views
  • 0 likes
  • 2 in conversation