简体   繁体   中英

Where are the SAS formats defined?

When I start up my SAS session and define a library to a folder:

LIBNAME testlib "C:\DATA\&YRMTH\TEST\";

When I navigate to testlib , I already see a bunch of formats defined and ready to use. I am not sure where they are defined and I cannot find them. I need to edit one of these formats, how do I locate the source? YRMTH is a macro variable that contains YYYYMM, corresponding to today's date.

Proc FORMAT source code is not stored with the resultant created format catalog entry.

A format catalog in one of your own libraries can be added to the format search path using the option. From Usage Note 23007: How can I permanently store and use formats that I have created?

OPTIONS FMTSEARCH=(catalog-specification-1... catalog-specification-n);

You may be in a situation where you never find the original source code that created the format! However, all is not lost. The control data of a custom format can extracted using PROC FORMAT CNTLOUT= . A custom format can be edited by manipulating the extracted control data and running it back into with PROC FORMAT CNTLIN= to recreate (overwriting) the original custom format. Remember, that could be a non-reversible process if you do not take care to backup or archive your catalog, catalog entry or extracted control data.

Not sure how your macro variable gets involved with a discussion of formats. Update the question if there is more information to share.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM