由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - My $0.02 on SAS debugging in Linux environment.
相关主题
用尽心思做好了一个macro请教SAS macro
[SAS]怎么快捷地删除Macro 里创建的临时dataset和macro variabSAS DATA 求助
Unix SAS programming vs PC SAS programmingSAS Macro求教
Need advice on SAS macro debuggingHow to set initial dataset to zero in a SAS macro?
求教proc sql 问题two SAS macro questions
SAS problem ask for help!%do questions
[合集] 问个SAS的问题Help: an I/O ERROR occured
[合集] 用SAS生成表格,怎么弄比较好?windows下用batch submit 两个SAS code文件
相关话题的讨论汇总
话题: sas话题: use话题: obs话题: linux话题: table
进入Statistics版参与讨论
1 (共1页)
D******n
发帖数: 2836
1
Let me share with you some tricks or techniques i use to debug or facilitate
debugging SAS codes in Linux environment.
> proc print with obs= option. (ya very simple very naive)
> endsas statement.
> /* */ to comment out codes.
> sas -obs ### xxxx.sas (SAS options need not to be hard written in the
script, you can call it when batch running it)
> use put in data step to monitor SAS variable.
> use mprint, mlogic, symbolgen, source, source2 to debug macros.
> use %put to monitor macro variable.
> modularize your codes and encapsulate your macros.
Advanced:
> Write and use scripts to print (or count # of obs, or do freq or do basic
stat) SAS datasets directly to terminal.
> Use "sas -notermwork -work . yyyy.sas" to save WORK library and redirect
it to current folder for inspection.(To save time and disk space, use it in
conjunction with -obs ### option).
Any input out of your experience is welcomed.
k*****u
发帖数: 1688
2
dont forget to check ERROR WARNING in the log file.
send out output to email.
merge/inner join/ left join/ right join, don't forget to check if they are
correct. check if the key variable should be unique or not.
Join a small table with a large table, index them .
join a large table with a large table(I once did a 3M table left join
1billion table), proc sql left join takes more than 3 days and not finished.
Then I tried split the 2M table to a small table with 5k obs each, then use
macro and loops to join iteratively. I took about 2 days to finish.
huge table? Please hadoop. I tried a 30M obs table join with a 30M obs table
, Hive took less than 70 minutes.

--------------------
Let me share with you some tricks or techniques i use to debug or facilitate
debugging SAS codes in Linux environment.
> proc print with obs= option. (ya very simple very naive)
> endsas statement.
> /* */ to comment out codes.
> sas -obs ### xxxx.sas (SAS options need not to be hard written in the
script, you can call it when batch running it)
> use put in data step to monitor SAS variable.
> use mprint, mlogic, symbolgen, source, source2 to debug macros.
> use %put to monitor macro variable.
> modularize your codes and encapsulate your macros.
Advanced:
> Write and use scripts to print (or count # of obs, or do freq or do basic
stat) SAS datasets directly to terminal.
> Use "sas -notermwork -work . yyyy.sas" to save WORK library and redirect
it to current folder for inspection.(To save time and disk space, use it in
conjunction with -obs ### option).
Any input out of your experience is welcomed.
D******n
发帖数: 2836
3
I wrote a script to check all the error/warning messages.
I always run it when the SAS job is done.
finished.
use
table
1 (共1页)
进入Statistics版参与讨论
相关主题
windows下用batch submit 两个SAS code文件求教proc sql 问题
SAS Programmer for clinical trialsSAS problem ask for help!
一个SAS Macro和Append的问题,救助![合集] 问个SAS的问题
关于SAS interview[合集] 用SAS生成表格,怎么弄比较好?
用尽心思做好了一个macro请教SAS macro
[SAS]怎么快捷地删除Macro 里创建的临时dataset和macro variabSAS DATA 求助
Unix SAS programming vs PC SAS programmingSAS Macro求教
Need advice on SAS macro debuggingHow to set initial dataset to zero in a SAS macro?
相关话题的讨论汇总
话题: sas话题: use话题: obs话题: linux话题: table