<?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:gd="http://schemas.google.com/g/2005"><id>tag:blogger.com,1999:blog-7958828565254404797.post4473293187692112360..comments</id><updated>2024-12-13T03:11:35.450-08:00</updated><title type='text'>Comments on ListenData: SAS : First. and Last. Variables</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://www.listendata.com/feeds/comments/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html'/><link rel="hub" href="http://pubsubhubbub.appspot.com/"/><link rel='next' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default?start-index=26&amp;max-results=25'/><author><name>Deepanshu Bhalla</name><uri>http://www.blogger.com/profile/09802839558125192674</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXm_iOrXFR9Ls-mjtOci4qd1m1V1TXkkWJINuMy84-Axo5pNS6CG7oKwR7hfHHI3tB1yuz8W_qo9HK2Cw5fHfe_4cL_2DCf_LyoK9LMLicZojbNYgypIP-RXNsw1GsVhk/s100/pic.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>66</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-2929231189031481513</id><published>2024-08-11T20:08:32.676-07:00</published><updated>2024-08-11T20:08:32.676-07:00</updated><title type='text'>proc sort data = readin;&#xa;by id ;&#xa;run;&#xa;&#xa;data unique...</title><content type='html'>proc sort data = readin;&lt;br /&gt;by id ;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;data unique second_observation;&lt;br /&gt;set readin;&lt;br /&gt;by id ;&lt;br /&gt;if first.id = 1 and last.id = 1 then output unique;&lt;br /&gt;if first.id = 0 and last.id = 1 then output second_observation;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;data mergea;&lt;br /&gt;merge unique second_observation;&lt;br /&gt;by id;&lt;br /&gt;run;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/2929231189031481513'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/2929231189031481513'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1723432112676#c2929231189031481513' title=''/><author><name>sahith</name><uri>https://www.blogger.com/profile/10353224462692874711</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1698112552"/><gd:extendedProperty name="blogger.displayTime" value="August 11, 2024 at 8:08 PM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-4579605491686925176</id><published>2024-03-26T03:29:45.166-07:00</published><updated>2024-03-26T03:29:45.166-07:00</updated><title type='text'>data test1;&#xa;set readin;&#xa;by id;&#xa;if last.id=1 ;&#xa;run;...</title><content type='html'>data test1;&lt;br /&gt;set readin;&lt;br /&gt;by id;&lt;br /&gt;if last.id=1 ;&lt;br /&gt;run;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/4579605491686925176'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/4579605491686925176'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1711448985166#c4579605491686925176' title=''/><link rel='related' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/6565883514981599824'/><author><name>Anonymous</name><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/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-6939909"/><gd:extendedProperty name="blogger.displayTime" value="March 26, 2024 at 3:29 AM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-194595384329166617</id><published>2023-08-30T23:09:45.751-07:00</published><updated>2023-08-30T23:09:45.751-07:00</updated><title type='text'>&#xa;Data t;&#xa;Input x$ y;&#xa;cards;&#xa;&#xa;A 5&#xa;B 3&#xa;C 4&#xa;A 6&#xa;B 9&#xa;C...</title><content type='html'>&lt;br /&gt;Data t;&lt;br /&gt;Input x$ y;&lt;br /&gt;cards;&lt;br /&gt;&lt;br /&gt;A 5&lt;br /&gt;B 3&lt;br /&gt;C 4&lt;br /&gt;A 6&lt;br /&gt;B 9&lt;br /&gt;C 3&lt;br /&gt;;&lt;br /&gt;Run;&lt;br /&gt;&lt;br /&gt;proc sort data = t ;&lt;br /&gt;by x;&lt;br /&gt;run;&lt;br /&gt;data final ;&lt;br /&gt;set t;&lt;br /&gt;by x;&lt;br /&gt;if first.x then sum= y ;&lt;br /&gt;else sum +y ;&lt;br /&gt;if last.x;&lt;br /&gt;keep  x sum ;&lt;br /&gt;run;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/194595384329166617'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/194595384329166617'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1693462185751#c194595384329166617' title=''/><link rel='related' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/7461383107835841577'/><author><name>gaurav roxx</name><uri>https://www.blogger.com/profile/03582202425086028736</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1664922755"/><gd:extendedProperty name="blogger.displayTime" value="August 30, 2023 at 11:09 PM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-3395486270461743897</id><published>2023-08-30T22:42:35.162-07:00</published><updated>2023-08-30T22:42:35.162-07:00</updated><title type='text'>proc sort data = temp;&#xa;by EMPID;&#xa;run;&#xa;data outdata...</title><content type='html'>proc sort data = temp;&lt;br /&gt;by EMPID;&lt;br /&gt;run;&lt;br /&gt;data outdata;&lt;br /&gt;set temp;&lt;br /&gt;if first.empid= 1 then query = 1 ;&lt;br /&gt;else query +1 ;&lt;br /&gt;if last.empid ;&lt;br /&gt;run;&lt;br /&gt;data final ;&lt;br /&gt;set outdata ;&lt;br /&gt;where query gt 5 ;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/3395486270461743897'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/3395486270461743897'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1693460555162#c3395486270461743897' title=''/><link rel='related' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/3104507505534708191'/><author><name>gaurav roxx</name><uri>https://www.blogger.com/profile/03582202425086028736</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1664922755"/><gd:extendedProperty name="blogger.displayTime" value="August 30, 2023 at 10:42 PM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-2655472812696683413</id><published>2022-04-19T15:26:11.086-07:00</published><updated>2022-04-19T15:26:11.086-07:00</updated><title type='text'>data avg;&#xa;set score;&#xa;by ID;&#xa;IF first.ID then COUNT...</title><content type='html'>data avg;&lt;br /&gt;set score;&lt;br /&gt;by ID;&lt;br /&gt;IF first.ID then COUNT=1 ELSE COUNT = COUNT+1;&lt;br /&gt;IF first.ID then SUM = MARKS ELSE SUM = SUM+MARKS;&lt;br /&gt;IF LAST.ID then AVG = SUM/COUNT;&lt;br /&gt;RUN;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/2655472812696683413'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/2655472812696683413'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1650407171086#c2655472812696683413' title=''/><link rel='related' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/5059903379782209679'/><author><name>Arsh Rishi</name><uri>https://www.blogger.com/profile/09759438964051246946</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-725401249"/><gd:extendedProperty name="blogger.displayTime" value="April 19, 2022 at 3:26 PM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-6420236452250017708</id><published>2022-04-15T08:37:47.850-07:00</published><updated>2022-04-15T08:37:47.850-07:00</updated><title type='text'>how to create that ID variable with first. and las...</title><content type='html'>how to create that ID variable with first. and last.?</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/6420236452250017708'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/6420236452250017708'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1650037067850#c6420236452250017708' title=''/><author><name>Anonymous</name><uri>https://www.blogger.com/profile/05890784458877749951</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-768025640"/><gd:extendedProperty name="blogger.displayTime" value="April 15, 2022 at 8:37 AM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-8116008055343943827</id><published>2021-12-11T06:24:36.969-08:00</published><updated>2021-12-11T06:24:36.969-08:00</updated><title type='text'>Hello all,&#xa;&#xa;Data ADaM;&#xa;Input visit$ visitnum param...</title><content type='html'>Hello all,&lt;br /&gt;&lt;br /&gt;Data ADaM;&lt;br /&gt;Input visit$ visitnum paramcd$ aval;&lt;br /&gt;cards;&lt;br /&gt;v3 3 Hb 9&lt;br /&gt;v4 4 HR 67&lt;br /&gt;sc1 1 Hb 6&lt;br /&gt;sc2 2 Hb 8&lt;br /&gt;v2 2 HR 78&lt;br /&gt;v3 3 HR 85&lt;br /&gt;sr1 0 HR 70&lt;br /&gt;sr2 1 HR 69&lt;br /&gt;;&lt;br /&gt;run;&lt;br /&gt;proc sort data=ADaM out=ADaM1;&lt;br /&gt;by paramcd visitnum;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;here i need to find the baseline values, baseline is avail first observation+second observation/2 is the baseline  for every paramcd,&lt;br /&gt;&lt;br /&gt;Example: if paramcd Aval  baseline&lt;br /&gt;              HR     10    &lt;br /&gt;              HR     20     15 (10+20/2),&lt;br /&gt;              even i have somany HR paramcds it should be baseline 15 for HR,&lt;br /&gt;              HB     20&lt;br /&gt;              HB     30    25&lt;br /&gt;              even i have somany HB paramcds it should be baseline 25 for HR,&lt;br /&gt;&lt;br /&gt;Please can any one help on it.&lt;br /&gt;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/8116008055343943827'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/8116008055343943827'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1639232676969#c8116008055343943827' title=''/><author><name>Anonymous</name><uri>https://www.blogger.com/profile/05335182215038841822</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-530086693"/><gd:extendedProperty name="blogger.displayTime" value="December 11, 2021 at 6:24 AM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-8233120186749088320</id><published>2021-07-30T13:21:18.858-07:00</published><updated>2021-07-30T13:21:18.858-07:00</updated><title type='text'>data uniques duplicates;&#xa;set readin;&#xa;by id;&#xa;if fir...</title><content type='html'>data uniques duplicates;&lt;br /&gt;set readin;&lt;br /&gt;by id;&lt;br /&gt;if first.id = 1 and last.id=1 then output uniques;&lt;br /&gt;if first.id then n = 1;&lt;br /&gt;else n+1;&lt;br /&gt;if n = 2 then output duplicates;&lt;br /&gt;run;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/8233120186749088320'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/8233120186749088320'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1627676478858#c8233120186749088320' title=''/><author><name>rishiblogs</name><uri>https://www.blogger.com/profile/04550886166385148428</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-941188706"/><gd:extendedProperty name="blogger.displayTime" value="July 30, 2021 at 1:21 PM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-400631443043718787</id><published>2021-05-26T20:06:58.539-07:00</published><updated>2021-05-26T20:06:58.539-07:00</updated><title type='text'>Good one</title><content type='html'>Good one</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/400631443043718787'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/400631443043718787'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1622084818539#c400631443043718787' title=''/><link rel='related' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/4888224641267405806'/><author><name>Anonymous</name><uri>https://www.blogger.com/profile/04855725932378304102</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1523952567"/><gd:extendedProperty name="blogger.displayTime" value="May 26, 2021 at 8:06 PM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-3778560211954321613</id><published>2021-01-21T12:23:48.553-08:00</published><updated>2021-01-21T12:23:48.553-08:00</updated><title type='text'>data temp;&#xa;input id var1 var2;&#xa;cards;&#xa;1 20 30&#xa;1 40...</title><content type='html'>data temp;&lt;br /&gt;input id var1 var2;&lt;br /&gt;cards;&lt;br /&gt;1 20 30&lt;br /&gt;1 40 50&lt;br /&gt;1 30 55&lt;br /&gt;2 22 45&lt;br /&gt;2 37 49&lt;br /&gt;3 79 36&lt;br /&gt;4 36 49&lt;br /&gt;4 68 78&lt;br /&gt;;&lt;br /&gt;run;&lt;br /&gt;proc means data=temp mean ;&lt;br /&gt;class id;&lt;br /&gt;output out=temp1 (where=(_type_&amp;gt;0 and _stat_=&amp;quot;MEAN&amp;quot;)) ;&lt;br /&gt;run;&lt;br /&gt;data temp2;&lt;br /&gt;set temp1(keep= id var1 var2);&lt;br /&gt;run; </content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/3778560211954321613'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/3778560211954321613'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1611260628553#c3778560211954321613' title=''/><link rel='related' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/3253344445918035869'/><author><name>Yogendra Negi</name><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/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-6939909"/><gd:extendedProperty name="blogger.displayTime" value="January 21, 2021 at 12:23 PM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-8916184507899910042</id><published>2021-01-21T11:43:06.555-08:00</published><updated>2021-01-21T11:43:06.555-08:00</updated><title type='text'>proc means data=t sum;&#xa;class x;&#xa;run;</title><content type='html'>proc means data=t sum;&lt;br /&gt;class x;&lt;br /&gt;run;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/8916184507899910042'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/8916184507899910042'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1611258186555#c8916184507899910042' title=''/><link rel='related' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/7461383107835841577'/><author><name>Anonymous</name><uri>https://www.blogger.com/profile/03387847735143906782</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1591322397"/><gd:extendedProperty name="blogger.displayTime" value="January 21, 2021 at 11:43 AM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-7103744420839167600</id><published>2020-10-27T01:13:19.325-07:00</published><updated>2020-10-27T01:13:19.325-07:00</updated><title type='text'>hi,&#xa;&#xa;what if happens if first.id=1 and last.id=0, ...</title><content type='html'>hi,&lt;br /&gt;&lt;br /&gt;what if happens if first.id=1 and last.id=0, so we can write like this way , i say we could also write like this,&lt;br /&gt; &lt;br /&gt;if first.id=0 and last.id=1 or first.id=1 and last.id=0 then status=&amp;#39;SCORE&amp;#39;;&lt;br /&gt;&lt;br /&gt;CODE::&lt;br /&gt;&lt;br /&gt;data T1;&lt;br /&gt;set readin;&lt;br /&gt;by id;&lt;br /&gt;unique=first.id;&lt;br /&gt;duplicate=last.id;&lt;br /&gt;if first.id=0 and last.id=1 or first.id=1 and last.id=0 then status=&amp;#39;SCORE&amp;#39;;&lt;br /&gt;if first.id=1 and last.id=1 then status=&amp;#39;unique&amp;#39;;&lt;br /&gt;run;&lt;br /&gt;proc print data=T1;&lt;br /&gt;run;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/7103744420839167600'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/7103744420839167600'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1603786399325#c7103744420839167600' title=''/><link rel='related' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/1886393328602345822'/><author><name>Anto</name><uri>https://www.blogger.com/profile/10096848276225888261</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1767258933"/><gd:extendedProperty name="blogger.displayTime" value="October 27, 2020 at 1:13 AM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-21636093712551830</id><published>2020-08-23T00:26:57.951-07:00</published><updated>2020-08-23T00:26:57.951-07:00</updated><title type='text'>proc sort data=readin out=r_sorted;&#xa;by id descendi...</title><content type='html'>proc sort data=readin out=r_sorted;&lt;br /&gt;by id descending score;&lt;br /&gt;run;&lt;br /&gt;data unique_sec;&lt;br /&gt;set r_sorted;&lt;br /&gt;by id descending score;&lt;br /&gt;if first.id then n=1;&lt;br /&gt;else n+1;&lt;br /&gt;if first.id and last.id or n=2;&lt;br /&gt;drop n;&lt;br /&gt;run;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/21636093712551830'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/21636093712551830'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1598167617951#c21636093712551830' title=''/><author><name>alok singh</name><uri>https://www.blogger.com/profile/18351835671788632486</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-161216113"/><gd:extendedProperty name="blogger.displayTime" value="August 23, 2020 at 12:26 AM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-4449688246148054063</id><published>2020-08-10T20:30:18.913-07:00</published><updated>2020-08-10T20:30:18.913-07:00</updated><title type='text'>data record;&#xa;input id name $ score;&#xa;cards;&#xa;1 david...</title><content type='html'>data record;&lt;br /&gt;input id name $ score;&lt;br /&gt;cards;&lt;br /&gt;1 david 45&lt;br /&gt;1 david 74&lt;br /&gt;2 sam 45&lt;br /&gt;2 ram 54&lt;br /&gt;3 bane 87&lt;br /&gt;3 mary 92&lt;br /&gt;3 Bane 87&lt;br /&gt;4 Dane 23&lt;br /&gt;5 Jenny 87&lt;br /&gt;5 Ken 87&lt;br /&gt;6 Simran 63&lt;br /&gt;8 Priya 72&lt;br /&gt;;&lt;br /&gt;run;&lt;br /&gt;/*Select unique observations plus second &lt;br /&gt;observation from duplicate observations of&lt;br /&gt;variable ID */&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;proc sort data=record;&lt;br /&gt;by ID;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;data data2 data3;&lt;br /&gt;set record;&lt;br /&gt;by id;&lt;br /&gt;if (first.ID=1 or last.ID=1) then output data2;&lt;br /&gt;else output data3;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/4449688246148054063'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/4449688246148054063'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1597116618913#c4449688246148054063' title=''/><author><name>poonam</name><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/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-6939909"/><gd:extendedProperty name="blogger.displayTime" value="August 10, 2020 at 8:30 PM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-6792751626989476483</id><published>2020-07-22T00:48:19.614-07:00</published><updated>2020-07-22T00:48:19.614-07:00</updated><title type='text'>data akshay;&#xa;input &#xa;id var1 var2;&#xa;cards;&#xa;1 20 30&#xa;1...</title><content type='html'>data akshay;&lt;br /&gt;input &lt;br /&gt;id var1 var2;&lt;br /&gt;cards;&lt;br /&gt;1 20 30&lt;br /&gt;1 40 50&lt;br /&gt;1 30 55&lt;br /&gt;2 22 45&lt;br /&gt;2 37 49&lt;br /&gt;3 79 36&lt;br /&gt;4 36 49&lt;br /&gt;4 68 78&lt;br /&gt;;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;proc sort data=akshay;by id;run;&lt;br /&gt;proc means data=akshay mean;&lt;br /&gt;by id;&lt;br /&gt;var var1 var2;&lt;br /&gt;output out=semifinal &lt;br /&gt; mean(var1)= var1&lt;br /&gt;mean(var2)=var2;                       ;&lt;br /&gt;run;&lt;br /&gt;data final;&lt;br /&gt;set semifinal;&lt;br /&gt;drop _TYPE_ _FREQ_;&lt;br /&gt;run;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/6792751626989476483'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/6792751626989476483'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1595404099614#c6792751626989476483' title=''/><link rel='related' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/3253344445918035869'/><author><name>Akshay</name><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/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-6939909"/><gd:extendedProperty name="blogger.displayTime" value="July 22, 2020 at 12:48 AM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-7529349289412247815</id><published>2020-07-22T00:00:56.430-07:00</published><updated>2020-07-22T00:00:56.430-07:00</updated><title type='text'>data akshay;&#xa;input &#xa;id date:anydtdte10. day$ &amp;amp;...</title><content type='html'>data akshay;&lt;br /&gt;input &lt;br /&gt;id date:anydtdte10. day$ &amp;amp;;&lt;br /&gt;format date:mmddyy8.;&lt;br /&gt;cards;&lt;br /&gt;43 10/09/2018 DAY 1 &lt;br /&gt;43 10/10/2018 DAY 2 &lt;br /&gt;43 10/11/2018 DAY 3 &lt;br /&gt;43 10/12/2018 DAY 4 &lt;br /&gt;43 10/13/2018 DAY 5 &lt;br /&gt;43 10/15/2018 DAY 7 &lt;br /&gt;44 10/9/2018 DAY 1 &lt;br /&gt;44 10/11/2018 DAY 3 &lt;br /&gt;45 10/9/2018 DAY 1 &lt;br /&gt;45 10/10/2018 DAY 2 &lt;br /&gt;45 10/12/2018 DAY 4 &lt;br /&gt;;run;&lt;br /&gt;&lt;br /&gt;proc sort data=akshay;by id;run;&lt;br /&gt;&lt;br /&gt;data final;&lt;br /&gt;set akshay;&lt;br /&gt;by id;&lt;br /&gt;if first.id=1 then serial_no=1;&lt;br /&gt;else serial_no+1;&lt;br /&gt;run;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/7529349289412247815'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/7529349289412247815'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1595401256430#c7529349289412247815' title=''/><link rel='related' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/8929898464874116831'/><author><name>Anonymous</name><uri>https://www.blogger.com/profile/12664079669219732959</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1410066713"/><gd:extendedProperty name="blogger.displayTime" value="July 22, 2020 at 12:00 AM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-7222458972905580168</id><published>2020-07-21T23:32:48.535-07:00</published><updated>2020-07-21T23:32:48.535-07:00</updated><title type='text'>data temp;&#xa;input EMPID Expenses;&#xa;CARDS;&#xa;101 200&#xa;10...</title><content type='html'>data temp;&lt;br /&gt;input EMPID Expenses;&lt;br /&gt;CARDS;&lt;br /&gt;101 200&lt;br /&gt;102 300&lt;br /&gt;103 200&lt;br /&gt;104 500&lt;br /&gt;105 600&lt;br /&gt;101 450&lt;br /&gt;102 600&lt;br /&gt;101 400&lt;br /&gt;101 200&lt;br /&gt;101 700&lt;br /&gt;102 600&lt;br /&gt;101 800&lt;br /&gt;101 500&lt;br /&gt;102 900&lt;br /&gt;101 500&lt;br /&gt;102 600&lt;br /&gt;102 800&lt;br /&gt;102 600&lt;br /&gt;102 900&lt;br /&gt;102 700&lt;br /&gt;102 600&lt;br /&gt;102 600&lt;br /&gt;103 800&lt;br /&gt;;run;&lt;br /&gt;proc sort data=temp out=ani;by EMPID;run;&lt;br /&gt;data akshay;&lt;br /&gt;set ani;&lt;br /&gt;by EMPID;&lt;br /&gt;if first.EMPID=1 then Transactions=1;&lt;br /&gt;else Transactions+1;&lt;br /&gt;if Transactions gt 5;&lt;br /&gt;if last.EMPID;&lt;br /&gt;run;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/7222458972905580168'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/7222458972905580168'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1595399568535#c7222458972905580168' title=''/><link rel='related' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/3104507505534708191'/><author><name>Anonymous</name><uri>https://www.blogger.com/profile/12664079669219732959</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1410066713"/><gd:extendedProperty name="blogger.displayTime" value="July 21, 2020 at 11:32 PM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-2835764553842540088</id><published>2020-05-31T15:12:30.332-07:00</published><updated>2020-05-31T15:12:30.332-07:00</updated><title type='text'>proc sort data =readin out=test;&#xa;by id Score;&#xa;run;...</title><content type='html'>proc sort data =readin out=test;&lt;br /&gt;by id Score;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;data test1 ;&lt;br /&gt;set test;&lt;br /&gt;by id ;&lt;br /&gt;if first.id then N=1;&lt;br /&gt;else N+1;&lt;br /&gt;if first.ID=1 and  last.id=1 or N=2;&lt;br /&gt;drop N;&lt;br /&gt;run;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/2835764553842540088'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/2835764553842540088'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1590963150332#c2835764553842540088' title=''/><link rel='related' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/6565883514981599824'/><author><name>Anonymous</name><uri>https://www.blogger.com/profile/15898040989099682318</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-323575194"/><gd:extendedProperty name="blogger.displayTime" value="May 31, 2020 at 3:12 PM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-6224367433935603120</id><published>2020-05-31T15:11:08.437-07:00</published><updated>2020-05-31T15:11:08.437-07:00</updated><title type='text'>proc sort data =readin out=test;&#xa;by id Score;&#xa;run;...</title><content type='html'>proc sort data =readin out=test;&lt;br /&gt;by id Score;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;data test1 ;&lt;br /&gt;set test;&lt;br /&gt;by id ;&lt;br /&gt;if first.id then N=1;&lt;br /&gt;else N+1;&lt;br /&gt;if first.ID=1 and  last.id=1 or N=2;&lt;br /&gt;drop N;&lt;br /&gt;run;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/6224367433935603120'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/6224367433935603120'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1590963068437#c6224367433935603120' title=''/><author><name>Anonymous</name><uri>https://www.blogger.com/profile/15898040989099682318</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-323575194"/><gd:extendedProperty name="blogger.displayTime" value="May 31, 2020 at 3:11 PM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-932346557692506824</id><published>2020-05-31T14:42:28.972-07:00</published><updated>2020-05-31T14:42:28.972-07:00</updated><title type='text'>proc sort data =temp;&#xa;by EMPID;&#xa;data test;&#xa;set tem...</title><content type='html'>proc sort data =temp;&lt;br /&gt;by EMPID;&lt;br /&gt;data test;&lt;br /&gt;set temp;&lt;br /&gt;by EMPID ;&lt;br /&gt;if first.EMPID=1 then N=1;&lt;br /&gt;else N+1;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;Data Final(Keep=EMPID);&lt;br /&gt;set test;&lt;br /&gt;where N&amp;gt;=5;&lt;br /&gt;run;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/932346557692506824'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/932346557692506824'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1590961348972#c932346557692506824' title=''/><link rel='related' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/3104507505534708191'/><author><name>Anonymous</name><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/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-6939909"/><gd:extendedProperty name="blogger.displayTime" value="May 31, 2020 at 2:42 PM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-4075208759041721779</id><published>2020-03-08T10:27:01.025-07:00</published><updated>2020-03-08T10:27:01.025-07:00</updated><title type='text'>PROC SORT DATA=temp;&#xa;BY EMPID;&#xa;RUN;&#xa;&#xa;DATA TEST;&#xa;SE...</title><content type='html'>PROC SORT DATA=temp;&lt;br /&gt;BY EMPID;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;DATA TEST;&lt;br /&gt;SET TEMP;&lt;br /&gt;BY EMPID;&lt;br /&gt;IF FIRST.EMPID THEN COUNT=0;&lt;br /&gt;COUNT+1;&lt;br /&gt;IF COUNT GT 5;&lt;br /&gt;IF LAST.EMPID;&lt;br /&gt;RUN;&lt;br /&gt;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/4075208759041721779'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/4075208759041721779'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1583688421025#c4075208759041721779' title=''/><link rel='related' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/1559383481750457893'/><author><name>Anonymous</name><uri>https://www.blogger.com/profile/18125156539043507454</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-891630290"/><gd:extendedProperty name="blogger.displayTime" value="March 8, 2020 at 10:27 AM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-1886393328602345822</id><published>2020-03-08T10:19:09.751-07:00</published><updated>2020-03-08T10:19:09.751-07:00</updated><title type='text'>SOLUTION OF 2ND QUERY:&#xa;&#xa;PROC SORT DATA =READIN;&#xa;BY...</title><content type='html'>SOLUTION OF 2ND QUERY:&lt;br /&gt;&lt;br /&gt;PROC SORT DATA =READIN;&lt;br /&gt;BY ID;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;DATA T1;&lt;br /&gt;SET READIN;&lt;br /&gt;BY ID;&lt;br /&gt;IF FIRST.ID = 1 AND LAST.ID =1 THEN STATUS=&amp;#39;UNIQUE&amp;#39;;&lt;br /&gt;IF FIRST.ID =0 AND LAST.ID =1 THEN STATUS= SCORE;&lt;br /&gt;RUN;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/1886393328602345822'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/1886393328602345822'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1583687949751#c1886393328602345822' title=''/><author><name>Anonymous</name><uri>https://www.blogger.com/profile/18125156539043507454</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-891630290"/><gd:extendedProperty name="blogger.displayTime" value="March 8, 2020 at 10:19 AM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-1559383481750457893</id><published>2019-09-10T05:41:10.809-07:00</published><updated>2019-09-10T05:41:10.809-07:00</updated><title type='text'>Hi All, With refer to below dataset, Can anyone pl...</title><content type='html'>Hi All, With refer to below dataset, Can anyone please assist me I want to have all those Empid&amp;#39;s who have done more then 5 Transactions&lt;br /&gt;&lt;br /&gt;data temp;&lt;br /&gt;input EMPID Expenses;&lt;br /&gt;CARDS;&lt;br /&gt;101 200&lt;br /&gt;102 300&lt;br /&gt;103 200&lt;br /&gt;104 500&lt;br /&gt;105 600&lt;br /&gt;101 450&lt;br /&gt;102 600&lt;br /&gt;101 400&lt;br /&gt;101 200&lt;br /&gt;101 700&lt;br /&gt;102 600&lt;br /&gt;101 800&lt;br /&gt;101 500&lt;br /&gt;102 900&lt;br /&gt;101 500&lt;br /&gt;102 600&lt;br /&gt;102 800&lt;br /&gt;102 600&lt;br /&gt;102 900&lt;br /&gt;102 700&lt;br /&gt;102 600&lt;br /&gt;102 600&lt;br /&gt;103 800&lt;br /&gt;;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/1559383481750457893'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/1559383481750457893'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1568119270809#c1559383481750457893' title=''/><author><name>bindu</name><uri>https://www.blogger.com/profile/09389364650117573895</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-268982334"/><gd:extendedProperty name="blogger.displayTime" value="September 10, 2019 at 5:41 AM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-3366606254450877860</id><published>2019-08-03T00:02:37.728-07:00</published><updated>2019-08-03T00:02:37.728-07:00</updated><title type='text'>someone please try to give solution for this query...</title><content type='html'>someone please try to give solution for this query.</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/3366606254450877860'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/3366606254450877860'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1564815757728#c3366606254450877860' title=''/><link rel='related' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/3104507505534708191'/><author><name>Pankaj</name><uri>https://www.blogger.com/profile/10208906845851433227</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-407237909"/><gd:extendedProperty name="blogger.displayTime" value="August 3, 2019 at 12:02 AM"/></entry><entry><id>tag:blogger.com,1999:blog-7958828565254404797.post-7461383107835841577</id><published>2019-06-26T04:37:52.244-07:00</published><updated>2019-06-26T04:37:52.244-07:00</updated><title type='text'>Data t;&#xa;Input x$ y;&#xa;A 5&#xa;B 3&#xa;C 4&#xa;A 6&#xa;B 9&#xa;C 3&#xa;;&#xa;Run;...</title><content type='html'>Data t;&lt;br /&gt;Input x$ y;&lt;br /&gt;A 5&lt;br /&gt;B 3&lt;br /&gt;C 4&lt;br /&gt;A 6&lt;br /&gt;B 9&lt;br /&gt;C 3&lt;br /&gt;;&lt;br /&gt;Run; &lt;br /&gt;&lt;br /&gt;How to get out put&lt;br /&gt;Sum of &lt;br /&gt;A=&lt;br /&gt;B=&lt;br /&gt;C=</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/7461383107835841577'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7958828565254404797/4473293187692112360/comments/default/7461383107835841577'/><link rel='alternate' type='text/html' href='https://www.listendata.com/2016/01/first-and-last-variables.html?showComment=1561549072244#c7461383107835841577' title=''/><author><name>Anonymous</name><uri>https://www.blogger.com/profile/01149765503246866406</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.listendata.com/2016/01/first-and-last-variables.html' ref='tag:blogger.com,1999:blog-7958828565254404797.post-4473293187692112360' source='http://www.blogger.com/feeds/7958828565254404797/posts/default/4473293187692112360' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1101459675"/><gd:extendedProperty name="blogger.displayTime" value="June 26, 2019 at 4:37 AM"/></entry></feed>