SAS:如何将条目放入目录中? [英] SAS: How do I put entries into a catalog?

查看:70
本文介绍了SAS:如何将条目放入目录中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个目录,希望将未编译的宏存储为.sas文件.例如,我想要一个名为"myMacros"的目录,其中包含"Macro1.sas","Macro2.sas"等.

I have a catalog into which I would like to place uncompiled macros stored as .sas files. For example, I would like a catalog called "myMacros" which contains "Macro1.sas", "Macro2.sas", etc.

我在Windows上使用SAS 9.4.

I am using SAS 9.4 on Windows.

我所看过的每个地方都只会告诉我一旦目录存在后如何访问.我找不到如何分配对象到目录.我已经花了数小时来仔细阅读文档,并阅读了大多数

Everywhere I have looked only tells me how to access a catalog once it already exists. I cannot find how to assign objects to a catalog. I have spent hours scouring the documentation, having read most of the SAS 9.4 Macro Language Reference and trying to make sense of FILENAME Statement, CATALOG Access Method and CATALOG Procedure.

推荐答案

此主旨是您为目录创建 FILE 定义,然后将代码放入目录中.

The gist of the idea is you create a FILE definition to the catalog and then PUT the code in the catalog.

FILENAME CODE CATALOG "WORK.TEST.SOURCE";
DATA _NULL_;
   FILE CODE ;
   PUT "PROC PRINT";
RUN;

或1.通过MSTORED SASMSTORE选项定义宏的存储位置.2.分配库3.使用宏代码上的SOURCE选项存储代码.

or 1. Define where macros are stored via MSTORED SASMSTORE options. 2. Assign the library 3. Use the SOURCE option on the macro code to store the code.

Michael Raithels Paper的示例(下面的链接):

Example from Michael Raithels Paper (link below):

OPTIONS MSTORED SASMSTORE=MYSTORE;
LIBNAME MYSTORE "S:\PROJECTS\SGF2015\COMPILED_MACROS";
2
%MACRO RUNCONTS (IN=, OUT=) / STORE SOURCE DES="Run Contents and Test Print";
 TITLE1 "CONTENTS AND TEST PRINT OF DS &IN. - &SYSDATE - &SYSTIME";
 PROC CONTENTS DATA = &IN. VARNUM;
 RUN;
 PROC PRINT DATA= &IN. (OBS=5) NOOBS;
 RUN;
%MEND;

有用的参考资料: http://analytics.ncsu.edu/sesug/2005/AD07_05.PDF http://support.sas.com/resources/papers/proceedings15/3459-2015.pdf

这篇关于SAS:如何将条目放入目录中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆