Chapter Contents |
Previous |
Next |
COPY |
Category: | Utility |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
sysrc=COPY(old-name,new-name<,type>); |
0 | successful |
0 | not successful |
Type: Numeric
Type: Character
'CATALOG'
. If a catalog entry is being
copied, the function sets the entry type of the new entry to that of the old
entry. You can also specify SAS data set options.
Type: Character
'ACCESS'
'CATALOG'
'DATA'
'VIEW'
Type: Character
Details |
To copy a catalog entry, specify the complete
four-level name of the entry for old-name, a
three-level name for new-name, and 'CATALOG'
for type.
You can use the WHERE= data set option to copy only those rows that meet a WHERE subset to the new table.
The COPY function does not copy existing integrity constraints to the new SAS table. Use the ICCREATE function to define new integrity constraints.
If the SAS table that is being copied is indexed, then all indexes are rebuilt for the new SAS table. New-name is ignored when you use COPY to copy GRSEG catalog entries that were created using SAS/GRAPH software. A copied GRSEG entry will have either the same name as the original entry or, if an entry with that name already exists in the target catalog, a unique name generated by SAS software.
Example |
Copy the SAS table DATA1 to DATA2 and copy WORK.TEMP.A.SCL to SASUSER.PROFILE.B.SCL:
if (copy('data1','data2')) then do; _msg_=sysmsg(); ...SCL statements to handle the error condition... end; rc=copy('work.temp.a.scl', 'sasuser.profile.b.scl', 'catalog'); if (rc) then do; _msg_=sysmsg(); ...SCL statements to handle the error condition... end;
Copy from the SAS table SASUSER.CLASS to WORK.CLASS
only those rows in which the variable GENDER=M
:
if (copy('sasuser.class(where=(GENDER="M"))', 'work.class')) then do; _msg_=sysmsg(); ...SCl statements to handle the error condition... end;
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.