14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

292 Data Tables Chapter 9<br />

Row State Operators<br />

if(sex=="M",<br />

/*then*/ row state()=combine states(<br />

color state(4), marker state(6), hidden state(1)),<br />

/*else*/ row state()=combine states(<br />

color state(3), marker state(2), hidden state(0))));<br />

Get the row state for one row, such as the 6th:<br />

row state(6);<br />

Combine States(Hidden State(1), Color State(4), Marker State(6))<br />

Notice that JMP returns a Combine State combination. This is because a row state datum is not just the<br />

state of one characteristic, such as color, but the cumulative state of all the characteristics that have been set:<br />

exclusion, hiding, labeling, selection, markers, colors, hues, and shades. A list of such characteristics is called<br />

a row state combination.<br />

Just as there can be many row state characteristics in effect, a row state column can have<br />

multiple-characteristic row states as its values.<br />

Some Operators set one Characteristic and Clear Others<br />

In addition to the overall Row State operator for getting or setting all the characteristics of a row state, there<br />

are separate operators to get or set one characteristic at a time preemptively. That is, to give a row one<br />

characteristic, canceling any other characteristics that might be in effect. These operators are Color State,<br />

Combine States, Excluded State, Hidden State, Hue State, Labeled State, Marker State,<br />

Selected State, Shade State.<br />

For example, to make row 4 be hidden only:<br />

rowstate(4)=hidden state(1);<br />

Other Operators set or get one Characteristic at a Time<br />

As seen above, a row state is not just one characteristic but many. To work with just one thing at a time, use<br />

one of the L-value operators with Row State on either side of the equal sign, depending on whether you<br />

want to get or set. There is an L-value operator for each of the characteristics: Color Of, Excluded,<br />

Hidden, Labeled, Marker Of, Selected.<br />

Get Row States<br />

// hide row 4 without affecting other characteristics:<br />

hidden(rowstate(4))=1;<br />

// store color of row 3 without getting other characteristics:<br />

::color = color of(rowstate(3));<br />

To access a row state, place the row state expression on the right side of an assignment:<br />

x = rowstate(i); // puts row state of row i into x<br />

x = rowstate(); // row state of current row

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!