14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 9 Data Tables 305<br />

Calculations<br />

Sequence<br />

Sequence() corresponds to the Sequence function in the Formula Editor and is used to fill the cells in a<br />

data table column. It takes four arguments and the last two are optional:<br />

Sequence(from, to, stepsize, repeat)<br />

From and to are not optional. They specify the range of values to place into the cells. If from = 4 and to<br />

= 8, the cells are filled with the values 4, 5, 6, 7, 8, 4, ...<br />

Stepsize is optional. If you do not specify a stepsize, the default value is 1. Stepsize increments the values<br />

in the range. If stepsize = 2 with the above from and to values, the cells are filled with the values 4, 6,<br />

8, 4, 6, ...<br />

Repeat is optional. If you do not specify a Repeat, the default value is 1. Repeat specifies how many times<br />

each value is repeated before incrementing to the next value. If repeat = 3 with the above from, to, and<br />

stepsize values, the cells are filled with the values 4, 4, 4, 6, 6, 6, 8, 8, 8, 4, ... If you specify a Repeat<br />

value, you must also specify a Stepsize value.<br />

The sequence is always repeated until each cell in the column is filled.<br />

Example:<br />

// Create a new data table<br />

dt = New Table("Sequence Example");<br />

// Add 2 columns and 50 rows<br />

dt

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

Saved successfully!

Ooh no, something went wrong!