<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8282945</id><updated>2011-04-21T20:43:00.550-07:00</updated><title type='text'>programming reflection</title><subtitle type='html'>Television is NOT real life. In real life people actually have to leave the coffee shop and go to jobs.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>92</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8282945.post-110049109288294457</id><published>2004-11-14T19:57:00.000-08:00</published><updated>2004-11-14T19:58:12.883-08:00</updated><title type='text'>image in DirectDraw</title><content type='html'>DirectDraw can only handle Windows bitmap (.bmp) images directly. This does not mean you can't use .Gif or .Jpg images at all. These picture types it requires to create a filetype specific loader, and then load the surface from memory by using the DirectDraw CreateSurfaceFromResource function. &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-110049109288294457?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/110049109288294457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=110049109288294457' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/110049109288294457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/110049109288294457'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/11/image-in-directdraw.html' title='image in DirectDraw'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109962416828426242</id><published>2004-11-04T19:08:00.000-08:00</published><updated>2004-11-04T19:09:28.283-08:00</updated><title type='text'>基于XML的数据库总体分析</title><content type='html'>我们知道当存在大量数据需要处理分析的话，最好是把这些数据放到数据库中，所以几乎所有大型的商业应用系统都是和数据库相关联的，所以如果XML需要在商业领域大展宏图的话，也必须要和数据库相联系。所以这里首先需要讨论的一点问题是，XML本身是不是数据库，从严格的意义上来说，XML仅仅意味着XML文档。因为尽管一个XML文档包含数据，但是如果不通过其他的软件的软件来进行数据处理的话，它本身只不过是一个文本文件。所以XML本身不不能和数据库挂上钩，但是加上一些其他的辅助工具，我们可以把整个XML看成是一个数据库系统，XML文本本身可以看成是数据库中的数据区，DTD或者Schemas可以看成是数据库模式设计，XQL可以看成是数据库查询语言，SAX或DOM可以看成是数据库处理工具。当然它还是缺少数据库所必须的一些东西，比如有效的存储组织、索引结构、安全性、事务处理、数据完整性、触发器、多用户处理机制等等。&lt;br /&gt;&lt;br /&gt;　　但是为什么要把XML和数据库相联系呢？举个例子来说明这个问题，比如你有一个电子商务的应用程序需要使用XML来进行数据传输。你所关心的是数据本身应该具有的结构，你并不关心它在文档中实际的存储结构。如果你的应用程序很简单的话，基本的文件系统将满足你的需求，但如果应用本身很复杂的话，你就需要一个完整的开发应用环境来支持XML。从另一个方面来说，假设你有一个Web站点，它的内容是由一系列XML文档构成的，你不仅要管理这个站点，同时你需要提供给用户一个搜索该站点内容的机制。而这些都需要借助数据库来实现。选择一个数据库的最重要的因素是你是否需要数据库来存储数据或者是文档，如果你想要存储数据的话，你需要一个关系数据库或者是对象数据库来存储实际的数据，同时你需要中间件在数据库和XML文档之间建立桥梁关系，从另一方面来说，如果你想要存储文档，你需要一个内容管理系统，通过它进行文档的存储。实际上，XML文档可以分到两大类:以数据为中心或者以文档为中心。&lt;br /&gt;&lt;br /&gt;　　以数据为中心的文档：数据为中心的文档有非常规则的结果，比如关于销售订单或者是饭店菜单的XML文档。以数据为中心的文档通常是为机器设计的，也就是说主要是方便机器进行处理。通常，任何Web站点可以动态的构建HTML文档，其步骤如下，根据用户的查询请求找到相关的面向数据的XML文档，然后通过XSL对XML文档进行转化，让基于HTML的浏览器能够方便的浏览结果。&lt;br /&gt;&lt;br /&gt;　　以文档为中心的文档：以文档为中心的文档具有不规则的结构，而且数据的粒度也比较大。具体的例子如书本、电子邮件、广告等等。以文档为中心的文档主要是用人类而设计的。 &lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109962416828426242?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109962416828426242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109962416828426242' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109962416828426242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109962416828426242'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/11/xml.html' title='基于XML的数据库总体分析'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109926704867285431</id><published>2004-10-31T15:56:00.000-08:00</published><updated>2004-10-31T15:57:28.673-08:00</updated><title type='text'>what' s a servlets?</title><content type='html'>Servlets are modules of Java code that run in a server application (hence the name "Servlets", similar to "Applets" on the client side) to answer client requests. Servlets are not tied to a specific client-server protocol but they are most commonly used with HTTP and the word "Servlet" is often used in the meaning of "HTTP Servlet".&lt;br /&gt;&lt;br /&gt;Servlets make use of the Java standard extension classes in the packages javax.servlet (the basic Servlet framework) and javax.servlet.http (extensions of the Servlet framework for Servlets that answer HTTP requests). Since Servlets are written in the highly portable Java language and follow a standard framework, they provide a means to create sophisticated server extensions in a server and operating system independent way.&lt;br /&gt;&lt;br /&gt;Typical uses for HTTP Servlets include:&lt;br /&gt;&lt;br /&gt;Processing and/or storing data submitted by an HTML form.&lt;br /&gt;&lt;br /&gt;Providing dynamic content, e.g. returning the results of a database query to the client.&lt;br /&gt;&lt;br /&gt;Managing state information on top of the stateless HTTP, e.g. for an online shopping cart system which manages shopping carts for many concurrent customers and maps every request to the right customer.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109926704867285431?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109926704867285431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109926704867285431' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109926704867285431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109926704867285431'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/what-s-servlets.html' title='what&apos; s a servlets?'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109926509034101725</id><published>2004-10-31T15:16:00.000-08:00</published><updated>2004-10-31T15:50:52.016-08:00</updated><title type='text'>how to install eclipse</title><content type='html'>Eclipse是开放源代码的项目，可以到www.eclipse.org去免费下载Eclipse的最新版本，一般Eclipse提供几个下载版本：Release，Stable Build，Integration Build和Nightly Build，建议下载Release或Stable版。&lt;br /&gt;&lt;br /&gt;Eclipse本身是用Java语言编写，但下载的压缩包中并不包含Java运行环境，需要用户自己另行安装JRE，并且要在操作系统的环境变量中指明JRE中bin的路径。&lt;br /&gt;&lt;br /&gt;安装Eclipse的步骤非常简单：只需将下载的压缩包按原路径直接解压既可。需注意如果有了更新的版本，要先删除老的版本重新安装，不能直接解压到原来的路径覆盖老版本。在解压缩之后可以到相应的安装路径去找Eclipse.exe运行。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href= http://www.3plus4software.de/eclipse/index_en.html&gt; a good tutorial for Eclipse &lt;/a&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109926509034101725?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109926509034101725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109926509034101725' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109926509034101725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109926509034101725'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/how-to-install-eclipse.html' title='how to install eclipse'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109806165692988584</id><published>2004-10-17T18:06:00.000-07:00</published><updated>2004-10-17T18:07:36.930-07:00</updated><title type='text'>var in proc print</title><content type='html'>var c:;&lt;br /&gt;&lt;br /&gt;output all variables beginning with 'c' in data set variable order (i.e., cityMPG, Capacity, Cylinders)&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109806165692988584?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109806165692988584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109806165692988584' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109806165692988584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109806165692988584'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/var-in-proc-print.html' title='var in proc print'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109798648582605482</id><published>2004-10-16T21:13:00.000-07:00</published><updated>2004-10-16T21:14:45.826-07:00</updated><title type='text'>length of numeric variable in SAS</title><content type='html'>the maximum storage length for a SAS numeric is eight (8) bytes. A number with sixteen (16) digits on some operating system or seventeen (17) on other operating system can be accurately stored with an internal storage of eight bytes.&lt;br /&gt;&lt;br /&gt;In conclusion, the internal storage length of a SAS numeric is different from its display length.&lt;br /&gt;&lt;br /&gt;The internal storage ranges from a minimum of two or three bytes (depending on the operating system) to a maximum of eight bytes.&lt;br /&gt;The display length ranges from one digit to a number up to 16 or 17 digits long (depending on the operating system). Any digit longer than 16 or 17 places may not display correctly.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109798648582605482?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109798648582605482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109798648582605482' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109798648582605482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109798648582605482'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/length-of-numeric-variable-in-sas.html' title='length of numeric variable in SAS'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109797880784384151</id><published>2004-10-16T18:55:00.000-07:00</published><updated>2004-10-16T19:06:47.843-07:00</updated><title type='text'>cards definition</title><content type='html'>data numrecords;&lt;br /&gt;infile cards dlm=',';&lt;br /&gt;input agent1 $ agent2 $ agent3 $;&lt;br /&gt;cards;&lt;br /&gt;jones,,brownjones,spencer,brown&lt;br /&gt;;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;In this example:&lt;br /&gt;The CARDS statement enables you to read instream data. Any number of consecutive commas are considered to be a single delimiter as a result of the DLM= option, and the length of each variable defaults to 8 bytes. Therefore, the values jones, brownjon, and spencer are assigned to Agent1, Agent2, and Agent3, respectively, for the first observation. &lt;span style="color:#ff0000;"&gt;The rest of the data on the record is not read by the INPUT statement and is not output to the data set&lt;/span&gt;. &lt;a href="http://www.sas.com/apps/OLTRN/59080/m00/certquizx.htm#topofpage"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here, I came to such a conclusion: input line decides how far the sas goes through one record. Here, only three columns in the input statement, so sas only went over three variables in a record since it thought that it had got enough information.&lt;br /&gt;&lt;br /&gt;data numrecords;  &lt;br /&gt;infile cards dlm=',';  &lt;br /&gt;input agent1 $ agent2 $;&lt;br /&gt;cards;&lt;br /&gt;jones,,brownjones,spencer,brown;&lt;br /&gt;run; &lt;br /&gt;&lt;br /&gt;And then it shows to me that I got only one observation with 2 variables.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109797880784384151?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109797880784384151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109797880784384151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109797880784384151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109797880784384151'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/cards-definition.html' title='cards definition'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109754630454839846</id><published>2004-10-11T18:32:00.000-07:00</published><updated>2004-10-11T18:58:24.546-07:00</updated><title type='text'>proc printto block</title><content type='html'>proc printto print/log='alternate-output-file' new;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;proc print data=sat_scores;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;proc printto;&lt;br /&gt;run;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109754630454839846?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109754630454839846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109754630454839846' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109754630454839846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109754630454839846'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/proc-printto-block.html' title='proc printto block'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109739064129236008</id><published>2004-10-09T23:33:00.000-07:00</published><updated>2004-10-09T23:50:05.783-07:00</updated><title type='text'>the length of a character variable</title><content type='html'>To specify the length of a character variable, you need to supply an informat or use column numbers.&lt;br /&gt;&lt;br /&gt;For example, following a variable name in the input statement with the informat $20., or with column specifications such as 1-20, creates a character variable that is 20 bytes long.&lt;br /&gt;&lt;br /&gt;Note that the length of numeric variables is &lt;span style="color:#ff0000;"&gt;not&lt;/span&gt; affected by informats or column specifications in an input statement.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109739064129236008?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109739064129236008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109739064129236008' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109739064129236008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109739064129236008'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/length-of-character-variable.html' title='the length of a character variable'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109727756295799141</id><published>2004-10-08T16:16:00.000-07:00</published><updated>2004-10-08T16:19:22.956-07:00</updated><title type='text'>converting variables</title><content type='html'>character to numeric:&lt;br /&gt;&lt;br /&gt;newvar = &lt;span style="color:#ff0000;"&gt;input&lt;/span&gt;(oldvar, informat);&lt;br /&gt;&lt;br /&gt;numeric to character:&lt;br /&gt;&lt;br /&gt;newvar = &lt;span style="color:#ff0000;"&gt;put&lt;/span&gt;(oldvar, format);&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109727756295799141?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109727756295799141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109727756295799141' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109727756295799141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109727756295799141'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/converting-variables.html' title='converting variables'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109708556518973490</id><published>2004-10-06T10:57:00.000-07:00</published><updated>2004-10-06T10:59:25.190-07:00</updated><title type='text'>trim and length</title><content type='html'>The following SAS program is submitted:&lt;br /&gt;data work.test;&lt;br /&gt;length city $20;&lt;br /&gt;city='Paris';&lt;br /&gt;city2=trim(city);&lt;br /&gt;run;&lt;br /&gt;Which one of the following is the length of the city2 variable?&lt;br /&gt;a.5&lt;br /&gt;b.6&lt;br /&gt;c.8&lt;br /&gt;d.20&lt;br /&gt;&lt;br /&gt;The LENGTH statement specifies that the variable city has a length of 20 characters. The TRIM function in the assignment statement for city2 removes trailing blanks from the value. However, the length of the city2 variable is set to 20 because city has a length of 20, and SAS pads the trimmed value with extra blanks.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109708556518973490?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109708556518973490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109708556518973490' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109708556518973490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109708556518973490'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/trim-and-length.html' title='trim and length'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109708413937911037</id><published>2004-10-06T10:34:00.000-07:00</published><updated>2004-10-06T10:35:39.380-07:00</updated><title type='text'>pagesize option</title><content type='html'>The PAGESIZE= SAS system option controls the number of lines that compose a page of SAS procedure output. By increasing the number of lines available per page, the report might fit on one page&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109708413937911037?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109708413937911037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109708413937911037' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109708413937911037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109708413937911037'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/pagesize-option.html' title='pagesize option'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109708351695837042</id><published>2004-10-06T10:22:00.000-07:00</published><updated>2004-10-06T11:02:31.023-07:00</updated><title type='text'>best12. format</title><content type='html'>An automatic data conversion is performed whenever a numeric variable is used where SAS expects a character value. The numeric variable is written with the BEST12. format and the resulting character value is right-aligned when the conversion occurs.&lt;br /&gt;&lt;br /&gt;This conversion occurs before the value is assigned or used with any operator or function. Automatic numeric-to-character conversion can cause unexpected results. For example, suppose the original numeric value has fewer than 12 digits. The resulting character value will have leading blanks, which might cause problems when you perform an operation or function.&lt;br /&gt;&lt;br /&gt;data work.areacodes;&lt;br /&gt;Phonenumber=3125551212;&lt;br /&gt;Code='('!!substr(Phonenumber,1,3)!!')';&lt;br /&gt;run;&lt;br /&gt;Which one of the following is the value of the variable Code in the output data set?&lt;br /&gt;&lt;br /&gt;a.( 3)&lt;br /&gt;b.(312)&lt;br /&gt;c.3&lt;br /&gt;d.312&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109708351695837042?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109708351695837042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109708351695837042' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109708351695837042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109708351695837042'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/best12-format.html' title='best12. format'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109708313501767334</id><published>2004-10-06T10:17:00.000-07:00</published><updated>2004-10-07T21:36:39.083-07:00</updated><title type='text'>missing value in a mean function</title><content type='html'>The MEAN function adds all of the non-missing values and divides by the number of non-missing values. In this case, 6 + 4 + 2 divided by 3 is 4.&lt;br /&gt;data test;&lt;br /&gt;average=mean(6,4,.,2);&lt;br /&gt;run;What is the value of average?&lt;br /&gt;&lt;br /&gt;Sum procedure does the same way.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109708313501767334?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109708313501767334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109708313501767334' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109708313501767334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109708313501767334'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/missing-value-in-mean-function.html' title='missing value in a mean function'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109708232880328752</id><published>2004-10-06T10:04:00.000-07:00</published><updated>2004-10-06T10:05:28.803-07:00</updated><title type='text'>length of a variable</title><content type='html'>The length of a variable is set during the compilation phase and is based on &lt;span style="color:#ff0000;"&gt;the first time the variable is encountered&lt;/span&gt;.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109708232880328752?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109708232880328752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109708232880328752' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109708232880328752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109708232880328752'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/length-of-variable.html' title='length of a variable'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109708199507597688</id><published>2004-10-06T09:58:00.000-07:00</published><updated>2004-10-06T09:59:55.076-07:00</updated><title type='text'>fslist procedure</title><content type='html'>The PRINT procedure and VIEWTABLE window display the values in SAS data sets. The FSLIST procedure displays the values in external files. There is no LIST procedure in SAS.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109708199507597688?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109708199507597688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109708199507597688' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109708199507597688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109708199507597688'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/fslist-procedure.html' title='fslist procedure'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109708173566723996</id><published>2004-10-06T09:55:00.000-07:00</published><updated>2004-10-06T09:55:35.666-07:00</updated><title type='text'>date format</title><content type='html'>DDMMYYYY10. is not a valid SAS date format, and the DATEw. format cannot accept a length of 10.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109708173566723996?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109708173566723996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109708173566723996' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109708173566723996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109708173566723996'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/date-format.html' title='date format'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109708072713003327</id><published>2004-10-06T09:12:00.000-07:00</published><updated>2004-10-06T09:38:47.130-07:00</updated><title type='text'>dlm=</title><content type='html'>data numrecords;&lt;br /&gt;infile cards dlm=',';&lt;br /&gt;input agent1 $ agent2 $ agent3 $;&lt;br /&gt;cards;&lt;br /&gt;jones,,brownjones,spencer,brown&lt;br /&gt;;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;Any number of consecutive commas are considered to be a single delimiter as a result of the DLM= option&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109708072713003327?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109708072713003327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109708072713003327' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109708072713003327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109708072713003327'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/dlm.html' title='dlm='/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109677992051084697</id><published>2004-10-02T22:03:00.000-07:00</published><updated>2004-10-02T22:05:20.510-07:00</updated><title type='text'>dsd again</title><content type='html'>What happens if you need to create a comma-delimited file that requires the use of a format that writes out values using commas?&lt;br /&gt;If you used the following program, the resulting raw data file would &lt;span style="color:#ff0000;"&gt;contain five fields rather than four&lt;/span&gt;.&lt;br /&gt;data _null_;&lt;br /&gt;set perm.finance;&lt;br /&gt;file 'c:\data\findat2' dlm=',';&lt;br /&gt;put ssn name salary : comma6. date : date9.;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can use the DSD option in the FILE statement to specify that data values containing commas should be enclosed in quotation marks. Remember that the DSD option uses a comma as a delimiter, so a DLM= option isn't necessary here.&lt;br /&gt;data _null_;&lt;br /&gt;set perm.finance;&lt;br /&gt;file 'c:\data\findat2' dsd;&lt;br /&gt;put ssn name salary : comma. date : date9.;&lt;br /&gt;run;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109677992051084697?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109677992051084697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109677992051084697' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109677992051084697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109677992051084697'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/dsd-again.html' title='dsd again'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109677465037225417</id><published>2004-10-02T20:36:00.000-07:00</published><updated>2004-10-02T21:01:24.076-07:00</updated><title type='text'>modified list input</title><content type='html'>There are two modifiers that can be used with list input.&lt;br /&gt;&lt;br /&gt;The ampersand (&amp;) modifier is used to read character values that contain embedded blanks.&lt;br /&gt;&lt;br /&gt;1.Using the &amp;amp; Modifier with a LENGTH Statement :&lt;br /&gt;data perm.cityrank;&lt;br /&gt;infile topten;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;length City $ 12; &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;input Rank city &amp;amp;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;2.Using the &amp; Modifier with an Informat :&lt;br /&gt;data perm.cityrank;&lt;br /&gt;infile topten;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;input Rank City &amp; $12.;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The colon (:) modifier is used to read nonstandard data values and character values that are longer than eight characters, but which contain no embedded blanks.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109677465037225417?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109677465037225417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109677465037225417' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109677465037225417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109677465037225417'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/modified-list-input.html' title='modified list input'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109677422950611641</id><published>2004-10-02T20:26:00.000-07:00</published><updated>2004-10-02T20:30:29.506-07:00</updated><title type='text'>length and the order of varibles</title><content type='html'>Because variable attributes are defined when the variable is first encountered in the DATA step, a variable that is defined in a LENGTH statement (if it precedes an INPUT statement) will appear &lt;span style="color:#ff0000;"&gt;first &lt;/span&gt;in the data set, regardless of the order of the variables in the INPUT statement.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109677422950611641?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109677422950611641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109677422950611641' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109677422950611641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109677422950611641'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/length-and-order-of-varibles.html' title='length and the order of varibles'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109677222141647835</id><published>2004-10-02T19:56:00.000-07:00</published><updated>2004-10-02T20:11:12.936-07:00</updated><title type='text'>missover and dsd</title><content type='html'>The MISSOVER option works only for missing values that occur &lt;span style="color:#ff0000;"&gt;at the end of the record. &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;if missing values occur at the beginning or in the middle of the record, we cannot use MISSOVER to fix this problem. Instead, we need DSD, sometimes with DLM= &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;data perm.survey;       &lt;br /&gt;infile credit dsd dlm='*';     &lt;br /&gt;input Gender $ Age Bankcard FreqBank Deptcard FreqDept;    &lt;br /&gt;run;    &lt;br /&gt;proc print data=perm.survey;    &lt;br /&gt;run;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109677222141647835?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109677222141647835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109677222141647835' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109677222141647835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109677222141647835'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/missover-and-dsd.html' title='missover and dsd'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109676613546184825</id><published>2004-10-02T18:14:00.000-07:00</published><updated>2004-10-02T18:15:35.460-07:00</updated><title type='text'>pad </title><content type='html'>When reading variable-length records that contain fixed-field data, you can avoid problems by using the PAD option in the INFILE statement.&lt;br /&gt;The PAD option pads each record with blanks so that all data lines have the same length.&lt;br /&gt;&lt;br /&gt;infile receipts pad;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109676613546184825?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109676613546184825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109676613546184825' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109676613546184825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109676613546184825'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/pad.html' title='pad '/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109674671548044651</id><published>2004-10-02T13:50:00.000-07:00</published><updated>2004-10-02T12:51:55.480-07:00</updated><title type='text'>dim</title><content type='html'>When using DO loops to process arrays, you can also use the DIM function to specify the TO clause of the iterative DO statement.&lt;br /&gt;&lt;br /&gt;In this example, dim(wt) returns the dimension of the array, 6 here.&lt;br /&gt;&lt;br /&gt;data hrd.convert;&lt;br /&gt;set hrd.fitclass;&lt;br /&gt;array wt{*} weight1-weight6;&lt;br /&gt;do i=1 to dim(wt);&lt;br /&gt;wt{i}=wt{i}*2.2046;&lt;br /&gt;end;&lt;br /&gt;run;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109674671548044651?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109674671548044651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109674671548044651' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109674671548044651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109674671548044651'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/dim.html' title='dim'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109674852601831792</id><published>2004-10-02T13:20:00.000-07:00</published><updated>2004-10-02T13:22:06.016-07:00</updated><title type='text'>Creating Temporary Array Elements </title><content type='html'>To create temporary array elements for DATA step processing without creating new variables, specify _TEMPORARY_ after the array name and dimension.&lt;br /&gt;&lt;br /&gt;data finance.report(drop=i);&lt;br /&gt;set finance.qsales;&lt;br /&gt;array sale{4} sales1-sales4;&lt;br /&gt;array goal{4} _temporary_ (9000 9300 9600 9900);&lt;br /&gt;array Achieved{4};&lt;br /&gt;do i=1 to 4;&lt;br /&gt;achieved{i}=100*sale{i}/goal{i};&lt;br /&gt;end;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;Temporary array elements are useful when the array is needed only to perform a calculation. You can improve performance time by using temporary array elements.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109674852601831792?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109674852601831792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109674852601831792' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109674852601831792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109674852601831792'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/creating-temporary-array-elements.html' title='Creating Temporary Array Elements '/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109673839697184484</id><published>2004-10-02T10:32:00.000-07:00</published><updated>2004-10-02T10:35:14.676-07:00</updated><title type='text'>_NUMERIC_ </title><content type='html'>_NUMERIC_ specifies all numeric variables that have already been defined in the current DATA step.&lt;br /&gt;&lt;br /&gt;array sales{*} _numeric_;&lt;br /&gt;&lt;br /&gt;_CHARACTER_ specifies all character variables that have already been defined in the current DATA step.&lt;br /&gt;&lt;br /&gt;array sales{*} _character_;&lt;br /&gt;&lt;br /&gt;_ALL_ specifies all variables that have already been defined in the current DATA step. The variables must all be of the same type: all character or all numeric.&lt;br /&gt;&lt;br /&gt;array sales{*} _all_;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109673839697184484?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109673839697184484/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109673839697184484' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109673839697184484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109673839697184484'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/numeric.html' title='_NUMERIC_ '/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109669935223716168</id><published>2004-10-01T23:40:00.000-07:00</published><updated>2004-10-01T23:42:32.236-07:00</updated><title type='text'>a good example about do loop</title><content type='html'>suppose you would like to sample every tenth observation of the 5,000 observations in Factory.Widgets.&lt;br /&gt;&lt;br /&gt;data work.subset;       &lt;br /&gt;do sample=10 to 5000 by 10;          &lt;br /&gt;set factory.widgets   point=sample;          &lt;br /&gt;output;       &lt;br /&gt;end;       &lt;br /&gt;stop;   &lt;br /&gt;run;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109669935223716168?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109669935223716168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109669935223716168' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109669935223716168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109669935223716168'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/10/good-example-about-do-loop.html' title='a good example about do loop'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109659684366462541</id><published>2004-09-30T19:13:00.000-07:00</published><updated>2004-09-30T19:14:03.666-07:00</updated><title type='text'>end </title><content type='html'>END=variable&lt;br /&gt;where variable creates and names a temporary variable that contains an end-of-file marker.&lt;br /&gt;&lt;br /&gt;Do not specify END= with POINT=. POINT= reads only a specific observation, so the last observation in the data set is not encountered.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109659684366462541?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109659684366462541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109659684366462541' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109659684366462541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109659684366462541'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/end.html' title='end '/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109651355244549767</id><published>2004-09-29T20:03:00.000-07:00</published><updated>2004-09-29T20:05:52.446-07:00</updated><title type='text'>location of length </title><content type='html'>What is the length of the variable Type, as created in the DATA step below?&lt;br /&gt;data finance.newloan;&lt;br /&gt;set finance.records;&lt;br /&gt;TotLoan+payment;&lt;br /&gt;if code='1' then Type='Fixed';&lt;br /&gt;else Type='Variable';&lt;br /&gt;length type $ 10;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;a.5&lt;br /&gt;b.8&lt;br /&gt;c.10&lt;br /&gt;d.it depends on the first value of Type&lt;br /&gt;&lt;br /&gt;The length of a new variable is determined by the first reference in the DATA step, not by data values. In this case, the length of Type is determined by the value Fixed. The LENGTH statement is in the wrong place; it must be read before any other reference to the variable in the DATA step. &lt;span style="color:#ff0000;"&gt;The LENGTH statement cannot change the length of an existing variable. &lt;/span&gt;&lt;a href="http://www.sas.com/apps/OLTRN/59080/m39/m39_35x.htm#topofpage"&gt;&lt;/a&gt;&lt;span style="color:#ff0000;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109651355244549767?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109651355244549767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109651355244549767' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109651355244549767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109651355244549767'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/location-of-length.html' title='location of length '/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109649429749409228</id><published>2004-09-29T14:44:00.000-07:00</published><updated>2004-09-29T14:44:57.493-07:00</updated><title type='text'>table in proc freq</title><content type='html'>To specify the variables to be processed by the FREQ procedure, include a TABLES statement.&lt;br /&gt;&lt;br /&gt;General form, TABLES statement:&lt;br /&gt;TABLES variable(s);&lt;br /&gt;&lt;br /&gt;where variable(s) lists the variables to include.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109649429749409228?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109649429749409228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109649429749409228' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109649429749409228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109649429749409228'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/table-in-proc-freq.html' title='table in proc freq'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109649292873030272</id><published>2004-09-29T14:20:00.000-07:00</published><updated>2004-09-29T14:22:08.730-07:00</updated><title type='text'>proc means and proc summary</title><content type='html'>The difference between the two procedures is that PROC MEANS produces a report by default (remember that you can use the NOPRINT option to suppress the default report).&lt;br /&gt;&lt;br /&gt;By contrast, to produce a report in PROC SUMMARY, you must include a PRINT option in the PROC SUMMARY statement.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109649292873030272?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109649292873030272/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109649292873030272' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109649292873030272'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109649292873030272'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/proc-means-and-proc-summary.html' title='proc means and proc summary'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109648525099909743</id><published>2004-09-29T13:12:00.000-07:00</published><updated>2004-09-29T12:14:11.000-07:00</updated><title type='text'>difference between class and by</title><content type='html'>1.Unlike CLASS processing, BY processing requires that your data already be sorted or indexed in the order of the BY variables. Unless data set observations are already sorted, you will need to run the &lt;span style="color:#ff0000;"&gt;SORT&lt;/span&gt; procedure before using PROC MEANS with any BY group.&lt;br /&gt;&lt;br /&gt;2.BY group results have a layout that is different from the layout of CLASS group results. Note that the BY statement in the program creates small tables; a CLASS statement would produce a single large table.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109648525099909743?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109648525099909743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109648525099909743' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109648525099909743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109648525099909743'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/difference-between-class-and-by.html' title='difference between class and by'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109647637186601351</id><published>2004-09-29T09:45:00.000-07:00</published><updated>2004-09-29T09:46:11.866-07:00</updated><title type='text'>why sometimes group is like order?</title><content type='html'>All of the variables in a summary report must be defined as group, analysis, across, or computed variables.&lt;br /&gt; This is because PROC REPORT must be able to summarize all variables across an observation in order to collapse observations. If PROC REPORT can't create groups, it displays group variables as order variables.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109647637186601351?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109647637186601351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109647637186601351' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109647637186601351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109647637186601351'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/why-sometimes-group-is-like-order.html' title='why sometimes group is like order?'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109647600667864493</id><published>2004-09-29T09:38:00.000-07:00</published><updated>2004-09-29T09:40:06.676-07:00</updated><title type='text'>order in proc report</title><content type='html'>1. the detail rows are ordered according to their formatted values.&lt;br /&gt;2.you can't create summary reports.(we can use a GROUP to create a summary)&lt;br /&gt;3.PROC REPORT displays only the first occurrence of each order variable value in a set of rows that have the same value for all order variables&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109647600667864493?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109647600667864493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109647600667864493' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109647600667864493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109647600667864493'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/order-in-proc-report.html' title='order in proc report'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109647567588486455</id><published>2004-09-29T08:02:00.000-07:00</published><updated>2004-09-29T09:34:35.883-07:00</updated><title type='text'>group</title><content type='html'> If a report contains one or more group variables, PROC REPORT consolidates into one row all observations from the data set that have a &lt;span style="color:#ff0000;"&gt;unique&lt;/span&gt; combination of values for all group variables.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109647567588486455?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109647567588486455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109647567588486455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109647567588486455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109647567588486455'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/group.html' title='group'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109643114007555989</id><published>2004-09-28T21:11:00.000-07:00</published><updated>2004-09-28T21:12:20.076-07:00</updated><title type='text'>fmtlib</title><content type='html'>When you build a large catalog of permanent formats, it can be easy to forget the exact spelling of a specific format name or its range of values. Adding the keyword FMTLIB to the PROC FORMAT statement displays a list of all the formats in your catalog, along with descriptions of their values.&lt;br /&gt;&lt;br /&gt;libname library 'c:\sas\formats\lib';&lt;br /&gt;proc format library=library &lt;span style="color:#ff0000;"&gt;fmtlib&lt;/span&gt;;&lt;br /&gt;run;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109643114007555989?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109643114007555989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109643114007555989' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109643114007555989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109643114007555989'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/fmtlib.html' title='fmtlib'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109642741910463375</id><published>2004-09-28T20:09:00.000-07:00</published><updated>2004-09-28T20:10:19.103-07:00</updated><title type='text'>write to SAS log</title><content type='html'>Note that when you specify a variable in the PUT statement, only its value is written to the log.&lt;span style="color:#ff0000;"&gt; To write both the variable name and its value in the log, add an equal sign (=) to the variable name&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;put 'MY NOTE: invalid value: '&lt;br /&gt;code= type=;&lt;br /&gt;&lt;br /&gt;SAS Log&lt;br /&gt;MY NOTE: invalid value: Code=V type=FIXED&lt;br /&gt;NOTE: The data set WORK.TEST has 9 observations&lt;br /&gt;and 6 variables.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109642741910463375?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109642741910463375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109642741910463375' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109642741910463375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109642741910463375'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/write-to-sas-log.html' title='write to SAS log'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109638318419279915</id><published>2004-09-28T07:50:00.000-07:00</published><updated>2004-09-28T07:53:04.193-07:00</updated><title type='text'>date and time constant in SAS</title><content type='html'>&lt;div align="left"&gt;TestDate='01jan2000'&lt;span style="color:#ff0000;"&gt;d&lt;/span&gt;;&lt;/div&gt;&lt;br /&gt;DateTime='18jan2005:9:27:05'&lt;span style="color:#ff0000;"&gt;dt&lt;/span&gt;;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109638318419279915?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109638318419279915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109638318419279915' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109638318419279915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109638318419279915'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/date-and-time-constant-in-sas.html' title='date and time constant in SAS'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109632788044604041</id><published>2004-09-27T16:25:00.000-07:00</published><updated>2004-09-27T16:31:20.446-07:00</updated><title type='text'>use of ID</title><content type='html'>To specify which variables should replace the Obs column, use the ID statement. This technique is particularly useful when observations are too long to print on one line.&lt;br /&gt;&lt;br /&gt;If a variable in the ID statement also appears in the VAR statement, the output contains two columns for that variable. In the example below, the variable IDnum appears &lt;span style="color:#ff0000;"&gt;twice&lt;/span&gt;.&lt;br /&gt;proc print data=sales.reps;&lt;br /&gt;id idnum lastname;&lt;br /&gt;var idnum sex jobcode salary;&lt;br /&gt;run;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109632788044604041?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109632788044604041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109632788044604041' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109632788044604041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109632788044604041'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/use-of-id.html' title='use of ID'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109632318430571194</id><published>2004-09-27T15:11:00.000-07:00</published><updated>2004-09-27T15:13:04.306-07:00</updated><title type='text'>How can I call a macro that is stored in a program file? </title><content type='html'>Let us suppose that you have a macro called "macro_A" that is contained in a SAS macro program file called "macro_A.sas" and this file is in a subdirectory called "my_macros" (under your home directory). Now suppose you wish to call this macro in your SAS program.&lt;br /&gt;&lt;br /&gt;1.One way to do this is to use statements similar to the following:&lt;br /&gt;%include 'd:\my_macros\macro_A.sas';%macro_A(); The first statement asks SAS to include the macro program file and then second one calls the macro.&lt;br /&gt;&lt;br /&gt;2.Another way, is to add the subdirectory that contains the macro program file to the SAS macros directory search path. This way, if you have other macros in that directory then they too can be called by your SAS program. The statement that needs to be added at the top of your SAS program is:&lt;br /&gt;&lt;br /&gt;options sasautos='d:\my_macros'; At a later point in the program you call the macro by using the statement:&lt;br /&gt;%macro_A();&lt;br /&gt;&lt;br /&gt;3.Alternatively, if you wish to have your macros available to all your SAS programs then create a program file called "autoexec.sas" in your home directory and add the above Options statement to it. This way, each time SAS is invoked, the autoexec.sas file will automatically be executed and hence the statement(s) in it will also be executed. Subsequently, in your program you will only need to call the macro with the statement:&lt;br /&gt;%macro_A();&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109632318430571194?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109632318430571194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109632318430571194' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109632318430571194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109632318430571194'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/how-can-i-call-macro-that-is-stored-in.html' title='How can I call a macro that is stored in a program file? '/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109632270417066852</id><published>2004-09-27T15:02:00.000-07:00</published><updated>2004-09-27T15:05:04.170-07:00</updated><title type='text'>dsd</title><content type='html'>If the delimiter is a character other than a blank, you can use the DSD option in the INFILE statement to tell SAS to &lt;span style="color:#ff0000;"&gt;read a missing value as missing when it encounters one between two consecutive delimiters&lt;/span&gt;. This will remedy the problem. For example:&lt;br /&gt;&lt;br /&gt;data sample1;&lt;br /&gt;infile 'datafile1.dat' dlm=',' dsd;&lt;br /&gt;input idno $ phone $ height weight;&lt;br /&gt;proc print;&lt;br /&gt;run;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109632270417066852?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109632270417066852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109632270417066852' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109632270417066852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109632270417066852'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/dsd.html' title='dsd'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109632157426249718</id><published>2004-09-27T14:40:00.000-07:00</published><updated>2004-09-27T14:46:14.263-07:00</updated><title type='text'>index </title><content type='html'>It searches for a source string (TITLE) for a target string ('COB'). INDEX returns a 0 if the target is not found; otherwise, it returns to column position of the target within the source.&lt;br /&gt;&lt;br /&gt;example: column=index(title,'COB');&lt;br /&gt;&lt;br /&gt;note: this situation is very different from the one of scan.&lt;br /&gt;scan(source, n &lt;delimiters&gt;); here, we use scan to locate a special &lt;span style="color:#ff0000;"&gt;term (which is not a substring),&lt;/span&gt;which is divided by a delimiter.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109632157426249718?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109632157426249718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109632157426249718' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109632157426249718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109632157426249718'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/index.html' title='index '/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109632093753515378</id><published>2004-09-27T14:35:00.000-07:00</published><updated>2004-09-27T14:35:37.536-07:00</updated><title type='text'>How to extract OBS with a specific string? </title><content type='html'>WHERE upcase(var_name) contains 'JAMES';&lt;br /&gt;or&lt;br /&gt;if index(upcase(var_name),'JAMES') &gt; 0;&lt;br /&gt;or&lt;br /&gt;In case of more than one variable:&lt;br /&gt;WHERE upcase(var_n1) contains 'JAMES' orupcase(var_n2) contains 'JAMES';&lt;br /&gt;or&lt;br /&gt;if (index(upcase(var_n1),'JAMES') &gt; 0 or(index(upcase(var_n2),'JAMES') &gt; 0;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109632093753515378?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109632093753515378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109632093753515378' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109632093753515378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109632093753515378'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/how-to-extract-obs-with-specific.html' title='How to extract OBS with a specific string? '/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109631937763032096</id><published>2004-09-27T14:08:00.000-07:00</published><updated>2004-09-27T14:09:37.630-07:00</updated><title type='text'>missin value</title><content type='html'>data a;     &lt;br /&gt;x=.d;     &lt;br /&gt;y=x+1;    &lt;br /&gt;put y=;  &lt;br /&gt;run;&lt;br /&gt;proc print;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt; Obs    x    y&lt;br /&gt;     1     D    .&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109631937763032096?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109631937763032096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109631937763032096' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109631937763032096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109631937763032096'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/missin-value.html' title='missin value'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109631889171077473</id><published>2004-09-27T14:01:00.000-07:00</published><updated>2004-09-27T14:01:31.710-07:00</updated><title type='text'>sum </title><content type='html'>The SUM statement &lt;span style="color:#ff0000;"&gt;ignores&lt;/span&gt; missing values&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109631889171077473?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109631889171077473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109631889171077473' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109631889171077473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109631889171077473'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/sum.html' title='sum '/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109631819206336733</id><published>2004-09-27T13:48:00.000-07:00</published><updated>2004-09-27T13:49:52.063-07:00</updated><title type='text'>How to Check for Missing Values in a DATA Step</title><content type='html'>If your data contains special missing values, you can check for either an ordinary or special missing value with a statement that is similar to the following:&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;if numvar&lt;=.z then do;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;br /&gt;The MISSING function enables you to check for either a character or numeric missing value, as in:&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;if missing(var) then do;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109631819206336733?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109631819206336733/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109631819206336733' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109631819206336733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109631819206336733'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/how-to-check-for-missing-values-in.html' title='How to Check for Missing Values in a DATA Step'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109631655246173033</id><published>2004-09-27T13:22:00.000-07:00</published><updated>2004-09-27T13:22:32.460-07:00</updated><title type='text'>Order of Application</title><content type='html'>First, options on input data sets are evaluated left to right within SET, MERGE, and UPDATE statements. DROP= and KEEP= options are applied before the RENAME= option.&lt;br /&gt;&lt;br /&gt;Next, DROP and KEEP statements are applied, followed by the RENAME statement.&lt;br /&gt;&lt;br /&gt;Finally, options on output data sets are evaluated left to right within the DATA statement. DROP= and KEEP= options are applied before the RENAME= option.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109631655246173033?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109631655246173033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109631655246173033' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109631655246173033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109631655246173033'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/order-of-application.html' title='Order of Application'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109630962649668848</id><published>2004-09-27T11:26:00.000-07:00</published><updated>2004-09-27T11:27:06.496-07:00</updated><title type='text'>Using the IN= Data Set Option</title><content type='html'>&lt;a name="z1375292"&gt;The IN= data set option creates a special boolean variable that indicates whether the data set contributed data to the current observation. The variable has a value of 1 when true, and a value of 0 when false. You can use IN= on the SET, MERGE, and UPDATE statements in a DATA step. &lt;/a&gt;&lt;br /&gt;The following example shows a merge of the OLD and NEW data sets where the IN= option is used to create a variable named X that indicates whether the NEW data set contributed data to the observation: data&lt;br /&gt;&lt;br /&gt;master missing;&lt;br /&gt;merge old new(in=x);&lt;br /&gt;by id;&lt;br /&gt;if x=0 then output missing;&lt;br /&gt;else output master;&lt;br /&gt;run;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109630962649668848?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109630962649668848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109630962649668848' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109630962649668848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109630962649668848'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/using-in-data-set-option.html' title='Using the IN= Data Set Option'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109630915804120789</id><published>2004-09-27T11:18:00.000-07:00</published><updated>2004-09-27T11:19:18.040-07:00</updated><title type='text'>length</title><content type='html'>For character variables, you must allow for the longest possible value in the first statement that uses the variable, because you cannot change the length with a subsequent LENGTH statement within the same DATA step.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109630915804120789?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109630915804120789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109630915804120789' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109630915804120789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109630915804120789'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/length.html' title='length'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109630019551809614</id><published>2004-09-27T08:47:00.000-07:00</published><updated>2004-09-27T08:49:55.520-07:00</updated><title type='text'>ATTRIB Statement</title><content type='html'>&lt;a name="z1372636"&gt;&lt;span style="color:#000000;"&gt;The ATTRIB statement can also associate a format, as well as other attributes, with one or more variables.&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;attrib&lt;/span&gt; sales1-sales3 format=comma10.2;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109630019551809614?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109630019551809614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109630019551809614' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109630019551809614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109630019551809614'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/attrib-statement.html' title='ATTRIB Statement'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109617664686463996</id><published>2004-09-25T22:27:00.000-07:00</published><updated>2004-09-25T22:30:46.866-07:00</updated><title type='text'>combining a Grand Total with the original data</title><content type='html'>variables read with a SET statement are automatically retained.&lt;br /&gt;&lt;br /&gt;data new-data-set;&lt;br /&gt;If _N_=1 then set summary-data-set;&lt;br /&gt;set original-data-set;&lt;br /&gt;&lt;br /&gt;in this case the variables from summary-data-set are read once at the first iteration of the data step and then retained for all other observations.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109617664686463996?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109617664686463996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109617664686463996' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109617664686463996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109617664686463996'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/combining-grand-total-with-original.html' title='combining a Grand Total with the original data'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109616895874681293</id><published>2004-09-25T20:13:00.000-07:00</published><updated>2004-09-25T20:22:38.746-07:00</updated><title type='text'>an observation with missing values fro its all variables </title><content type='html'>data bank;&lt;br /&gt;input BankName $ Rate;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;datalines; &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;A 0.075 &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;B 0.072 &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;C 0.074 &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;D 0.024 &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;E 0.034&lt;/span&gt;&lt;br /&gt;;&lt;br /&gt;run;&lt;br /&gt;data captotal;&lt;br /&gt;do year=1 to 5;&lt;br /&gt;set bank;&lt;br /&gt;capital=capital+capital*Rate;&lt;br /&gt;end;&lt;br /&gt;run;&lt;br /&gt;proc print;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;with this program, we will get 1 observations and 4 variables&lt;br /&gt;                        Bank &lt;br /&gt;Obs    year    Name     Rate    capital&lt;br /&gt;     1       6        E              0.034     .&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;data bank;&lt;br /&gt;input BankName $ Rate;&lt;br /&gt;datalines;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;A 0.075 &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;B 0.072 &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;C 0.074 &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;;&lt;/span&gt;&lt;br /&gt;run;&lt;br /&gt;data captotal;&lt;br /&gt;do year=1 to 5;&lt;br /&gt;set bank;&lt;br /&gt;apital=capital+capital*Rate;&lt;br /&gt;end;&lt;br /&gt;run;&lt;br /&gt;proc print;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;this time, we have o observation and 4 variables. Since this time this observation has missing values for all its variables.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109616895874681293?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109616895874681293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109616895874681293' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109616895874681293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109616895874681293'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/observation-with-missing-values-fro.html' title='an observation with missing values fro its all variables '/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109616681267429943</id><published>2004-09-25T19:42:00.000-07:00</published><updated>2004-09-25T19:46:52.673-07:00</updated><title type='text'>sas datalines/cards</title><content type='html'>In SAS, data must be put in the end of DATA step.&lt;br /&gt;&lt;br /&gt;data a;&lt;br /&gt;input a1 b1@@;&lt;br /&gt;cards;&lt;br /&gt;1 2 0 2 1 2 ;&lt;br /&gt;if a1=1 then a1=.;&lt;br /&gt;run;&lt;br /&gt;proc print;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;works but wrong ouput&lt;br /&gt;&lt;br /&gt;this way is correct: we got the desired output.&lt;br /&gt;&lt;br /&gt;So data must be put at the end of data step.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109616681267429943?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109616681267429943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109616681267429943' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109616681267429943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109616681267429943'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/sas-datalinescards.html' title='sas datalines/cards'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109616456074290167</id><published>2004-09-25T19:03:00.000-07:00</published><updated>2004-09-25T19:30:28.570-07:00</updated><title type='text'>do loop</title><content type='html'>data a;&lt;br /&gt;input x y z;&lt;br /&gt;do j= x to z by y;&lt;br /&gt;y = 16;&lt;br /&gt;end;&lt;br /&gt;datalines;&lt;br /&gt;0 4 8&lt;br /&gt;;&lt;br /&gt;proc print;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;output:&lt;br /&gt;&lt;br /&gt;Obs x y z &lt;span style="color:#ff0000;"&gt;j &lt;/span&gt;&lt;br /&gt;1 0 16 8 &lt;span style="color:#ff0000;"&gt;12&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In SAS&lt;br /&gt;do startvalue to endvalue by increment;&lt;br /&gt;Increment cannot be changed in the loop. Here, j always is 4, even though the statement of y=16 later cannot change that case.&lt;br /&gt;&lt;br /&gt;we can see why:&lt;br /&gt;data a;&lt;br /&gt;input x y z;&lt;br /&gt;do j= x to z by y;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;output; /* we put output here*/&lt;/span&gt;&lt;br /&gt;y = 16;&lt;br /&gt;end;&lt;br /&gt;datalines;&lt;br /&gt;0 4 8&lt;br /&gt;;&lt;br /&gt;proc print;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;output:&lt;br /&gt; Obs    x     y    z    j&lt;br /&gt;   1     0     &lt;span style="color:#ff0000;"&gt;4 &lt;/span&gt;   8    0                                     &lt;br /&gt;   2     0    16    8    4                                      &lt;br /&gt;   3     0    16    8    8&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109616456074290167?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109616456074290167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109616456074290167' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109616456074290167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109616456074290167'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/do-loop.html' title='do loop'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109614746755332292</id><published>2004-09-25T14:20:00.000-07:00</published><updated>2004-09-25T14:24:27.553-07:00</updated><title type='text'>delete data sets</title><content type='html'>proc datasets library=sasuser;&lt;br /&gt;delete snow;&lt;br /&gt;run;&lt;br /&gt;/* delete the selected dataset */&lt;br /&gt;&lt;br /&gt;proc save rain;&lt;br /&gt;/*only keep dataset of rain and delete others */&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;proc datasets library kill;&lt;br /&gt;/* delete all members of the library in the library */&lt;br /&gt;run;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109614746755332292?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109614746755332292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109614746755332292' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109614746755332292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109614746755332292'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/delete-data-sets.html' title='delete data sets'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109614702634442941</id><published>2004-09-25T14:14:00.000-07:00</published><updated>2004-09-25T14:18:16.630-07:00</updated><title type='text'>moving specific data set</title><content type='html'>proc copy in=work out=sasuser move;&lt;br /&gt;select hurricane;&lt;br /&gt;(exclude snow;)&lt;br /&gt;run;&lt;br /&gt;Note: with the MOVE option, SAS first copies the files to the output library, then delete them from the input library.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109614702634442941?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109614702634442941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109614702634442941' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109614702634442941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109614702634442941'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/moving-specific-data-set.html' title='moving specific data set'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109614670390182740</id><published>2004-09-25T14:06:00.000-07:00</published><updated>2004-09-25T14:11:43.900-07:00</updated><title type='text'>excluding data sets from coping</title><content type='html'>proc copy (in=work) out=sasuser;&lt;br /&gt;/*we can delete in statement in some cases if we imply current library somewhere*/&lt;br /&gt;exclude snow;&lt;br /&gt;run;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109614670390182740?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109614670390182740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109614670390182740' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109614670390182740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109614670390182740'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/excluding-data-sets-from-coping.html' title='excluding data sets from coping'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109613837071157412</id><published>2004-09-25T11:38:00.000-07:00</published><updated>2004-09-25T11:52:50.710-07:00</updated><title type='text'>assigning, changing or removing formats</title><content type='html'>proc datasets;&lt;br /&gt;modify hurricane;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;format Date monyy7. Millions&lt;/span&gt;;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;here we assigned a format to Date and removed the format of Millions.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109613837071157412?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109613837071157412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109613837071157412' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109613837071157412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109613837071157412'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/assigning-changing-or-removing-formats.html' title='assigning, changing or removing formats'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109613740955617301</id><published>2004-09-25T11:34:00.000-07:00</published><updated>2004-09-25T11:36:49.556-07:00</updated><title type='text'>proc datasets </title><content type='html'>SAS enables you to modify data set and variable attibutes without creating new data sets.&lt;br /&gt;&lt;br /&gt;In this procedure, we can&lt;br /&gt;&lt;br /&gt;rename data sets&lt;br /&gt;rename variables&lt;br /&gt;modify variable formats&lt;br /&gt;modify variable lables&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109613740955617301?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109613740955617301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109613740955617301' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109613740955617301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109613740955617301'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/proc-datasets_25.html' title='proc datasets '/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109613714392836550</id><published>2004-09-25T11:20:00.000-07:00</published><updated>2004-09-25T11:32:23.926-07:00</updated><title type='text'>renaming SAS data sets</title><content type='html'>proc datasets library=sasuser;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;change &lt;/span&gt;admit=admission;&lt;br /&gt;run;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109613714392836550?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109613714392836550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109613714392836550' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109613714392836550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109613714392836550'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/renaming-sas-data-sets.html' title='renaming SAS data sets'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109609659462846480</id><published>2004-09-25T01:13:00.000-07:00</published><updated>2004-09-25T00:19:14.713-07:00</updated><title type='text'>proc datasets session</title><content type='html'>Proc datasets library=work;&lt;br /&gt;&lt;br /&gt;copy in=sasuser out=work;&lt;br /&gt;select admit;&lt;br /&gt;contents data=admit;&lt;br /&gt;/*here, admit means the one in the work library */&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;modify admit;&lt;br /&gt;/* in work library. we cannot put work.admit here*/&lt;br /&gt;rename Name=nickname;&lt;br /&gt;quit;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109609659462846480?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109609659462846480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109609659462846480' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109609659462846480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109609659462846480'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/proc-datasets-session.html' title='proc datasets session'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109609583794728126</id><published>2004-09-24T23:58:00.000-07:00</published><updated>2004-09-25T00:03:57.946-07:00</updated><title type='text'>proc datasets</title><content type='html'>proc datasets library=sasuser;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;this statement list the information about the directory and library members in this library.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109609583794728126?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109609583794728126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109609583794728126' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109609583794728126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109609583794728126'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/proc-datasets.html' title='proc datasets'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109609550447206486</id><published>2004-09-24T23:56:00.000-07:00</published><updated>2004-09-25T00:10:27.803-07:00</updated><title type='text'>how to copy a dataset from a library</title><content type='html'>(proc) copy in=realdata out=test2004;&lt;br /&gt;select income2004;&lt;br /&gt;&lt;br /&gt;this statement will copy the dataset of income2004 from the library of realdata to test2004 library.&lt;br /&gt;&lt;br /&gt;proc can be deleted.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109609550447206486?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109609550447206486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109609550447206486' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109609550447206486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109609550447206486'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/how-to-copy-dataset-from-library.html' title='how to copy a dataset from a library'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109609088424661007</id><published>2004-09-24T22:40:00.000-07:00</published><updated>2004-09-24T22:41:24.246-07:00</updated><title type='text'>create a SAS dataset by using ODS</title><content type='html'>ODS OUTPUT output-object(s) = SAS-DATA-SET;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109609088424661007?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109609088424661007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109609088424661007' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109609088424661007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109609088424661007'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/create-sas-dataset-by-using-ods.html' title='create a SAS dataset by using ODS'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109608967980230169</id><published>2004-09-24T22:20:00.000-07:00</published><updated>2004-09-24T22:22:49.333-07:00</updated><title type='text'>ods trace</title><content type='html'>&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;ODS TRACE&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;&lt;span style="color:#ff0000;"&gt;ON/OFF&lt;/span&gt;&lt;/strong&gt; determines whether to write to the SAS log a record of each output object that a program creates.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109608967980230169?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109608967980230169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109608967980230169' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109608967980230169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109608967980230169'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/ods-trace.html' title='ods trace'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109608650959679867</id><published>2004-09-24T21:25:00.000-07:00</published><updated>2004-09-24T21:28:29.596-07:00</updated><title type='text'>customizing output of missing values by using a procedure</title><content type='html'>&lt;span style="color:#ff0000;"&gt;&lt;em&gt;&lt;strong&gt;proc format;&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;em&gt;&lt;strong&gt;     value xscore  .='score unavailable';&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;em&gt;&lt;strong&gt;run;&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;proc print data=sat_score;&lt;br /&gt;format SATscore &lt;strong&gt;&lt;span style="color:#ff0000;"&gt;xscore.;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;run;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109608650959679867?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109608650959679867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109608650959679867' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109608650959679867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109608650959679867'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/customizing-output-of-missing-values.html' title='customizing output of missing values by using a procedure'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109607006539515053</id><published>2004-09-24T16:48:00.000-07:00</published><updated>2004-09-24T16:54:25.396-07:00</updated><title type='text'>put and releasing a held line</title><content type='html'>Executing a PUT statement with a trailing @ causes SAS to hold the current output line for further writing, &lt;span style="color:#ff0000;"&gt;&lt;em&gt;&lt;strong&gt;either in the current iteration of the DATA step or in a future iteration.&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Executing a PUT statement without a trailing @ releases the held line.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109607006539515053?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109607006539515053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109607006539515053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109607006539515053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109607006539515053'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/put-and-releasing-held-line.html' title='put and releasing a held line'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109589253290706391</id><published>2004-09-22T15:31:00.000-07:00</published><updated>2004-09-22T15:43:19.530-07:00</updated><title type='text'>calculate descriptive statistics</title><content type='html'>you can request descriptive statistics for a variable by crossing that variable with the appropriate statistics keyword like SUM, N, MIN, MAX, MEAN, STD and so on.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#ff0000;"&gt;note: two statistics cannot be crossed and all statistics must occur in one dimension.&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;.........&lt;br /&gt;&lt;br /&gt;table SalesRep*Type,&lt;br /&gt;AmountSold*Mean*f=dollar16.2;&lt;br /&gt;&lt;br /&gt;multiple statistics:&lt;br /&gt;table SalesRep*Type,&lt;br /&gt;AmountSold*N AmountSold*f=dollar16.2;&lt;br /&gt;&lt;br /&gt;for the last statement, we could write like this way too:&lt;br /&gt;&lt;br /&gt;Table AmountSold*(n sum*f=dollar16.2);&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;em&gt;&lt;strong&gt;note: sum is a default statistics must be included in the expression&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109589253290706391?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109589253290706391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109589253290706391' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109589253290706391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109589253290706391'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/calculate-descriptive-statistics.html' title='calculate descriptive statistics'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109589201626826812</id><published>2004-09-22T15:23:00.000-07:00</published><updated>2004-09-22T15:26:56.266-07:00</updated><title type='text'>override formats by crossing variables with format modifiers</title><content type='html'>You can cross a variable with a format modifer by putting an * between them.&lt;br /&gt;&lt;br /&gt;proc tabulate data=year_sales format=commar10.;&lt;br /&gt;class SalesRep Type;&lt;br /&gt;var AmountSold;&lt;br /&gt;table SalesRep*Type,&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;&lt;em&gt;AmountSold*f= dollar16.2;&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109589201626826812?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109589201626826812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109589201626826812' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109589201626826812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109589201626826812'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/override-formats-by-crossing-variables.html' title='override formats by crossing variables with format modifiers'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109588810512236295</id><published>2004-09-22T14:12:00.000-07:00</published><updated>2004-09-22T14:21:45.123-07:00</updated><title type='text'>missing value in SAS tables</title><content type='html'>if you have class variables with missing values in your data set, then you must decide whether or not the observations with the missing values should be omitted from every table. If the observations should not be omitted, then you can fill in the missing values where appropiate or continue to run the PROC TABULATE step with the MISSING option.&lt;br /&gt;&lt;br /&gt;proc tabulate data= year_sales format=comma10. missing;&lt;br /&gt;&lt;br /&gt;if you specify the MISSING option in a SAS statement, observations with missing values for this class variable will display in the summary table, otherwise, not.&lt;br /&gt;&lt;br /&gt;proc tabulate data=year_sales format=comma10.;&lt;br /&gt;class Month Quarter / missing;&lt;br /&gt;class SalesRep;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109588810512236295?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109588810512236295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109588810512236295' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109588810512236295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109588810512236295'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/missing-value-in-sas-tables.html' title='missing value in SAS tables'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109588704479212828</id><published>2004-09-22T13:55:00.000-07:00</published><updated>2004-09-22T14:04:04.793-07:00</updated><title type='text'>how to construct a table in SAS</title><content type='html'>table column;&lt;br /&gt;table row, column;&lt;br /&gt;table page, row, column;&lt;br /&gt;&lt;br /&gt;in this syntax,&lt;br /&gt;a column expression is required; a row and page expressions are optional. The order of the expression must be page, row and column.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;every variable that is used in a dimention expression in a TABLE statement must appear in either a CLASS statement or a VAR statement, but not both.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109588704479212828?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109588704479212828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109588704479212828' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109588704479212828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109588704479212828'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/how-to-construct-table-in-sas.html' title='how to construct a table in SAS'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109588301736632919</id><published>2004-09-22T13:54:00.000-07:00</published><updated>2004-09-22T12:56:57.366-07:00</updated><title type='text'>SAS macro</title><content type='html'>title " Produced on &amp;SYSDATE9"&lt;br /&gt;&lt;br /&gt;SAS macro facility resolves macro variable references in the Title statement and the FOOTNOTE statement only if they are in double quotation marks.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109588301736632919?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109588301736632919/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109588301736632919' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109588301736632919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109588301736632919'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/sas-macro.html' title='SAS macro'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109588168511413562</id><published>2004-09-22T13:33:00.000-07:00</published><updated>2004-09-22T12:34:45.113-07:00</updated><title type='text'>title</title><content type='html'>to suppress the nth title and all titles below it, use the following statement:&lt;br /&gt;&lt;br /&gt;titlen;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109588168511413562?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109588168511413562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109588168511413562' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109588168511413562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109588168511413562'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/title.html' title='title'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109587676913785297</id><published>2004-09-22T11:09:00.000-07:00</published><updated>2004-09-22T11:12:49.136-07:00</updated><title type='text'>computing group subtotals</title><content type='html'>the BY statement produces a separate section of the report for each BY group. Do not specify in the VAR statement the variable that you use in the BY statement. Otherwise, the values of the BY variable appear twice in the report, as a header across the page and in columns down the page.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109587676913785297?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109587676913785297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109587676913785297' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109587676913785297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109587676913785297'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/computing-group-subtotals.html' title='computing group subtotals'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109582578066876759</id><published>2004-09-21T20:59:00.000-07:00</published><updated>2004-09-21T21:03:00.666-07:00</updated><title type='text'>updatemode</title><content type='html'>the missingcheck value in the updatemode option prevents missing values in a transaction data set from replacing values in a master data set. This is the default. The nonmissingcheck value enables missing values in a transaction data set to replace values in a master data set.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109582578066876759?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109582578066876759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109582578066876759' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109582578066876759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109582578066876759'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/updatemode.html' title='updatemode'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109582530067085638</id><published>2004-09-21T20:43:00.000-07:00</published><updated>2004-09-21T20:55:00.670-07:00</updated><title type='text'>difference between update and merge</title><content type='html'>two ways: how to handle missing values; how to multiple obsevations in a BY group.&lt;br /&gt;&lt;br /&gt;missing values:&lt;br /&gt;during an update, if a value for a varible is missing in the transaction data set, SAS uses the value from the master data set when it writes the observation to the new data set.&lt;br /&gt;&lt;br /&gt;when merging the same observation, SAS overwrites the value in the program vector with the missing value.&lt;br /&gt;&lt;br /&gt;BY group:&lt;br /&gt;SAS does not write an updated observation to the new data set until it has applied all the tranctions in a BY group. In one word, we get only one observation for each one BY variable value.&lt;br /&gt;&lt;br /&gt;when merging data sets, SAS writes one new observation for each observation in the data set with the largest number of observations in the BY group. In one word, how many observations we get is up to how many values for each BY variable.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109582530067085638?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109582530067085638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109582530067085638' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109582530067085638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109582530067085638'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/difference-between-update-and-merge.html' title='difference between update and merge'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109582337777103514</id><published>2004-09-21T20:21:00.000-07:00</published><updated>2004-09-21T20:22:57.770-07:00</updated><title type='text'>update datasets</title><content type='html'>If there are duplicate observations in the master data set, all matching observations in the transaction data set are applied only to the first of the duplicate observations in the master data set.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109582337777103514?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109582337777103514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109582337777103514' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109582337777103514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109582337777103514'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/update-datasets.html' title='update datasets'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109581996038507443</id><published>2004-09-21T19:22:00.000-07:00</published><updated>2004-09-21T19:26:00.386-07:00</updated><title type='text'>merge datasets</title><content type='html'>use one  to one merging when you want to combine one observation from each data set, but it is not important to match observations.&lt;br /&gt;&lt;br /&gt;In cases where you must merge certain observations, use a match-merge.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109581996038507443?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109581996038507443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109581996038507443' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109581996038507443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109581996038507443'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/merge-datasets.html' title='merge datasets'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109560812492877578</id><published>2004-09-19T08:32:00.000-07:00</published><updated>2004-09-19T21:36:03.546-07:00</updated><title type='text'>SAS date constant</title><content type='html'>example:&lt;br /&gt;&lt;br /&gt;if country = 'Switzerland' then DepartureDate = &lt;strong&gt;&lt;em&gt;'21jan2001'd&lt;/em&gt;&lt;/strong&gt;;&lt;br /&gt;&lt;br /&gt;here, d is a suffix, which tells SAS to convert the canlendar date to a SAS date value.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109560812492877578?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109560812492877578/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109560812492877578' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109560812492877578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109560812492877578'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/sas-date-constant.html' title='SAS date constant'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109557520151370744</id><published>2004-09-18T23:25:00.000-07:00</published><updated>2004-09-18T23:26:41.513-07:00</updated><title type='text'>SAS array</title><content type='html'>the beginning subscript of an array in SAS is from 1.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109557520151370744?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109557520151370744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109557520151370744' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109557520151370744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109557520151370744'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/sas-array.html' title='SAS array'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109556753477154747</id><published>2004-09-18T21:12:00.000-07:00</published><updated>2004-09-18T21:52:39.956-07:00</updated><title type='text'>output</title><content type='html'>when we use an OUTPUT statement, we override the automatic output feature.&lt;br /&gt;&lt;br /&gt;If a variable value is calculated after the OUTPUT statement executes, then that value is not available when the observation is written to the output data set.&lt;br /&gt;&lt;br /&gt;data lucasdays otherdays;&lt;br /&gt;set mylib.arts;&lt;br /&gt;if TourGuide = 'Lucas' then output lucasdays;&lt;br /&gt;else output otherdays;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Days = Nights +1;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;here, in the output dataset, we have the variable of "Days", but the value is set to missing.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109556753477154747?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109556753477154747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109556753477154747' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109556753477154747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109556753477154747'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/output.html' title='output'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109556477083223528</id><published>2004-09-18T20:28:00.000-07:00</published><updated>2004-09-18T20:32:50.833-07:00</updated><title type='text'>find a value anywhere within another character value</title><content type='html'>Index(source, excerpt)&lt;br /&gt;&lt;br /&gt;example:&lt;br /&gt;&lt;br /&gt;if index(EventDescription, 'other') then OtherEvents = 'Yes';&lt;br /&gt;&lt;br /&gt;here, the position of the word 'other' varies in different observation.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109556477083223528?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109556477083223528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109556477083223528' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109556477083223528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109556477083223528'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/find-value-anywhere-within-another.html' title='find a value anywhere within another character value'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109556327502550198</id><published>2004-09-18T20:05:00.000-07:00</published><updated>2004-09-18T20:18:01.853-07:00</updated><title type='text'>how to select all the values that begin with the same group of characters</title><content type='html'>example 1:&lt;br /&gt;&lt;br /&gt;if TourGuide = &lt;strong&gt;&lt;em&gt;: 'D'&lt;/em&gt;&lt;/strong&gt; then Chosen = 'Yes';&lt;br /&gt;&lt;br /&gt;the colon causes SAS to compare the same number of characters in the shorter value and the longer value.&lt;br /&gt;&lt;br /&gt;example 2:&lt;br /&gt;&lt;br /&gt;if TourGuide &lt;strong&gt;&lt;em&gt;&lt;= : ' L'&lt;/em&gt;&lt;/strong&gt; then TourGuideGroup = 'A-L';&lt;br /&gt;&lt;br /&gt;by this way, we can select a range of character values.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109556327502550198?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109556327502550198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109556327502550198' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109556327502550198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109556327502550198'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/how-to-select-all-values-that-begin.html' title='how to select all the values that begin with the same group of characters'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109554179667230639</id><published>2004-09-18T14:05:00.000-07:00</published><updated>2004-09-18T14:09:56.673-07:00</updated><title type='text'>missing value in list input</title><content type='html'>When we read character data values with list input, we must use a period to represent a missing value in &lt;strong&gt;&lt;em&gt;datalines&lt;/em&gt;&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;Blanks in list input separate values, therefore, SAS interprets blanks as a signal to keep searching for the value, not as a missing value.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109554179667230639?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109554179667230639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109554179667230639' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109554179667230639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109554179667230639'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/missing-value-in-list-input.html' title='missing value in list input'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109552880985748298</id><published>2004-09-18T10:32:00.000-07:00</published><updated>2004-09-18T10:33:29.856-07:00</updated><title type='text'>set statement</title><content type='html'>set statement determines how the program data vector is built.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109552880985748298?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109552880985748298/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109552880985748298' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109552880985748298'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109552880985748298'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/set-statement.html' title='set statement'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109552677660880473</id><published>2004-09-18T09:54:00.000-07:00</published><updated>2004-09-18T09:59:36.606-07:00</updated><title type='text'>missover and truncover</title><content type='html'>missover: prevents the DATA step from going to the next line if it does not find values in the current record for all of the variables in the INPUT statement.&lt;br /&gt;&lt;br /&gt;note: if there is a blank line at the end of the last record, the DATA step attempts to load another record into the input buffer. So finally we will get an extra observation, whose variables are set to missing values.&lt;br /&gt;&lt;br /&gt;truncover: causes the DATA step to assign the raw data value to the variable even if the value is shorter than expected by the INPUT statement.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109552677660880473?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109552677660880473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109552677660880473' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109552677660880473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109552677660880473'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/missover-and-truncover.html' title='missover and truncover'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109552643663136777</id><published>2004-09-18T09:51:00.000-07:00</published><updated>2004-09-18T09:53:56.630-07:00</updated><title type='text'>datalines and infile</title><content type='html'>we can just put datalines with infile as if datalines were a fileref so that we can just take advantage of the infile statement, like we could use "DLM" and other options specially for infile.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109552643663136777?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109552643663136777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109552643663136777' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109552643663136777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109552643663136777'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/datalines-and-infile.html' title='datalines and infile'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109548417583341755</id><published>2004-09-17T22:05:00.000-07:00</published><updated>2004-09-17T22:35:54.406-07:00</updated><title type='text'>input definition again</title><content type='html'>With column input, SAS reads the columns that you specify in the INPUT statement.&lt;br /&gt;&lt;br /&gt;With formatted input, SAS reads the exact length that you specify with the informat.&lt;br /&gt;&lt;br /&gt;With list input, SAS keeps reading until it encounters blank.&lt;br /&gt;&lt;br /&gt;Unlike list input, column and formatted input rely totally on your instructions to move the pointer and read the value for the next variable. Column input uses column specifications to move the pointer to each data field. Formatted input uses informats and pointer controls to control the position of the pointer.&lt;br /&gt;&lt;br /&gt;Without these instructions in column input or formatted input, which moves the pointer to the column where the value begins, the INPUT statement would attempt to read the value in following column, which is probably is another blank columns.&lt;br /&gt;&lt;br /&gt;List input uses a scanning method to determine the pointer location. To read the next variable value, the pointer moves &lt;em&gt;&lt;strong&gt;automatically&lt;/strong&gt;&lt;/em&gt; to the first nonblank column, discarding any leading blanks it encounters.&lt;br /&gt;&lt;br /&gt;So I suppose that in the cases of column input and formatted input, pointer cannot automatically to a nonblank column.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109548417583341755?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109548417583341755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109548417583341755' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109548417583341755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109548417583341755'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/input-definition-again.html' title='input definition again'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109548270339874351</id><published>2004-09-17T21:19:00.000-07:00</published><updated>2004-09-17T21:45:03.396-07:00</updated><title type='text'>about column inoput and list input</title><content type='html'>For a long time, I thought sth wrong with the following code:&lt;br /&gt;&lt;br /&gt;data club2;  &lt;br /&gt;input Team $ 25 Name $ 6-23 StartWeight 32-34 EndWeight 36-38;&lt;br /&gt;datalines;&lt;br /&gt;1023 David Shaw         red    189 165&lt;br /&gt;;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;I thought that it should be @25 Team $1. blah blah.&lt;br /&gt;&lt;br /&gt;This is a really column input so the point is that 25 is enough here. @n is used with formatted input.&lt;br /&gt;&lt;br /&gt;And in the output, we get "r" rather than "red" for the Team, so $ here just means one character.&lt;br /&gt;&lt;br /&gt;Then look another example:&lt;br /&gt;&lt;br /&gt;data club2;  &lt;br /&gt;input IDNumber Name &amp; $18. Team $ StartWeight EndWeight;&lt;br /&gt;datalines;&lt;br /&gt;1023 David Shaw    red    189 165;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;here, we got "red" rather than "r" for Team with a $ sign. The reason is that here this is a list input rather than a column input.&lt;br /&gt;&lt;br /&gt;So finally I got more clear view about these definitions:&lt;br /&gt;&lt;br /&gt;simple list input stops whenever it encountered a blank but column input exactly reads how long it is told in an input statement.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109548270339874351?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109548270339874351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109548270339874351' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109548270339874351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109548270339874351'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/about-column-inoput-and-list-input.html' title='about column inoput and list input'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109494413130694837</id><published>2004-09-11T16:08:00.000-07:00</published><updated>2004-09-19T22:02:14.383-07:00</updated><title type='text'>@ and @@</title><content type='html'>It's easy to distinguish between the trailing @@ and the trailing @ by remembering that&lt;br /&gt;&lt;br /&gt;the double trailing at sign (@@) holds a record across multiple iterations of the DATA step until the end of the record is reached, which means that @@ holds a record for subsequent INPUT statements even when SAS starts building a new observation.&lt;br /&gt;&lt;br /&gt;data students;&lt;br /&gt;infile 'D:\students.dat' missover;&lt;br /&gt;input name $ gender $ @@;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;here, the reason why we use the double @ is that we need keep the current record to build the next observation. In this case, the raw data looks as the following way:&lt;br /&gt;&lt;br /&gt;mike M mary F&lt;br /&gt;stone M&lt;br /&gt;&lt;br /&gt;the single trailing at sign (@) releases a record when control returns to the top of the DATA step.&lt;br /&gt;&lt;br /&gt;data freeways;&lt;br /&gt;infile 'C:\Traffic.dat';&lt;br /&gt;input type $ @;&lt;br /&gt;if type='surface' then delete;&lt;br /&gt;input name $;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;here, the reason why we use @ is that we need the information of type to decide whether we need to keep the current record to go on. Without this @, SAS would automatically start reading the next record with the following INPUT statement.&lt;br /&gt;&lt;br /&gt;In one word, the difference is how long they hold a line of data for input.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109494413130694837?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109494413130694837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109494413130694837' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109494413130694837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109494413130694837'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/and.html' title='@ and @@'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109487761835454569</id><published>2004-09-10T20:54:00.000-07:00</published><updated>2004-09-10T21:40:18.353-07:00</updated><title type='text'>time format</title><content type='html'>Five is the minimum acceptable field width for the TIMEw. informat. If you specify a w value less than 5, you'll receive the following error message in the SAS log:&lt;br /&gt;&lt;br /&gt;SAS Log&lt;br /&gt;ERROR 29 - 85: Width specified for informat               TIME is invalid.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109487761835454569?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109487761835454569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109487761835454569' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109487761835454569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109487761835454569'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/time-format.html' title='time format'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282945.post-109487485300515475</id><published>2004-09-10T20:43:00.000-07:00</published><updated>2004-09-10T20:54:13.006-07:00</updated><title type='text'>SAS time</title><content type='html'>SAS time values are calculated by counting the number of seconds from midnight to the given time. DATETIME values are based on the number of seconds from midnight, January 1, 1960, to the given date and time.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282945-109487485300515475?l=zheng-yan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zheng-yan.blogspot.com/feeds/109487485300515475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8282945&amp;postID=109487485300515475' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109487485300515475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282945/posts/default/109487485300515475'/><link rel='alternate' type='text/html' href='http://zheng-yan.blogspot.com/2004/09/sas-time.html' title='SAS time'/><author><name>Yan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
