<?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:blogger='http://schemas.google.com/blogger/2008' 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-3582638560360407599</id><updated>2024-12-18T19:29:46.044-08:00</updated><category term="slider"/><category term="SAS FORUM"/><title type='text'>SAS &#39;O&#39; LOG</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default?start-index=26&amp;max-results=25'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>77</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-824253772750641005</id><published>2014-03-06T23:40:00.002-08:00</published><updated>2015-12-02T11:06:19.693-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="slider"/><title type='text'>How to create a PDF ﬁle of a SAS job</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;For creating a PDF file of a SAS job or SAS procedure, we need to bracket the section of code for which you want to create tables or/and graphs:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;options orientation=landscape;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;ods pdf file=’test.pdf’;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;goptions device=pdf colors=(black) rotate=landscape;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;\SAS\ procedures&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;ods pdf close;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;Example:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;options orientation=landscape;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;ods pdf file=’output-to-Test.pdf’;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;goptions device=pdf colors=(black) rotate=landscape;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;ods graphics on;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/824253772750641005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2014/03/how-to-create-pdf-le-of-sas-job.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/824253772750641005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/824253772750641005'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2014/03/how-to-create-pdf-le-of-sas-job.html' title='How to create a PDF ﬁle of a SAS job'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-6569612096448515175</id><published>2014-02-26T23:48:00.000-08:00</published><updated>2014-02-26T23:48:05.290-08:00</updated><title type='text'>SAS Interview questions and answers Part 1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;Do you have scheduled interview and want to know about the general questions asked in the SAS interview?&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;Here are some of the general questions asked in an interview with their answers.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;b&gt;When would you use select instead of IF statement?&lt;/b&gt;&lt;br /&gt;A:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Select is used over IF statement when you are using a condition to compare with several other conditions: Here is an example:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;Data exam;&lt;br /&gt;Set exam;&lt;br /&gt;select (pass);&lt;br /&gt;when Physics &amp;gt;60;&lt;br /&gt;when math &amp;gt; 100;&lt;br /&gt;when English = 50;&lt;br /&gt;otherwise fail;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the one statement to set the criteria of data that can be coded in any step?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;A) Options statement.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What does ERRORS = 1 do in the OPTIONS statement?&lt;/b&gt;&lt;br /&gt;A)&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;If there an error in the data for a observation then ERROR variable will have a value of 1 else 0&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;b&gt;Is there any difference between VAR A1 - A4 and VAR A1 -- A4?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;A) No, there is no diff between VAR A1-A4 and VAR A1—A4. You can use single (-) or double (--) but if you use more than 2 (---) then it will thrown an error.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;b&gt;Have you seen the error message &quot;&lt;/b&gt;&lt;/span&gt;&lt;strong style=&quot;color: #666666; font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&quot;numeric values have been converted to character&quot;? What does it mean?&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;A)&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;It means SAS has automatically converted the numeric variable to character to perform the functions.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;Why is a STOP statement needed for the POINT= option on a SET statement?&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;A) Because POINT= reads only the specified observations, SAS cannot detect an end-of-file condition as it would if the file were being read sequentially.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;b&gt;Can you control the number of observations read in by SAS?&lt;/b&gt;&lt;br /&gt;A) Yes, by using FIRSTOBS and OBS option&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Approximately what date is represented by the SAS date value of 730?&lt;/strong&gt;&lt;br /&gt;A) 31st December 1961&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Does SAS &#39;Translate&#39; (compile) or does it &#39;Interpret&#39;? Explain.&lt;/strong&gt;&lt;br /&gt;A) Compile&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What does the RUN statement do?&lt;/strong&gt;&lt;br /&gt;A)&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;SAS editor will start compiling the data or proc step as soon as it encounters the run statement. SO if there are more than one data steps or a proc step followed by a data step then you can avoid using the run statement.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/6569612096448515175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2014/02/sas-interview-questions-and-answers.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/6569612096448515175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/6569612096448515175'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2014/02/sas-interview-questions-and-answers.html' title='SAS Interview questions and answers Part 1'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-2793224320815227007</id><published>2014-02-25T23:44:00.004-08:00</published><updated>2015-12-02T11:06:19.685-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="slider"/><title type='text'>How to retrieve the first character of a variable in SAS</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white; line-height: 19.1875px;&quot;&gt;&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;If you need to create a variable which has only first character of the character variable, then there are 4 different ways with which you can do the same in SAS. Below each variable B1,B2,B3 and B4 contains Letter A, but the length is not the same for all the four variables.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-color: #f9f9f9; background-image: none; border: 0px none white; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;kw6&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;data&lt;/span&gt; test;
 name=&lt;span class=&quot;st0&quot; style=&quot;color: #a020f0;&quot;&gt;&#39;Alpha&#39;&lt;/span&gt;;
 B1 = &lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;substr&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;name,&lt;span class=&quot;nu0&quot; style=&quot;color: seagreen; font-weight: bold;&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;nu0&quot; style=&quot;color: seagreen; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;
 B2 = first&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;name&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;
 &lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;substr&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(B&lt;/span&gt;3,&lt;span class=&quot;nu0&quot; style=&quot;color: seagreen; font-weight: bold;&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;nu0&quot; style=&quot;color: seagreen; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt; = name;
 &lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;length&lt;/span&gt; B4 $1;
 B4 = name; 
&lt;span class=&quot;kw6&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;run&lt;/span&gt;;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/2793224320815227007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2014/02/how-to-retrieve-first-character-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/2793224320815227007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/2793224320815227007'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2014/02/how-to-retrieve-first-character-of.html' title='How to retrieve the first character of a variable in SAS'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-3259191401524398683</id><published>2014-02-25T23:39:00.004-08:00</published><updated>2015-12-02T11:06:19.688-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="slider"/><title type='text'>Read data directly from websites in SAS</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;Do you know you can read data from websites directly? You can use the URL Access Method in the filename statement in SAS.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;background-color: #f9f9f9; border: 1px dashed rgb(47, 111, 171); font-family: monospace, Courier; font-size: 13px; line-height: 1.3em; padding: 1em;&quot;&gt;filename seercode URL &quot;http://www.abc/data.txt&quot;;
data siterecode;
infile seercode truncover;
input @1 bigline $char256.;
run;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/3259191401524398683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2014/02/read-data-directly-from-websites-in-sas.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/3259191401524398683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/3259191401524398683'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2014/02/read-data-directly-from-websites-in-sas.html' title='Read data directly from websites in SAS'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-813300809802195802</id><published>2014-02-25T23:29:00.001-08:00</published><updated>2015-12-02T11:06:19.690-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="slider"/><title type='text'>How to clear library of data in SAS</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;At times there is a need to clear the permanent library of datasets at one go. There is an option in SAS, PROC DATASETS provides a solution on the proc statement with a Kill Option.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;Here is an example:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-color: #f9f9f9; background-image: none; border: 0px none white; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;re1&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;PROC DATASETS&lt;/span&gt; LIBRARY = TEMP KILL;
&lt;span class=&quot;kw6&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;RUN&lt;/span&gt;;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/813300809802195802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2014/02/how-to-clear-library-of-data-in-sas.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/813300809802195802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/813300809802195802'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2014/02/how-to-clear-library-of-data-in-sas.html' title='How to clear library of data in SAS'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-8498934201429506818</id><published>2014-02-25T23:24:00.002-08:00</published><updated>2014-02-25T23:24:30.727-08:00</updated><title type='text'>Aliases in SAS</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;I could choose to let “pp” be&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;aliased to “proc print; run;”&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;→&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;Should I want to add a print statement to&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;my code, I only need to type:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;pp&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;enter&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;and SAS will substitute in the “proc print”&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;statement.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;You can add as many as you want and can&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;edit them at a future date&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;SAS will save these for your next session in&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;your SAS profile&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;These work in Windows, but not sure about&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: Georgia, Times New Roman, serif;&quot;&gt;UNIX OS&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/8498934201429506818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2014/02/aliases-in-sas.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/8498934201429506818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/8498934201429506818'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2014/02/aliases-in-sas.html' title='Aliases in SAS'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-6509823990718400330</id><published>2013-10-14T02:29:00.002-07:00</published><updated>2013-10-14T02:29:14.307-07:00</updated><title type='text'>Automatic email from SAS after program completion</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;If you want to sent an email as soon as your program completes, try:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;sas program.sas ; echo program.sas is done | mail youruserid&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;If you don&#39;t want to regularly check the status of the program and wants to get notified to start your next job&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;If you only want an email if your program bugs out, try:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;sas program.sas || echo your program didn&#39;t work | mail youruserid&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;You can write anything that you want in your email after echo.&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/6509823990718400330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/10/automatic-email-from-sas-after-program.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/6509823990718400330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/6509823990718400330'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/10/automatic-email-from-sas-after-program.html' title='Automatic email from SAS after program completion'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-8549779860904665032</id><published>2013-10-14T00:07:00.001-07:00</published><updated>2013-10-14T00:11:05.405-07:00</updated><title type='text'>Limit the size of dataset for test</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Sometime datasets are too large and to run the test on those datasets to check if the program is working fine, it takes a lot of time.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;You can overcome this by OBS = option: Here is an example:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: #cfe2f3; font-family: Verdana, sans-serif;&quot;&gt;Example:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cfe2f3; font-family: Verdana, sans-serif;&quot;&gt;data sub85;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cfe2f3; font-family: Verdana, sans-serif;&quot;&gt;set lib.all85 (obs=1000);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cfe2f3; font-family: Verdana, sans-serif;&quot;&gt;proc glm data=sub85;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cfe2f3; font-family: Verdana, sans-serif;&quot;&gt;model icd90=female black state1-stat49;&lt;/span&gt;&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Again, you can also use this as a system option:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;options obs=1000 [other SAS system options here];&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;You can remove it once the program is running smoothly.&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/8549779860904665032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/10/limit-size-of-dataset-for-test.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/8549779860904665032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/8549779860904665032'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/10/limit-size-of-dataset-for-test.html' title='Limit the size of dataset for test'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-2354486911998644756</id><published>2013-10-10T11:20:00.001-07:00</published><updated>2013-10-10T11:20:46.422-07:00</updated><title type='text'>Order of execution in multiple dataset options?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;When multiple dataset options are applied to a single statement, then the order of execution matters. The rule of thumb is that they are executed according to the alphabetical order of their names. That is, a&amp;nbsp;drop&amp;nbsp;option is executed before a&amp;nbsp;keep, and a&amp;nbsp;keep&amp;nbsp;before a&amp;nbsp;rename.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Now, given also that the variable number is decided by the order of first-appearance in the data step, can you guess the output of the code snippet below?&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;mw-geshi mw-code mw-content-ltr&quot; dir=&quot;ltr&quot; style=&quot;background-color: #f9f9f9; border: 1px dashed rgb(47, 111, 171); direction: ltr; font-family: monospace, Courier; font-size: 13px; line-height: 1.3em; padding: 1em;&quot;&gt;
&lt;div class=&quot;sas source-sas&quot; style=&quot;font-family: monospace; line-height: normal;&quot;&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-image: none; border: 0px none white; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;kw6&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;data&lt;/span&gt; one;
  &lt;span class=&quot;kw4&quot; style=&quot;color: blue;&quot;&gt;set&lt;/span&gt; sashelp.class&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: blue;&quot;&gt;rename&lt;/span&gt;=&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;name=eman&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kw4&quot; style=&quot;color: blue;&quot;&gt;keep&lt;/span&gt;=age sex name &lt;span class=&quot;kw4&quot; style=&quot;color: blue;&quot;&gt;drop&lt;/span&gt;=age&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;
&lt;span class=&quot;kw6&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;run&lt;/span&gt;;
&amp;nbsp;
&lt;span class=&quot;coMULTI&quot; style=&quot;color: darkgreen; font-style: italic;&quot;&gt;/* check */&lt;/span&gt;
&lt;span class=&quot;re1&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;proc contents&lt;/span&gt; &lt;span class=&quot;kw6&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;data&lt;/span&gt;=one &lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;varnum&lt;/span&gt;;
&lt;span class=&quot;kw6&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;run&lt;/span&gt;;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/2354486911998644756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/10/order-of-execution-in-multiple-dataset.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/2354486911998644756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/2354486911998644756'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/10/order-of-execution-in-multiple-dataset.html' title='Order of execution in multiple dataset options?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-2929897762712054058</id><published>2013-10-09T23:20:00.003-07:00</published><updated>2013-10-09T23:20:50.125-07:00</updated><title type='text'>How to check for the existence of a directory in SAS?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Did you ever encountered with an issue where you need to check the existence of a directory with a SAS code. Here is the code which let you do the same.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;If directory exists macro will return 1 else 0.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-color: #f9f9f9; background-image: none; border: 0px none white; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%macro&lt;/span&gt; DirExist&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;dir&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;&amp;nbsp;; 
   &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%LOCAL&lt;/span&gt; rc &lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;fileref&lt;/span&gt; &lt;span class=&quot;kw4&quot; style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;; 
   &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%let&lt;/span&gt; rc = &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%sysfunc&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;filename&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;fileref&lt;/span&gt;,&lt;span class=&quot;re0&quot; style=&quot;color: blue; font-weight: bold;&quot;&gt;&amp;amp;dir&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;&amp;nbsp;; 
   &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%if&lt;/span&gt; &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%sysfunc&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;fexist&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&amp;amp;&lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;fileref&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%then&lt;/span&gt; &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%let&lt;/span&gt; &lt;span class=&quot;kw4&quot; style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;=&lt;span class=&quot;nu0&quot; style=&quot;color: seagreen; font-weight: bold;&quot;&gt;1&lt;/span&gt;;    
   &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%else&lt;/span&gt; &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%let&lt;/span&gt; &lt;span class=&quot;kw4&quot; style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;=&lt;span class=&quot;nu0&quot; style=&quot;color: seagreen; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
   &amp;amp;&lt;span class=&quot;kw4&quot; style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;
&lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%mend&lt;/span&gt; DirExist;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-color: #f9f9f9; background-image: none; border: 0px none white; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;
&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-color: #f9f9f9; background-image: none; border: 0px none white; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;
&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-color: #f9f9f9; background-image: none; border: 0px none white; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;pre class=&quot;de1&quot; style=&quot;background-image: none; border: 0px none white; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;coMULTI&quot; style=&quot;color: darkgreen; font-style: italic;&quot;&gt;/* Usage */&lt;/span&gt;
option noxwait; &lt;span class=&quot;coMULTI&quot; style=&quot;color: darkgreen; font-style: italic;&quot;&gt;/* SAS 8.2 only */&lt;/span&gt;
&lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%put&lt;/span&gt;&amp;nbsp;%DirExist&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;C:\Documents &lt;span class=&quot;kw4&quot; style=&quot;color: blue;&quot;&gt;and&lt;/span&gt; Settings\&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;
&lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%put&lt;/span&gt;&amp;nbsp;%DirExist&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;Test&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;&lt;/pre&gt;
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/2929897762712054058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/10/how-to-check-for-existence-of-directory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/2929897762712054058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/2929897762712054058'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/10/how-to-check-for-existence-of-directory.html' title='How to check for the existence of a directory in SAS?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-8296444838131046097</id><published>2013-10-09T02:30:00.005-07:00</published><updated>2013-10-09T02:30:48.584-07:00</updated><title type='text'>Aligning Character Values with a Put Function</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;We often use LEFT and RIGHT SAS functions to align the character values. This can also be achieved by PUT function.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Let us see this with and example:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-color: #f9f9f9; background-image: none; border: 0px none white; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;kw6&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;data&lt;/span&gt; temp;
&amp;nbsp;
alphabetw=&lt;span class=&quot;st0&quot; style=&quot;color: #a020f0;&quot;&gt;&#39;  a  &#39;&lt;/span&gt;;
chardate=&lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;put&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;alphabetw,$10. -l&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;
&lt;span class=&quot;kw4&quot; style=&quot;color: blue;&quot;&gt;output&lt;/span&gt;&amp;nbsp;;
chardate=&lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;put&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;alphabetw,$10. -c&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;
&lt;span class=&quot;kw4&quot; style=&quot;color: blue;&quot;&gt;output&lt;/span&gt;&amp;nbsp;;
chardate=&lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;put&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;alphabetw,$10. -r&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;
&lt;span class=&quot;kw4&quot; style=&quot;color: blue;&quot;&gt;output&lt;/span&gt;&amp;nbsp;;
&amp;nbsp;
&lt;span class=&quot;kw6&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;run&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-color: #f9f9f9; background-image: none; border: 0px none white; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;
&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-color: #f9f9f9; background-image: none; border: 0px none white; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;
&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-color: #f9f9f9; background-image: none; border: 0px none white; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;pre class=&quot;de1&quot; style=&quot;background-image: none; border: 0px none white; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;re1&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;proc print&lt;/span&gt;;&lt;span class=&quot;kw6&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;run&lt;/span&gt;;
&amp;nbsp;
Obs    alphabetw  chardate
&amp;nbsp;
 &lt;span class=&quot;nu0&quot; style=&quot;color: seagreen; font-weight: bold;&quot;&gt;1&lt;/span&gt;        a       a
 &lt;span class=&quot;nu0&quot; style=&quot;color: seagreen; font-weight: bold;&quot;&gt;2&lt;/span&gt;        a           a
 &lt;span class=&quot;nu0&quot; style=&quot;color: seagreen; font-weight: bold;&quot;&gt;3&lt;/span&gt;        a                a&lt;/pre&gt;
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/8296444838131046097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/10/aligning-character-values-with-put.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/8296444838131046097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/8296444838131046097'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/10/aligning-character-values-with-put.html' title='Aligning Character Values with a Put Function'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-5838560520443197040</id><published>2013-10-07T04:58:00.000-07:00</published><updated>2013-10-07T04:58:03.184-07:00</updated><title type='text'>How to label the variable created by PROC TRANSPOSE</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif;&quot;&gt;In Proc Transpose, you can tell SAS, how to NAME the new variable created from the result of Proc Transpose.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Also &amp;nbsp;by using the the value of the variable from the original dataset, you can tell SAS to LABEL the variables.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Below is the example demonstrating the same.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;background-color: white; line-height: 19.1875px;&quot;&gt;
&lt;div class=&quot;source-sas&quot; style=&quot;line-height: normal;&quot;&gt;
&lt;pre style=&quot;background-color: #f9f9f9; border: 0px none white; padding: 1em;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif;&quot;&gt;  &lt;span class=&quot;re1&quot; style=&quot;font-weight: bold;&quot;&gt;proc transpose&lt;/span&gt; &lt;span class=&quot;kw6&quot; style=&quot;font-weight: bold;&quot;&gt;data&lt;/span&gt;=test out=test2 prefix=visit;
    &lt;span class=&quot;kw4&quot;&gt;by&lt;/span&gt; subjid;
    &lt;span class=&quot;kw3&quot;&gt;var&lt;/span&gt; labres;
    id visit;
    idlabel visitl;
  &lt;span class=&quot;kw6&quot; style=&quot;font-weight: bold;&quot;&gt;run&lt;/span&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Based on the values in the VISIT variable, SAS will name the variables VISITx .. VISITy. And will ALSO label VISITx with the corresponding value from VISITL on the given record and label VISITy with the corresponding value from VISITL on the given record for all created variables.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/5838560520443197040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/10/how-to-label-variable-created-by-proc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/5838560520443197040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/5838560520443197040'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/10/how-to-label-variable-created-by-proc.html' title='How to label the variable created by PROC TRANSPOSE'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-7428234278651137053</id><published>2013-08-30T01:34:00.003-07:00</published><updated>2013-08-30T01:36:01.517-07:00</updated><title type='text'>SUBSTR to replace</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;SUBSTR can also to used to replace values of a string. In the below example the variable ID, where the first two characters can replaced by XX, with the help of the SUBSTR function&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;background-color: white; line-height: 19.1875px;&quot;&gt;
&lt;div class=&quot;source-sas&quot; style=&quot;line-height: normal;&quot;&gt;
&lt;pre style=&quot;background-color: #f9f9f9; border: 0px none white; padding: 1em;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;LAST      NAME    ID
Barczak  George  CP436
Adams   Linda     LA543
Preiss    Gloria    AU942&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;To change the first two letters of the &amp;nbsp;ID to &quot;XX&quot;, use the SUBSTR function on the left side of the assignment statement:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;background-color: white; line-height: 19.1875px;&quot;&gt;
&lt;div class=&quot;source-sas&quot; style=&quot;line-height: normal;&quot;&gt;
&lt;pre style=&quot;background-color: #f9f9f9; border: 0px none white; padding: 1em;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;substr&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;employee_id,&lt;span class=&quot;nu0&quot; style=&quot;font-weight: bold;&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;nu0&quot; style=&quot;font-weight: bold;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&#39;DA&#39;&lt;/span&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Result:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;background-color: white; line-height: 19.1875px;&quot;&gt;
&lt;div class=&quot;source-sas&quot; style=&quot;line-height: normal;&quot;&gt;
&lt;pre style=&quot;background-color: #f9f9f9; border: 0px none white; padding: 1em;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;LAST       NAME     ID
Barczak   George   XX436
Adams    Linda      XX543
Preiss     Gloria     XX942&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/7428234278651137053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/08/substr-to-replace.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/7428234278651137053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/7428234278651137053'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/08/substr-to-replace.html' title='SUBSTR to replace'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-4171555674195441124</id><published>2013-08-26T22:02:00.002-07:00</published><updated>2013-08-26T22:02:39.318-07:00</updated><title type='text'>No Warning Messages</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: Verdana, sans-serif;&quot;&gt;When you write a code ensuring no warning messages are thrown in log but this get the error message below.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #f9f9f9; border: 0px none white; font-family: monospace, &#39;Courier New&#39;; padding: 1em;&quot;&gt;&lt;span class=&quot;kw8&quot; style=&quot;color: lime;&quot;&gt;WARNING&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: seagreen; font-weight: bold;&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: seagreen; font-weight: bold;&quot;&gt;-169&lt;/span&gt;: The quoted string currently being processed has become
                more than &lt;span class=&quot;nu0&quot; style=&quot;color: seagreen; font-weight: bold;&quot;&gt;262&lt;/span&gt; characters long.  You may have unbalanced 
                quotation marks.&lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #666666;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;If so, check out the QUOTELENMAX/NOQUOTELENMAX system
option. This option is particularly appropriate when you have long text strings
in, for example, the ODS HTML TEXT= statement&lt;/span&gt;.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/4171555674195441124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/08/no-warning-messages.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/4171555674195441124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/4171555674195441124'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/08/no-warning-messages.html' title='No Warning Messages'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-2146931068761116671</id><published>2013-08-12T06:42:00.004-07:00</published><updated>2013-08-12T06:42:42.493-07:00</updated><title type='text'>Save Disk Space in SAS</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Save disk space and make your data sets easier to understand by inputting only the data you need. Drop variables you no longer need.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;DATA mylib.yearly(DROP=Rain1-Rain12);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;SET Old(DROP=Snow1-Snow12);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Total = SUM(of Rain1-Rain12);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;programming statements&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;RUN;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Drop DO loop indexing variables.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;data Mylib.NewCost (DROP=i);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;set Mylib.Cost;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;array Amt(100) Amt1-Amt100;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;do i=1 TO 100;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Amt(i)=MAX(0,Amt(i));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;end;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;run;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Store numeric categorical data in character variables to save space.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;length quest1-quest40 $ 1;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/2146931068761116671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/08/save-disk-space-in-sas.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/2146931068761116671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/2146931068761116671'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/08/save-disk-space-in-sas.html' title='Save Disk Space in SAS'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-5758037215148002619</id><published>2013-08-12T06:41:00.002-07:00</published><updated>2013-08-12T06:41:49.888-07:00</updated><title type='text'>Increase EFFICIENCY of a SAS code</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;THINK Before You Type. One of the best practices of a good programming is planning before you type. Try to keep the code as simple as possible. Use procedures more than datasteps.&amp;nbsp;For&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;example, permanently save only the final data set. Use temporary data sets to store intermediate results.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Instead of this:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;data Mylib.New;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;set Mylib.Sept Mylib.Oct;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;programming statements&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;run;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;data Mylib.District;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;set Mylib.All Mylib.New;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;programming statements&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;run;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Use this:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;data New;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;set Mylib.Sept Mylib.Oct;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;programming statements&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;run;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;data Mylib.District;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;set Mylib.All New;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;programming statements&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;run;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/5758037215148002619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/08/increase-efficiency-of-sas-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/5758037215148002619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/5758037215148002619'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/08/increase-efficiency-of-sas-code.html' title='Increase EFFICIENCY of a SAS code'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-8822284144714976406</id><published>2013-08-10T09:51:00.003-07:00</published><updated>2013-08-10T09:52:46.321-07:00</updated><title type='text'>Check for the existence of a dataset</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white; line-height: 19.1875px;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;So often there are so many datasets in a library that it becomes impossible to look out for a particular dataset. To help find a dataset, we can use a simple DATA step function for checking the existence if the dataset. The function is EXIST. Here is the macro to achieve this.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #f9f9f9; border: 0px none white; font-family: monospace, &#39;Courier New&#39;; padding: 1em;&quot;&gt; &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%MACRO&lt;/span&gt; DATA_EXIST&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;INPUT&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;
  &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%IF&lt;/span&gt; &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%SYSFUNC&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;EXIST&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;color: blue; font-weight: bold;&quot;&gt;&amp;amp;INPUT&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%THEN&lt;/span&gt; &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%DO&lt;/span&gt;;
  &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%PUT&lt;/span&gt; &lt;span class=&quot;kw6&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;DATA&lt;/span&gt; EXISTS;
  &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%END&lt;/span&gt;;
  &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%ELSE&lt;/span&gt; &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%DO&lt;/span&gt;;
  &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%PUT&lt;/span&gt; &lt;span class=&quot;kw6&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;DATA&lt;/span&gt; DOES &lt;span class=&quot;kw4&quot; style=&quot;color: blue;&quot;&gt;NOT&lt;/span&gt; EXISTS;
  &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%END&lt;/span&gt;;
 &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%MEND&lt;/span&gt;;
&amp;nbsp;
 %DATA_EXIST&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;SASUSER.TEST&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f9f9f9; border: 0px none white; padding: 1em;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Further simplification can be done by:&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f9f9f9; border: 0px none white; padding: 1em;&quot;&gt;&lt;pre style=&quot;border: 0px none white; font-family: monospace, &#39;Courier New&#39;; padding: 1em;&quot;&gt;&lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%MACRO&lt;/span&gt; D_EXIST&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;INPUT&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;
 &lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%SYSFUNC&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;EXIST&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;color: blue; font-weight: bold;&quot;&gt;&amp;amp;INPUT&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;kw2&quot; style=&quot;color: blue;&quot;&gt;%MEND&lt;/span&gt; D_EXIST;&lt;/pre&gt;
&lt;pre style=&quot;border: 0px none white; font-family: monospace, &#39;Courier New&#39;; padding: 1em;&quot;&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: Verdana, sans-serif; line-height: 19.1875px; white-space: normal;&quot;&gt;The macro&amp;nbsp;%D_EXIST could be called from within an expression.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;border: 0px none white; font-family: monospace, &#39;Courier New&#39;; padding: 1em;&quot;&gt;&lt;span style=&quot;font-size: 13px; white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw2&quot; style=&quot;color: blue; font-size: 13px; white-space: normal;&quot;&gt;%IF&lt;/span&gt;&lt;span style=&quot;font-size: 13px; white-space: normal;&quot;&gt;&amp;nbsp;%D_EXIST&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66; font-size: 13px; white-space: normal;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: 13px; white-space: normal;&quot;&gt;SASHELP.CLASS&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66; font-size: 13px; white-space: normal;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: 13px; white-space: normal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kw2&quot; style=&quot;color: blue; font-size: 13px; white-space: normal;&quot;&gt;%THEN&lt;/span&gt;&lt;span style=&quot;font-size: 13px; white-space: normal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kw2&quot; style=&quot;color: blue; font-size: 13px; white-space: normal;&quot;&gt;%DO&lt;/span&gt;&lt;span style=&quot;font-size: 13px; white-space: normal;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/8822284144714976406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/08/check-for-existence-of-dataset.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/8822284144714976406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/8822284144714976406'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/08/check-for-existence-of-dataset.html' title='Check for the existence of a dataset'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-2113450241791403723</id><published>2013-08-10T06:14:00.004-07:00</published><updated>2013-08-10T06:14:53.502-07:00</updated><title type='text'>The Essence of PROC APPEND</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;The APPEND procedure (and APPEND statement of the DATASETS procedure) is an efficient method for concatenating observations from a smaller data set to a larger data set. The BASE= data set option is reserved for the larger of the two data sets with the DATA= option for the smaller data set. Essentially, the APPEND procedure avoids reading any observations in the BASE= data set by positioning the record pointer at the end of the BASE= data set. Each observation from the smaller data set is then applied one at a time to the end of the BASE= data set. In the first example, the BASE= data set identifies a larger data set called MASTER and the DATA= data set identifies the smaller TXN data set.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Code:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;PROC APPEND&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;BASE=master&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;DATA=txn;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;run;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;When two or more data sets need to be concatenated, multiple APPEND procedures are issued. In the next example, two separate PROC APPEND steps are specified to concatenate the two smaller data sets (TXN1 and TXN2) at the end of the larger BASE= (MASTER) data set.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Code:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;PROC APPEND&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;BASE=master&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;DATA=txn1;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;RUN;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;PROC APPEND&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;BASE=master&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;DATA=txn2;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;RUN;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Forcing the Concatenation of Data Sets&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;When one or more variables in the input data set, represented by the DATA= option, are not present in the BASE= data set, or the variables in the input data set are not of the same type as the variables in the BASE= data set, an optional FORCE option can be specified on the PROC APPEND statement to force the concatenation of the data sets. Using the FORCE option also prevents an error from being generated in these situations. The next example illustrates the FORCE option being specified in the concatenation of the TXN data set to the MASTER data set.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Code:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;PROC APPEND&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;BASE=master&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;DATA=txn&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;FORCE;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;RUN;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Selecting Observations for Concatenation&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;By default, all the rows of an input data set are typically concatenated to the end of the base data set. But when only selected rows of an input data set are desired, an optional WHERE clause can be specified for the associated input data set as a data set option. This is accomplished by specifying an optional WHERE clause. The WHERE clause defines the logical conditions that control which observations will be selected from an input data set, and ultimately concatenated to the end of the base data set. In the next example, a WHERE clause is specified to select only ‘PG’ and ‘PG13’ movies from the input data set for concatenation to the end of the base data set.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Code:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;PROC APPEND&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;BASE=master&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;DATA=txn (WHERE=(rating in (&#39;PG&#39;, &#39;PG-13&#39;)));&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;RUN;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Designating the Master&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;It is not at all a given that BASE= should point to the longer of the two data sets and DATA= to the shorter. One might do the opposite and use the shorter as the base&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;§ because one has been established as the master and the other is merely a container for a subset&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;§ to preserve structural properties (such as variable order)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;§ because the two are in different libraries and the concatenation belongs in one of those and not the other&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;§ to maintain BY group ordering&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;§ to preserve a name for the concatenation without the need to invoke PROC DATASETS to swap names&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;If none of these concerns arise, and one is indifferent about the order, and one knows which data set is the larger of the two, it does make sense to reduce I/O by making the larger data set the base.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Conclusion&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;The APPEND procedure is a powerful tool for SAS users to use for data set concatenation purposes. Users can also concatenate unlike data sets using the FORCE option on the PROC APPEND statement as well as select which observations are captured from the input data set using a WHERE clause and concatenated to the end of the base data set. Users are encouraged to explore the many capabilities the APPEND procedure (or the APPEND statement of the DATASETS procedure) has to offer.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/2113450241791403723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/08/the-essence-of-proc-append.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/2113450241791403723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/2113450241791403723'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/08/the-essence-of-proc-append.html' title='The Essence of PROC APPEND'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-206407697332963226</id><published>2013-08-10T06:14:00.001-07:00</published><updated>2013-08-10T06:14:03.457-07:00</updated><title type='text'>Proc Datasets Tip</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Delete all labels&lt;/b&gt;&amp;nbsp;&lt;b&gt;in th.pnsmutaa&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;proc datasets library = th nolist;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;modify pnsmutaa;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;attrib _all_ label=&#39;&#39;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;quit;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Rename th.bstpns_org to th.bstpns_org1&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;proc datasets library = th nolist;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;change stpns_org = bstpns_org1;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;quit;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Delete all in a library&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;proc datasets library = work kill nolist;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;quit;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Delete one specific dataset from a library&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;proc datasets library = work nolist;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;delete tst1;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;quit;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Copy all in library th to work&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;proc datasets nolist;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;copy out=work in=th;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;quit;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Copy th.rappformat to work.rappformat&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;proc datasets nolist;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;copy out=work in = th;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;select rappformat;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;quit;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/206407697332963226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/08/proc-datasets-tip.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/206407697332963226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/206407697332963226'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/08/proc-datasets-tip.html' title='Proc Datasets Tip'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-1629479191722675101</id><published>2013-08-10T06:13:00.001-07:00</published><updated>2013-08-10T06:13:18.709-07:00</updated><title type='text'>Creating SAS dataset using datalines gives error if written inside a macro</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;The error is something like this:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;ERROR: The macro X generated cards (data lines) for the DATA step which could cause incorrect results.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;The DATA step and macro will stop executing.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;The solution is to insert the values in a table using proc sql.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;The sample code below demonstrates the same.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;options nomlogic mprint nosymbolgen;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;%macro insertData;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;proc sql;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;create table class&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;(Semester char(25) ,&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Professor char(24),&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Location char(12),&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Cost num(5));&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;quit;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;proc sql;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;insert into class&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;(Semester,Professor,Location, Cost)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;values(&#39;Fall&#39;,&#39;Dr. Armstrong&#39;,&#39;London&#39;,3000)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;values(&#39;Spring&#39;,&#39;Dr. Armstrong&#39;,&#39;Prague&#39;, 3300)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;values(&#39;Spring&#39;,&#39;Dr. Hannity&#39;,&#39;Beijing&#39;,3000)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;values(&#39;Fall&#39;,&#39;Dr. Hannity&#39;,&#39;London&#39;,3000)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;values(&#39;Spring&#39;,&#39;Dr. Smith&#39;,&#39;Prague&#39;,3300)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;values(&#39;Fall&#39;,&#39;Dr. Smith&#39;,&#39;Los Angeles&#39;,3800)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;quit;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;%mend insertData;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;%insertData;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/1629479191722675101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/08/creating-sas-dataset-using-datalines.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/1629479191722675101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/1629479191722675101'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/08/creating-sas-dataset-using-datalines.html' title='Creating SAS dataset using datalines gives error if written inside a macro'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-8540866764124437556</id><published>2013-08-10T06:12:00.002-07:00</published><updated>2013-08-10T06:12:29.986-07:00</updated><title type='text'>Using the ANY and ALL Operators in Proc SQL</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;The ANY and ALL operators are Proc SQL operators which can be used to compare the result of a query expression against either ANY or ALL of the results returned from another.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;The following example demonstrates its use as part of a subquery comparing the annual sales of sports shoes from our &#39;Mozart&#39; company with the top brands nationwide. The ANY operator is used initially to determine which of our company brands are outselling any one or more of the market leaders.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;data mozart_shoes;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;format id z3. name $char24.;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;input id name $ &amp;amp; sales;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;datalines;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;001 Super-tread trainer 50000&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;002 X-Pro sports trainer 60000&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;003 Road runner deluxe 55000&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;004 Triathlon special 30000&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;run;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;data top_brands;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;format name $char24.;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;input name $ &amp;amp; sales;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;datalines;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Cougar 500 58000&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Mike running pro 56000&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Abibas Super-tread 53000&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;run;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;proc sql;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;select name, sales&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;from mozart_shoes&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;where sales gt any (select sales from top_brands);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;quit;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;This query returns the following results as expected where these two sports shoes have annual sales greater than at least one of the top brands.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;name sales&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;__________________________________&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;X-Pro sports trainer 60000&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Road runner deluxe 55000&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Changing the operator to all shows us the one shoe out competing all of the top brands.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;name sales&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;__________________________________&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;X-Pro sports trainer 60000&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;The NOT operator can also be used to good effect as part of the condition. For example, changing our code to the following:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;proc sql;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;select name, sales&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;from mozart_shoes&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;where sales not gt any (select sales from top_brands);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;quit;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;returns all of the shoes whose annual sales did not exceed any of the top brands.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;name sales&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;__________________________________&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Super-tread trainer 50000&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-size: 12px; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Triathlon special 30000&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/8540866764124437556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/08/using-any-and-all-operators-in-proc-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/8540866764124437556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/8540866764124437556'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/08/using-any-and-all-operators-in-proc-sql.html' title='Using the ANY and ALL Operators in Proc SQL'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-7192864970807577909</id><published>2013-08-10T06:11:00.002-07:00</published><updated>2013-08-10T06:11:35.164-07:00</updated><title type='text'>LARGEST and SMALLEST Functions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;The MAX and MIN functions allow you to easily identify the maximum and minimum values from a selection of variables. However in order to find the second highest value or the bottom 3 values you will need to make use of the SAS 9 functions LARGEST and SMALLEST.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;The following examples are based on the data listed below:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;data balances;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;input custid $ bal1 bal2 bal3 bal4 bal5 bal6;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;datalines;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;12345 911.00 863.30 896.98 1672.26 1675.20 602.42&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;12346 62.27 10.28 1377.79 1683.42 1290.92 553.13&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;12347 1996.54 74.68 253.94 374.02 691.90 593.75&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;12348 1494.83 1114.74 332.76 505.95 . 963.98&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;12349 336.61 295.78 .a 1965.40 592.76 .b&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;run;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Maximum and Minimum&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;The syntax for the maximum and minimum functions is as follows.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;function(list of variables);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Largest and Smallest&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;The largest and smallest functions have similar syntax.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;function(value, list);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Where value is the nth item you want (e.g. 2 for the second largest/smallest) and&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;list is a list of variables that will be processed.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;The following code demonstrates the use of the MAX, MIN, LARGEST and SMALLEST functions.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;data balances2;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;set balances;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;maxbal=max(of bal1-bal6);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;minbal=min(of bal1-bal6);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;large1=largest(1,of bal1-bal6);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;large2=largest(2,of bal1-bal6);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;small1=smallest(1,of bal1-bal6);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;small2=smallest(2,of bal1-bal6);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;small3=smallest(3,of bal1-bal6);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;drop bal:;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;run;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;The following results are produced:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Max, Min, Smallest and Largest Functions&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;maxbal minbal large1 large2&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;1675.20 602.42 1675.20 1672.26&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;1683.42 10.28 1683.42 1377.79&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;1996.54 74.68 1996.54 691.90&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;1494.83 332.76 1494.83 1114.74&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;1965.40 295.78 1965.40 592.76&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Max, Min, Smallest and Largest Functions&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;small1 small2 small3&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;602.42 863.30 896.98&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;10.28 62.27 553.13&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;74.68 253.94 374.02&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;332.76 505.95 963.98&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;295.78 336.61 592.76&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Note that where the first argument in the largest and smallest functions is set to &#39;1&#39;, the result is the same as the max and min functions. Also note that in this example when evaluating the minimum, the missing values have been ignored.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Handling of missing values&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;The max and min functions completely exclude missing data from the evaluation however the LARGEST and SMALLEST functions handle missing values in the data by placing any missing values present at the end of the sorted list of variables.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;So the LARGEST function will return the maximum data value where a &#39;1&#39; is specified in the first argument, the second largest for a &#39;2&#39; and so on. Once all of the non missing data is referenced the missing values will be returned.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;The SMALLEST function will return the lowest value when &#39;1&#39; is specified the second lowest for a &#39;2&#39; and so on. Again once all the non missing values have been referenced the missing values will be returned. The last non missing value in this case will be the highest data value.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;The following example demonstrates how the largest and smallest functions deal with missing data values.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;data balances3;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;set balances;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;large1=largest(1,of bal1-bal6);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;large6=largest(6,of bal1-bal6);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;small1=smallest(1,of bal1-bal6);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;small6=smallest(6,of bal1-bal6);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;drop bal:;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;run;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Generates the following data:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Missing Values with the LARGEST and SMALLEST Functions&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;large1 large6 small1 small6&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;1675.20 602.42 602.42 1675.20&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;1683.42 10.28 10.28 1683.42&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;1996.54 74.68 74.68 1996.54&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;1494.83 . 332.76 .&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 15px;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;1965.40 . 295.78 .&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/7192864970807577909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/08/largest-and-smallest-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/7192864970807577909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/7192864970807577909'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/08/largest-and-smallest-functions.html' title='LARGEST and SMALLEST Functions'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-4943446797976563902</id><published>2013-08-08T00:30:00.003-07:00</published><updated>2013-08-08T02:06:39.952-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SAS FORUM"/><title type='text'>SAS FORUM</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;http://sas-o-log-discussion.2331512.n4.nabble.com/&quot; id=&quot;nabblelink&quot;&gt;SAS &#39;O&#39; LOG - Discussion&lt;/a&gt;
&lt;script src=&quot;http://sas-o-log-discussion.2331512.n4.nabble.com/embed/f1&quot;&gt;&lt;/script&gt;
 

&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/4943446797976563902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/08/sas-forum.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/4943446797976563902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/4943446797976563902'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/08/sas-forum.html' title='SAS FORUM'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-7768812789017797648</id><published>2013-08-07T23:11:00.003-07:00</published><updated>2013-08-07T23:11:58.010-07:00</updated><title type='text'>Password protect your data</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Want to protect your SAS dataset with a password to protect it from other users. You can use the pw = option in the SAS datastep. Here is an example demonstrating the same. This will protect your data with read/write authorization.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; float: center; font-family: sans-serif; font-size: 13px; line-height: 19.1875px;&quot;&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;div class=&quot;source-sas&quot; style=&quot;font-family: monospace; line-height: normal;&quot;&gt;
&lt;pre style=&quot;background-color: #f9f9f9; border: 0px none white; font-family: monospace, &#39;Courier New&#39;; padding: 1em;&quot;&gt;&lt;span class=&quot;kw6&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;DATA&lt;/span&gt; &amp;lt;EXAMPLE DATA&amp;gt; &lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;ENCRYPT = YES PW = &amp;lt;PASSWORD&amp;gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;
&lt;span class=&quot;kw4&quot; style=&quot;color: blue;&quot;&gt;SET&lt;/span&gt; &amp;lt;EXAMPLE DATA&amp;gt;;
&lt;span class=&quot;kw6&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;RUN&lt;/span&gt;;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;If you lose your password, a lot of time and effort is needed to decrypt the file.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/7768812789017797648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/08/password-protect-your-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/7768812789017797648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/7768812789017797648'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/08/password-protect-your-data.html' title='Password protect your data'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3582638560360407599.post-8915300473251583064</id><published>2013-08-07T23:06:00.001-07:00</published><updated>2013-08-07T23:06:13.360-07:00</updated><title type='text'>Extract the first letter of the character variable</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif;&quot;&gt;Have you ever needed to create a variable which is the first letter of the character variable? &amp;nbsp;In the below example there are four ways to do that. X1, X2, X3 and X4 all contain letter P.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #f9f9f9; border: 0px none white; font-family: monospace, &#39;Courier New&#39;; padding: 1em;&quot;&gt;&lt;span class=&quot;kw6&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;data&lt;/span&gt; one;
 name=&lt;span class=&quot;st0&quot; style=&quot;color: #a020f0;&quot;&gt;&#39;Post&#39;&lt;/span&gt;;
 X1 = &lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;substr&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;name,&lt;span class=&quot;nu0&quot; style=&quot;color: seagreen; font-weight: bold;&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;nu0&quot; style=&quot;color: seagreen; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;
 X2 = first&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;name&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;
 &lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;substr&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(X&lt;/span&gt;3,&lt;span class=&quot;nu0&quot; style=&quot;color: seagreen; font-weight: bold;&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;nu0&quot; style=&quot;color: seagreen; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt; = name;
 &lt;span class=&quot;kw3&quot; style=&quot;color: blue;&quot;&gt;length&lt;/span&gt; X4 $&lt;span class=&quot;nu0&quot; style=&quot;color: seagreen; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
 X4 = name; 
&lt;span class=&quot;kw6&quot; style=&quot;color: navy; font-weight: bold;&quot;&gt;run&lt;/span&gt;;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://logsas.blogspot.com/feeds/8915300473251583064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logsas.blogspot.com/2013/08/extract-first-letter-of-character.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/8915300473251583064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3582638560360407599/posts/default/8915300473251583064'/><link rel='alternate' type='text/html' href='http://logsas.blogspot.com/2013/08/extract-first-letter-of-character.html' title='Extract the first letter of the character variable'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/18414559913168376340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>