Add Derived Parameters with Multi-Dimensional Arrays

Creating laboratory analysis datasets is challenging and a daunting task, due to the size of dataset and number of derived parameters required. Creating laboratory analysis dataset requires to derive parameters. Common technique to add records in the dataset is by using if-then statement or by creating the dummy dataset. Use of Nested arrays to derive these parameters limits the chance of error and makes program efficient.

Arrays can be very powerful with its iterative and conditional processing. Array in SAS allows to group a bunch of variables for the same process. The huge block of repetitious statements and redundant calculation codes can be reduced to just a few lines. With arrays, you can simplify the coding in many cases and can accomplish tasks which are not easily done.

Multidimensional arrays are used when you want to put values in a table format (i.e., rows and columns). Multidimensional arrays can be used to input data or to perform operations on the dataset. Multidimensional arrays are defined as follows: The number of elements are placed in each dimension after the array name in the form {n, ..}. From right to left, the rightmost dimension represents columns; the next dimension represents rows. Each position farther left represents a higher dimension.

 

newsletter 1

 

 

 

 

 

This is an example of two-dimensional array with three rows and five columns. The array contains fifteen variables: five temperature measures (t1 through t5) from three cities (c1, c2 and c3).

As per the Programming specifications, 24 parameters are required to add in ADLB (laboratory) dataset. Table 1 is an example of the parameters required.

newsletter 2

 

newsletter 3