Chapter Contents |
Previous |
Next |
SAS/AF Software: Class Dictionary |
The following example shows how to use several of the methods for this class. In this example, the first row of the table is read. Information about each column, such as column name, type, format, and so on, is retrieved. If the column type is character, then the character text is retrieved for that row; otherwise, the numeric value is retrieved.
length colname $ 8 format informat $ 14 label $ 40 text $ 200 type $ 1;
INIT: datcl=loadclass('sashelp.fsp. datast_m.class'); datid=instance(datcl); veccl=loadclass('sashelp. fsp.dsdvec.class'); vecid=instance(veccl); |
call send (datid, '_setDataset', 'sasuser.class'); |
call send (datid, '_getNumberOfColumns', ncols); call send (vecid, '_setNumberOfColumns', ncols, datid); |
call send (vecid, '_getNumberOfColumns', ncols); |
call send (datid, '_getRow', vecid, 1); |
put column= colname= type=; put format= informat= label=; |
if (type='N') then do; call send (vecid, '_getValue', column, value); put value=; end; |
if (type='C') then do; call send (vecid, '_getText', column, text); put text=; end; end; |
call send (datid, '_term'); call send (vecid, '_term'); return; |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.