请选择 进入手机版 | 继续访问电脑版
楼主: gaotao0727
3445 4

[问答] Catalog调用永久存储的宏时报错 [推广有奖]

  • 1关注
  • 10粉丝

副教授

79%

还不是VIP/贵宾

-

威望
0
论坛币
540 个
通用积分
11.2790
学术水平
18 点
热心指数
18 点
信用等级
12 点
经验
27715 点
帖子
873
精华
0
在线时间
855 小时
注册时间
2011-8-8
最后登录
2023-3-1

gaotao0727 发表于 2014-9-11 13:41:12 |显示全部楼层 |坛友微信交流群

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
最近在看SAS.Publishing.SAS.Certification这本书,第12章为存储宏程序,里面讲到用Catalog方法来调用永久保存的宏。
具体如下,
把如下的宏保存在Sasuser.Mymacs下
  1. %macro PrintClass;
  2. proc print data=sashelp.class;
  3. run;
  4. %mend;
复制代码
使用Catalog方法调用
  1. filename PrintClass Catalog 'Sasuser.Mymacs.PrintClass.Source';
  2. %include PrintClass;
  3. %PrintClass;
复制代码
报错如下:
  1. 1 filename PrintClass Catalog 'Sasuser.Mymacs.PrintClass.Source';
  2. ERROR: Invalid logical name.
  3. ERROR: Error in the FILENAME statement.
  4. 2 %include PrintClass;
  5. WARNING: Physical file does not exist, C:\Users\bfd\printclass.sas.
  6. ERROR: Cannot open %INCLUDE file PRINTCLASS.
  7. 3 %PrintClass;
  8. -
  9. 180
  10. WARNING: Apparent invocation of macro PRINTCLASS not resolved.

  11. ERROR 180-322: Statement is not valid or it is used out of proper order.
复制代码
望高手们多多指教~~




二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Catalog CAT Log Publishing statement include ERROR Error 程序

衣带渐宽终不悔,为伊消得人憔悴~~
yongyitian 发表于 2014-9-12 11:47:39 |显示全部楼层 |坛友微信交流群
Error: Invalid logical Name == the name (PrintClass) is not good.

Valid logical Name should be less then 8 characters in length and
start with a character or underscore.

Try this.
filename P_class Catalog 'Sasuser.Mymacs.PrintClass.Source';
%include P_class;
%PrintClass

or change all "PrintClass" to "PrtClass"

使用道具

gaotao0727 发表于 2014-9-17 09:21:09 |显示全部楼层 |坛友微信交流群
后来又没有问题了。但您的回复别人也跟我说过,您的报错信息我这里没有显示呢~~
谢谢!

使用道具

yongyitian 发表于 2014-9-17 11:18:44 |显示全部楼层 |坛友微信交流群
gaotao0727 发表于 2014-9-17 09:21
后来又没有问题了。但您的回复别人也跟我说过,您的报错信息我这里没有显示呢~~
谢谢!
说的是一楼,第三段程序,第二行的错误信息:ERROR: Invalid logical name.

这条错误信息说的是 logical name (这里logical name 指的是 PrintClass) 有问题.

一般情况,filename 后面跟的 filerefs 最长是8个字符。

见 sas9.4  的说明http://support.sas.com/documenta ... dn1q0x296d3qek6.htm   

使用道具

gaotao0727 发表于 2014-9-17 16:45:50 |显示全部楼层 |坛友微信交流群
哦,非常感谢~~

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-3-29 18:48