Chapter Contents |
Previous |
Next |
APPEND |
Category: | SAS Table |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
sysrc=APPEND(table-id<,option>); |
0 | successful |
0 | an error or warning condition occurred |
Type: Numeric
'NOSET'
'NOINIT'
Type: Character
Details |
APPEND adds a row to the end of a SAS table. By default, the added row contains missing values. However, you can add a row with the current values in the TDV if SET has been called or if the NOINIT option is specified as the second argument. If SET has been called, the NOSET argument can still force APPEND to fill the row with missing values.
If the SET routine has not been called, you can PUTVARC and PUTVARN to specify values for each column in the TDV before calling APPEND with the NOINIT option. You can use INITROW to initialize the TDV to missing to prevent APPEND from writing bad data to a row values are not explicitly assigned to some columns through PUTVARC or PUTVARN.
Example |
Add a row to the SAS table WORK.DATAONE,
which has two columns, FNAME and SSN. Because SET is called, the values ROBERT
and 999-99-9999
are
written to the new row.
tableid=open('work.dataone','u'); call set(tableid); fname='Fname'; ssn='999-99-9999'; if (append(tableid)) then do; _msg_=sysmsg();
If SET had not been called, then using the NOINIT option would produce the same results:
tableid=open('work.dataone','u'); fname='ROBERT'; ssn='999-99-9999'; call putvarc(tableid,varnum(tableid,'fname'),fname); call putvarc(tableid,varnum(tableid,'ssn'),ssn); if (append(tableid,'noinit')) then _msg_=sysmsg();
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.