全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2832 1
2013-09-06
1.ABSTRACT
SAS programmers usually lose a lot of time (and temper) when setting up a correct environment before submitting a program. For example, every time you run a program, you need to close all the datasets that are created in the program, clear the log and output windows, save the program etc. Then once the program is run, you need to open a specific dataset to check the results. In a nutshell, you always follow some fixed, time-consuming processes, before and after executing the program.
Before knowing about the DM (Display Manager), I used to say, "if only all this could be done automatically". Then DM statements came to my rescue. A DM statement stands for Display Manager Statements. It submits SAS Program Editor, Log, Procedure Output or text editor commands as SAS statements. This paper will explain the purpose, functionalities and usage of DM statements using several examples.
The intended audience is all levels of SAS users.
2.INTRODUCTION
While coding and executing the code, many redundant tasks are to be done manually. DM statements really prove to be a boon to avoid such redundancies. To date, there is no proper reference paper or document that highlights the power of DM statements. This paper aims to familiarize you with the intricacies of DM. It includes commands for you to play and automatize your chores. Happy Coding!!
3.SYNTAX
DM <window> 'command(s)' <window> <CONTINUE>;
window: Specifies the active window. (like wedit, log, output)
command: Can be any windowing command or text editor command and must be enclosed in single quotation marks. If you want to issue several commands, separate them with semicolons. (like wedit, log, output). (like clear, wpaste etc)
CONTINUE      Causes SAS to execute any SAS statements that follow the DM statement in the Program Editor window and, if a windowing command in the DM statement called a window, makes that window active.

The default is the editor window through which you submit the code. This example would clear the concept of the term <window> and <CONTINUE> as used in the syntax. Let’s understand it with the help of the log clear statement. For example:
# If you want to clear the log and return back to the editor window after submitting DM statement then:
复制代码



# Else if you want to remain at the log window then
复制代码


# If you want to clear the log and output both, and then return to log window, then
复制代码


1) Now, each time you run or debug the code, you have to save the code, clear the log and output, close the open datasets, run them, then search the library for the dataset you are working and open it. Imagine the time and clicks you save using the following code:
复制代码


2) If the name of the dataset created is dynamic then you can use the following, which opens the last created dataset.
复制代码


3) Usually when you are working with a dataset, you want to see the column names and not the column labels. The following statement helps view the column names for a specific dataset, but for other datasets, column labels would be visible.
复制代码


4) If you are adding a column to the dataset, or changing the attributes of a dataset, then you are not really interested in the entire data but just the columns and its attributes. The following command will open the column attribute window of the desired table, and not the table.
复制代码


5) To clear a cluttered results window:
复制代码


4.CONCLUSION
SAS has unlimited power in many of its unusually used statements. Rather then using the conventional methods, unraveling the mystery behind those statements could unleash newer and more expedient coding standards.





补充内容 (2013-11-3 17:09):
原文出自:http://www.clinovo.com/userfiles ... S-DM-Statements.pdf
二维码

扫码加我 拉你入群

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

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

全部回复
2014-7-15 13:17:20
以为是 Data Mining
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群