Accessing a Permanent SAS Data Set with User-Defined Formats

by Irina 2. February 2008 11:07

If you want to use a permanent SAS data set that has user-defined formats, the only requirement is to remember to tell SAS where to find the formats. If you forget the FMTSEARCH= system option, you will get an error message telling you that SAS cannot find the formats. If you give a copy of a SAS data set with user-defined formats to another user, be sure to also give a copy of the format library to them as well
Example:
libname qis 'c:\qis\exposure\formats';
options fmtsearch=(qis);


A useful PROC FORMAT option is FMTLIB. This option creates a listing of each format in the specified library with the ranges and labels. As an example, if you want to display the definitions of all the formats in your QIS library, you would submit the following code:

Example:

proc format library=qis fmtlib;
run;


If you wish to remove the formats from the variables in your output data set, you can use a FORMAT statement with blanks in places of format names.


data base1;
set base ;
format a ;

run;

* a-variable name


TIPS from

Learning SAS® by Example: A Programmer's Guide
by Ron Cody

Related posts

Add comment


(will show your Gravatar icon)  





Live preview

2/5/2012 9:27:19 PM

 

About the author

Irina Spivak Irina Spivak
Team Leader at G-Stat. More...


Send mail Email

Blogroll

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2012

    Sign in

    eXTReMe Tracker