SAS Component Language Dictionary |
Category: | External File |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
sysrc=FPUT(file-id,cval<, length>); |
contains the return code for the operation:
0 | |
0 |
contains the identifier that was assigned when the file was opened. If file-id is invalid, the program halts.
is the length of the string to move to the FDB. If length is greater than cval, then the string is padded with blanks when it is moved. If length is less than cval, the string is truncated when it is moved. If length is less than 1, the program halts.
Details |
The unformatted value of cval is passed to FPUT. The number of bytes moved to the FDB is determined by the length of the variable, or by the value of length, if length is specified. The value of the column pointer is then incremented to one position past the end of the new text.
Example |
Move data to the FDB and write it to the external file:
/* Assign the fileref THEFILE to the physical */ /* filename stored in the variable FNAME */ /* and open it in append mode. */ rc=filename('thefile',fname); fileid=fopen('thefile','a'); if (fileid>0) then do; thestring='This is some data.'; rc=fput(fileid,thestring); rc=fwrite(fileid); rc=fclose(fileid); end; else _msg_=sysmsg(); rc=filename('thefile','');
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.