楼主: LiouPerng
8730 4

[原创博文] quit和run的区别是什么?求详解。 [推广有奖]

  • 0关注
  • 1粉丝

初中生

85%

还不是VIP/贵宾

-

威望
0
论坛币
1279 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
130 点
帖子
15
精华
0
在线时间
12 小时
注册时间
2012-6-22
最后登录
2023-9-27

楼主
LiouPerng 发表于 2012-7-21 08:27:31 |AI写论文
2论坛币
什么时候用quit,什么时候用run,区别在哪里。

关键词:quit qui Run uit

沙发
YueweiLiu 发表于 2012-7-21 10:16:21
  1. Allow me to weigh in on this topic. It comes up alot when I give SAS training classes. First, RUN and QUIT are both "explicit step boundaries" in the SAS Programming Language. PROC and DATA are "implied step boundaries."

  2. Example 1: Two explicit step boundaries.

  3. DATA NEW;
  4. SET OLD:
  5. C = A + B;
  6. RUN;
  7. PROC PRINT DATA=NEW;
  8. RUN;

  9. In this example, both the data and the proc steps are explicitly "ended" by their respective RUN statements.

  10. Example 2: No explicit step boundaries.

  11. DATA NEW;
  12. SET OLD;
  13. C = A + B;
  14. PROC PRINT DATA=NEW;

  15. In this example, the data step is implicitly terminated by the PROC statement. But, there is no step boundary for the PROC PRINT step/task, so it will not terminate unless/until the SAS supervisor "receives" a step boundary.

  16. Some PROCS support what is called RUN group processing. These include PROCs DATASETS and PLOT in the BASE Module, PROCs REG and GLM in the STAT module and ARIMA in the ETS module.

  17. Example 3: PROC DATASETS with RUN group processing.

  18. PROC DATASETS LIBRARY = MYLIB;
  19. MODIFY SET1;
  20. FORMAT VAR1 DOLLAR12.2;
  21. LABEL VAR1 "Dollars Paid";
  22. RUN;

  23. DELETE SET2;
  24. RUN;

  25. CHANGE SET3 = SET2;
  26. RUN;
  27. QUIT;


  28. In this example, three separate data mangement tasks are carried out in the order they were written/coded. First a label and format are added to the descriptor portion of SET1, then SET 2 is deleted, and then SET3 is renamed to SET2. The RUN ends each command in the PROC DATASETS step (MODIFY, DELETE, CHANGE) and QUIT ends the step. If the explicit step boundary had been omitted, the step would have been implicity terminated by a subsequent PROC or DATA statement. If there were no implied step boundary following the last RUN command then the PROC DATASETS step would not terminate.

  29. The same holds true with other RUN-group enabled PROCs in SAS Software. The ARIMA procedure in the ETS module, for example, implements what is called the Box-Jenkins methodology to analyze a time series and then generate future forecasted values from the existing series. There are three parts to this methodology, which are implmented in PROC ARIMA using (in this order), the IDENTIFY, ESTIMATE and FORECAST statements. The output from each statement is needed by PROC ARIMA to move to the next step in the process, and an experienced forecaster can look at the output generated by the IDENTIFY statement and then write the appropriate ESTIMATE statement syntax, and then do the same thing with the output generated by the ESTIMATE statement to write the proper FORECAST statement syntax. Once the analyst is satisfied with their model, they can terminate the PROC ARIMA step with a QUIT statement and move on to the next part of their project.
复制代码
reference: http://studysas.blogspot.com/201 ... n-run-and-quit.html

藤椅
hcydlee 发表于 2012-7-23 16:33:21
学习了
80 字节以内
不支持自定义 Discuz! 代码

板凳
qiuxiang735 发表于 2012-7-23 16:50:39

报纸
Bridgenc 发表于 2012-7-23 19:46:54
The Run Statement tells SAS to run the previous statements( Ie. the just
compiled data step or procedure).  It is a step boundary that says this
is the end of the step or procedure now go run the code.  You dont have
to use the Run statement the start of another data step or procedure
will do the trick too.  However using the Run statement will clean up
your log.

The Quit statement is also a Step boundary.  A few Procs allow one to
run multiple steps within a procedure without having to end the
procedure.  In these cases you specify a Run statement to end a step
with in that procedure and a Quit statement to end the procedure.

SQL is a bit of an odd ball as it requires a Quit statement but a Run
statement wil be ignored.  This is due to the fact that it Executes each
statement automatically, so no need for a Run Group Processing but a
definite need for a Ending Step Boundary.
已有 1 人评分论坛币 收起 理由
r_luoca + 5 精彩帖子

总评分: 论坛币 + 5   查看全部评分

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-2-5 18:57