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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2282 views
  • 0 likes
  • 2 in conversation