Chapter Contents

Previous

Next
Data Set Model: _saveAs

Data Set Model: _saveAs



Saves the table under a new name


Syntax
Details
Example

Syntax

CALL SEND (object-id, '_saveAs', name<, replace<, col-1,..., col-n>>;

Argument Type Description
name
C specifies the new name to use when saving the table
replace
C specifies whether to replace an existing table name:


'N' does not replace the table (default)


'Y' replaces the table if it exists
col
C specifies one or more column (variable) names separated by commas that specify the columns to be written to the new table. If none are specified, all are written to the new table.


Details

The _saveAs method will write the rows to the table in the same order they were read by the engine. For example, if a WHERE clause or _setKey method has been applied, only those rows meeting the WHERE clause or set key condition are written to the table.

The _saveAs method sets SYSRC for error, note, and warning conditions.


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:

 Note about code
INIT:
   datcl=loadclass('sashelp.fsp.datast_m.class');
   datid=instance(datcl);
 Note about code
   call send(datid,'_setDataset',
            'sasuser.class');
 Note about code
   call send(datid, '_saveAs', 'work.test', 'y',
            'name', 'age', 'sex');
 return;
 Note about code
TERM:
   call send(datid,'_term');
 return;


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.