SAS Component Language Dictionary |
Category: | List |
Syntax | |
Details | |
Examples | |
Example 1: Placing Values in the Current List | |
Example 2: Placing Values in a Specified List | |
See Also |
Syntax |
rc=LVARLEVEL(dsid,varname,n-level<,list-id>); |
contains the return code for the operation:
0 | |
0 |
is the identifier that was assigned when the table was opened. An invalid dsid produces an error condition.
is the column whose unique formatted values are to be reported.
is the name of the variable in which the function stores the number of unique values (or levels). This variable must be initialized to a nonmissing value before its value is set by the LVARLEVEL function.
Note: This parameter is an update parameter. See Input, Output, and Update Parameters for more information.
is the identifier of the list to fill with the unique formatted values. If list-id is not provided, the values are placed in the current result list. An invalid list-id produces an error condition.
Details |
The values are placed in the list identified by list-id, or in the current result list identified by CURLIST (if list-id is not specified). The values placed in the list are always character values. It is an error if list-id is omitted and you have not created a current result list with the CURLIST function. n-level must be a column, because LVARLEVEL uses it to store the number of unique values it finds. n-level must be initialized to any value except missing before LVARLEVEL executes.
Examples |
Get the unique formatted values for the table column NAME from SASUSER.CLASS, place the values in the current list, and print them:
dsid=open('sasuser.class'); nlevels=0; rc=curlist(makelist()); rc=lvarlevel(dsid,'name',nlevels); put nlevels=; call putlist(curlist(),'levels',0); rc=close(dsid);
Get the unique formatted values for the table column NAME from SASUSER.CLASS, place the values in the specified list, and print them:
dsid=open('sasuser.class'); nlevels=0; listid=makelist(); rc=lvarlevel(dsid,'name',nlevels,listid); put nlevels=; call putlist(listid,'levels',0); rc=close(dsid); rc=dellist(listid);
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.