SAS Component Language Dictionary |
Stops the processing of the getrow section of a dynamic extended
table
The ENDTABLE routine stops the processing of the getrow
section of a dynamic extended table. A dynamic extended table is a table whose maximum number of rows is determined when
the program executes. Call the ENDTABLE routine from the getrow section of
the SCL program when the end of the extended table has been reached.
Because you can define extended tables only in SAS/AF
software, you cannot use ENDTABLE in FSEDIT or FSVIEW programs.
The ENDTABLE routine marks only the end of the table
for this invocation of the GETROW label. If the user issues a scroll command,
the GETROW label is driven again until ENDTABLE is called. This allows the
size of the table to change dynamically.
In this example, data for the extended table comes from
the open SAS table that is identified by the value in the variable DSID. The
_CURROW_ variable, which identifies the current row of the extended table,
specifies which row to fetch. When the value of _CURROW_ exceeds the number
of rows in the table, FETCHOBS returns a nonzero value, which indicates that
the end of the extended table has been reached. ENDTABLE is then called to
stop the processing of the GETROW label.
GETROW:
...SCL statements...
if (fetchobs(dsid,_currow_) =-1) then
call endtable();
else do;
...more SCL statements...
end;
return;
CURTOP
SETROW
TOPROW
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.