BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
1 REPLY 1
prholland
Fluorite | Level 6
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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 2673 views
  • 0 likes
  • 2 in conversation