Previous Page | Next Page

SAS Component Language Dictionary

SETFLD



Assigns a value to up to ten blank variables
Category: Control or Field

Syntax
Details
Example
See Also

Syntax

CALL SETFLD(value,variable-1<, . . . ,variable-10>);

value

is the character value to assign.

Type: Character

variable-1, . . . ,variable-10

are up to ten character variables whose values you want to change from blank to value.

Type: Character


Details

If the variable is blank, value is assigned to the variable. No values are changed for variables that are not blank.

This function is useful for setting the default values for a series of fields.


Example

Set each of the variables SYM1 through SYM5 to the value -REQUIRED- for each variable that is blank:

call setfld ('-REQUIRED-',sym1,sym2,sym3,sym4,sym5);

The above statement is equivalent to the following statements:

if (sym1=' ') then sym1='-REQUIRED-';
if (sym2=' ') then sym2='-REQUIRED-';
if (sym3=' ') then sym3='-REQUIRED-';
if (sym4=' ') then sym4='-REQUIRED-';
if (sym5=' ') then sym5='-REQUIRED-';


See Also

CLRFLD

Previous Page | Next Page | Top of Page