楼主: yzzhang
10577 7

[问答] 请教:如何删除宏变量和自定义输出输入格式? [推广有奖]

  • 1关注
  • 0粉丝

已卖:93份资源

博士生

52%

还不是VIP/贵宾

-

威望
0
论坛币
1979 个
通用积分
2.9500
学术水平
2 点
热心指数
1 点
信用等级
0 点
经验
569 点
帖子
116
精华
0
在线时间
459 小时
注册时间
2009-2-17
最后登录
2025-12-15

楼主
yzzhang 发表于 2010-11-30 09:45:45 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
大家好,请问下如何删除宏变量和自定义输出输入格式?多谢了!
二维码

扫码加我 拉你入群

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

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

关键词:自定义 大家好 请教 变量 格式 定义 输出

回帖推荐

myzhang1982 发表于2楼  查看完整内容

%symdel ; 删除宏变量 删除输入输出格式 PROC DATASETS lib=work; MODIFY dsn; FORMAT _all_; INFORMAT _all_; RUN; QUIT; *work is the library name; *mention the name of the SAS dataset, whose formats and informats needs to be removed in the MODIFY statement; * format _all_ will delete all the formats in the SAS dataset.

本帖被以下文库推荐

沙发
myzhang1982 在职认证  发表于 2010-11-30 10:26:45
%symdel  <宏变量名>;     删除宏变量

删除输入输出格式
PROC DATASETS lib=work;
MODIFY dsn;
FORMAT _all_;
INFORMAT _all_;
RUN;
QUIT;

*work is the library name;
*mention the name of the SAS dataset, whose formats and informats needs to be removed in the MODIFY statement;
* format _all_ will delete all the formats in the SAS dataset.
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
soporaeternus + 1 + 1 + 1 学习了

总评分: 学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

藤椅
yzzhang 发表于 2010-11-30 10:28:42
非常感谢!!!

2# myzhang1982

板凳
yzzhang 发表于 2010-11-30 11:05:11
试了一下,删除宏变量没有问题,但是删除输入输出格式可能不是我的意思,你那种方法只是对数据集变量的格式进行修改;
例如:我用proc format cntlin=a; run;定义了一个输出格式,名称为“fmt_a”。现在想把fmt_a的自定义格式删除,避免被别的误引用,该怎么做?!
多谢了!



2# myzhang1982

报纸
bobguy 发表于 2010-12-1 07:44:55
yzzhang 发表于 2010-11-30 09:45
大家好,请问下如何删除宏变量和自定义输出输入格式?多谢了!
The local macro variables live with their scopes. You only need to take care of GLOBAL ones. Here is simple one to 'kill' them all.


%let a=a; %let b=b;    %let c=c;
%put >>>&a &b &c<<<;


proc sql noprint;
DESCRIBE TABLE dictionary.macros;
select name into: mvarlist separated by ' '
from  dictionary.macros
where scope ='GLOBAL' and not index(name,'SYS') ;
quit;

%put &mvarlist;

%symdel  &mvarlist     ;
%symdel mvarlist;

%put _all_;
*********************************************************************************
You can use proc catalog to kill all format/informat were defined in a library as,

proc format ;
value $wert
s=1
r=2
other=0
;
run;

  data t1;
    a='s';
    put a $wert.;
run;

proc catalog cat=work.formats kill;
run;

data t1;
    a='s';
    put a $wert.;
run;
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
soporaeternus + 1 + 1 + 1 学习了

总评分: 学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

地板
yzzhang 发表于 2010-12-1 09:07:12
非常感谢!祝快乐!
5# bobguy

7
oneoneagain 发表于 2013-1-9 12:21:26
学习了~~~

8
tangliang0905 发表于 2013-1-9 13:26:21 来自手机
good

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-26 18:34