SAS Component Language Dictionary |
Category: | Extended Table |
Syntax | |
Details | |
Examples | |
Example 1: Specifying Which Row to Scroll | |
Example 2: Letting the Program Determine Which Row to Scroll | |
See Also |
Syntax |
CALL TOPROW(row); |
Details |
The TOPROW routine cannot be called in the getrow or putrow section of an SCL program.
You can use TOPROW only on extended tables in PROGRAM entries. Because you can define extended tables only in SAS/AF software, you cannot use TOPROW in FSEDIT or FSVIEW programs.
Examples |
Scroll the fifth row to the top of the table:
call toprow(5);
Suppose you have a PROGRAM entry window that contains three character fields:
VALUE, in the non-scrollable area of the window. Turn the CAPS attribute off for VALUE.
NAME, the first field in the extended table's logical row. Turn the CAPS attribute off for NAME.
GENDER, the second field in the extended table's logical row.
When a user enters a name in VALUE, the table scrolls so that the corresponding row is at the top of the table.
This program controls the window:
INIT: dsid=open('sasuser.class'); call set(dsid); call setrow(0,0,'','y'); vnum=varnum(dsid,'name'); return; MAIN: rc= where(dsid,"name contains '"||value|| "'"); any=attrn(dsid,'any'); if any then do; rc=fetch(dsid); firstmatch=getvarc(dsid,vnum); rc=where(dsid); recnum=locatec(dsid,vnum, firstmatch); call toprow(recnum); end; return; TERM: if dsid then dsid=close(dsid); return; getrow: if fetchobs(dsid,_currow_)=-1 then call endtable(); return;
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.