![]() Chapter Contents |
![]() Previous |
![]() Next |
| Data Set Model: _setDataset |
| Syntax | |
| Details | |
| Example |
Syntax |
| CALL SEND (object-id, '_setDataset', name<, mode><, locking><, option-1,...option-n>); |
| Argument | Type | Description | |
|---|---|---|---|
| name |
C | specifies the name of the table. The name may include data set options. See SAS Language: Reference, Version 6, First Edition for more information. | |
| mode |
C | specifies the open mode for the new table: 'BROWSE' or 'EDIT'. The default is 'BROWSE'. | |
| locking |
C | specifies the locking level: 'RECORD' or 'MEMBER'. The default is 'RECORD'. For more information, see "Control Levels" in SAS Component Language: Reference. | |
| options |
C | specifies any additional _setDataset method options: | |
| 'BRONLY' | prevents editing of the table | ||
| 'NOADD' | prevents the user from adding new rows to the table | ||
| 'NODELETE' | prevents the user from deleting rows in the table | ||
| Details |
If you modify the current row in the table, you must use the _updateRow method before calling the _setDataset method.
The _setDataset method sets SYSRC for error, note, and warning conditions.
Note: Passing a value of ' ' as the name of the
table will close
the current table. ![[cautionend]](../common/images/cautend.gif)
| Example |
In the following example, the Data Set Model class is being used as a stand-alone model, that is, the model class is not being used with a data form or data table object.
This example is written as a stand-alone SCL entry:
| | length name $32; |
| |
INIT:
datcl = loadclass('sashelp.fsp.datast_m.class');
datid = instance(datcl);
dsdvcl = loadclass('sashelp.fsp.dsdvec.class');
dsdvec = instance(dsdvcl); |
| |
call send(datid, '_setDataset',
'sasuser.class',
'EDIT', 'RECORD',
'NOADD', 'NODELETE'); |
| |
call send(datid, '_getNumberOfColumns',
nvars);
call send(dsdvec, '_setNumberOfColumns',
nvars, datid); |
| | call send(datid, '_getRow', dsdvec, 1); call send(dsdvec, '_getText', 1, name ); put name= ; |
| | call send(datid, '_deleteRow'); return; |
| | TERM: call send(datid, '_term'); call send(dsdvec, '_term'); return; |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.