Choose Language Hide Translation Bar
Highlighted
garyb
Level I

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
....;

2 REPLIES 2
Highlighted
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

Highlighted
tom
tom
Level I

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?

Article Labels

    There are no labels assigned to this post.