BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
garyb
Community Member

First and Last SAS Functionality in JMP

Does JMP have first and last functionality similar to that in SAS?

e.g.

if first.variablename then

....;

if last.variablename then
....;

0 Kudos
2 REPLIES 2
XanGregg
Staff

Re: First and Last SAS Functionality in JMP

I'm not familiar with the constructs, but from a quick search I gather you want to if the current row contains the first or last occurrence of a particular variable's value in a data set sorted by that variable. I think that would be:

if (:var != Lag(:var), ...); // first

if (:var != Lag(:var, -1), ...); // last

0 Kudos
tom
tom
Community Trekker

Re: First and Last SAS Functionality in JMP

Wouldn't the equivalent in a matrix language just be indexing to the first value or the last value?

0 Kudos