Previous Page | Next Page

SAS Component Language Dictionary

MODVAR



Changes the name, label, format, or informat of a column in a SAS table
Category: Variable

Syntax
Details
Example
See Also

Syntax

sysrc=MODVAR(table-id,var-name,new-name<,label <,format<,informat>>>);

sysrc

contains the return code for the operation:

0

successful

[ne]0

not successful

Type: Numeric

table-id

is the identifier that was assigned when the table was opened. If table-id is invalid, the program halts.

Type: Numeric

var-name

is the column whose attribute or attributes you want to change. The column must already exist in the SAS table.

Type: Character

new-name

is the new name to assign to the column. The value must be a valid SAS name and cannot already exist in the SAS table.

Type: Character

label

is the label to assign to the column.

Type: Character

format

is the format to assign to the column.

Type: Character

informat

is the informat to assign to the column.

Type: Character


Details

The table must be opened in UTILITY (V) mode, or the function halts.

If you do not want to change an argument, insert a null string ('' ) as a placeholder.


Example

Change only the label for the column PHONENUM in the SAS table CUSTOMR:

dsid=open('customr','v');
if dsid then
   do;
      rc=modvar(dsid,'phonenum','','Office Phone');
      rc=close(dsid);
   end;


See Also

OPEN

VARFMT

VARINFMT

VARLABEL

VARLEN

VARNAME

VARNUM

VARTYPE

Previous Page | Next Page | Top of Page