|
|
||||||||||||
TYPE: Print a text file to SAS output window/.lst file or logDownload type.sas If you are not prompted to "Save To Disk", then right-click the link and choose "Save Link Target As..." Otherwise, you will need to save the web page to your computer. Make sure you save the type.sas file as a plain text file not an
htm/html file.
Disclaimer: There is no warranty on this software either expressed or implied. This program is released under the terms and conditions of GNU General Public License. About TYPE
Programmer: Dan Blanchette ()
Center for Entrepreneurship and Innovation Duke University's Fuqua School of Business Durham, NC USA Developed at Research Computing at The University of North Carolina at Chapel Hill Date: 26February2008 Last updated: 26February2008 Print an ASCII text file SAS output window or " .lst " file or log
%type("filen name and location", options );
Description
The TYPE SAS macro is just like the Stata command (and DOS command)
type. It just prints your text file to the SAS output
window or "
.lst" file or SAS
log. It even has the starbang option that Stata's
type command has that prints only lines that start with
"*!".
Options
NOTE: The parameters have to be specified in the order of this list.
How to use the TYPE macro:
Using the TYPE macro requires that you understand how to use the %include SAS statement and that you know
how to call a SAS macro.
%include "LOCATION AND NAME OF A FILE THAT CONTAINS SAS CODE";For example, if you have copied this file to " c:\SASmacros", then you tell SAS
about this macro by adding the following line to your SAS program:
%include "c:\SASmacros\type.sas";The include statement makes SAS aware of the TYPE SAS macro which is in the file type.sas. To use the macro you have to make a call to it. To do that you add a line like the following to your SAS program: %type("folder & name of an ASCII text file", [options]);
The information inside the parentheses is passed on to the TYPE macro. The first string of information
is the ASCII text file you want to submit to Stata. The second string of information after the comma is the options
you wish to pass on to the TYPE macro.
Examples
%include "C:\SASmacros\type.sas"; ** Include macro once in a SAS session and call it **;
* as many times as you like in that session. **;
** print the text file my_file.txt to SAS output: **;
*%type( file name and location, options ) **;
%type("C:\MyData\my_file.txt", );
** print the text file my_file.txt to SAS log: **;
*%type( file name and location, options ) **;
%type("C:\MyData\my_file.txt", -log );
** only print lines that start with a star and a bang "*!" **;
** in the file C:\MyData\my_file.txt **;
%type("C:\MyData\my_file.txt", -starbang);
Back to Main Page Questions or comments? Send them to Dan Blanchette () |