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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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