Statements |
Valid: | anywhere |
Category: | Data Access |
Syntax |
FILENAME fileref CLIPBRD <BUFFER=paste-buffer-name>; |
specifies the access method that enables you to read data from or write data to the clipboard on the host computer.
creates and names the paste buffer. You can create any number of paste buffers by naming them with the BUFFER= argument in the STORE command.
Details |
The FILENAME statement, CLIPBOARD Access Method enables you to share data within SAS and between SAS and applications other than SAS.
Comparisons |
The STORE command copies marked text in the current window and stores the copy in a paste buffer.
You can also copy data to the clipboard by using the Explorer pop-up menu item Copy Contents to Clipboard.
Examples |
This example uses the Sashelp.Air data set as the input file. The ODS is used to write the data set in HTML format to the clipboard.
filename _temp_ clipbrd; ods noresults; ods listing close; ods html file=_temp_ rs=none style=minimal; proc print data=Sashelp.'Air'N noobs; run; ods html close; ods results; ods listing; filename _temp_;
This example uses the Sashelp.Air data set as the input file. The data is written in the DATA step as comma-separated values to the clipboard.
filename _temp1_ temp; filename _temp2_ clipbrd; proc contents data=Sashelp."Air"N out=info noprint; proc sort data=info; by npos; run; data _null_; set info end=eof; ; file _temp1_ dsd; put name @@; if _n_=1 then do; call execute("data _null_; set Sashelp.""Air""N; file _temp1_ dsd mod; put"); end; call execute(trim(name)); if eof then call execute('; run;'); run; data _null_; infile _temp1_; file _temp2_; input; put _infile_; run; filename _temp1_ clear; filename _temp2_ clear;
This example writes three lines to the clipboard.
filename clippy clipbrd; data _null_; file clippy; put 'Line 1'; put 'Line 2'; put 'Line 3'; run;
This example writes three lines to the clipboard and then retrieves them.
filename clippy clipbrd; data _null_; file clippy; put 'Line 1'; put 'Line 2'; put 'Line 3'; run; data _null_; infile clippy; input; put _infile_; run;
See Also |
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.