简体   繁体   English

SAS 格式在哪里定义?

[英]Where are the SAS formats defined?

When I start up my SAS session and define a library to a folder:当我启动 SAS 会话并将库定义到文件夹时:

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

When I navigate to testlib , I already see a bunch of formats defined and ready to use.当我导航到testlib ,我已经看到了一堆已定义并可以使用的格式。 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. YRMTH 是包含 YYYYMM 的宏变量,对应于今天的日期。

Proc FORMAT source code is not stored with the resultant created format catalog entry. Proc FORMAT源代码不与生成的格式目录条目一起存储。

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?来自使用说明 23007:如何永久存储和使用我创建的格式?

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= .可以使用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.自定义格式可以通过操纵所提取的控制数据,并且与运行它放回被编辑PROC FORMAT CNTLIN=重新创建(覆盖)的原自定义格式。 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.如果有更多信息要分享,请更新问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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