f



Re: How to get rid of duplicates without using any group? #3

Tom,

I agree with Howard that you really ought to reconsider your database
design.  However, that said, here is a way to do what I think you want:

data have (drop=last_serial);
  infile cards missover;
  retain last_serial;
  input @1 serial $5.  @11 description $6.;
  if serial eq last_serial then call missing(serial);
  if not(missing(serial)) then last_serial=serial;
  cards;
10001     yes
          no
          may be
10001     he
          she
          them
1002      yes
          no
          may be
1002      he
          she
          them
;

HTH,
Art
----------
On Wed, 11 Jun 2008 19:52:04 -0400, Tom Smith <need_sas_help@YAHOO.COM>
wrote:

>I have a dataset as below:
>
>serial    description
>----------------------
>10001     yes
>          no
>          may be
>10001     he
>          she
>          them
>1002      yes
>          no
>          may be
>1002      he
>          she
>          them
>
>How can I get rid of additions duplicate values  for the same serial?
>I need only one serial number ( can not do grouping it messes uo the
order)
>as below
>
>serial    description
>----------------------
>10001     yes
>          no
>          may be
>          he
>          she
>          them
>1002      yes
>          no
>          may be
>          he
>          she
>          them
>
>Thanks a lot.
0
art297 (4213)
6/12/2008 6:55:29 AM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
294 Views

Similar Articles

[PageSpeed] 13

Reply:

Similar Artilces:

Re: How to get rid of duplicates without using any group?
On Wed, 11 Jun 2008 19:52:04 -0400, Tom Smith <need_sas_help@YAHOO.COM> wrote: >I have a dataset as below: > >serial description >---------------------- >10001 yes > no > may be >10001 he > she > them >1002 yes > no > may be >1002 he > she > them > >How can I get rid of additions duplicate values for the same serial? >I need only one serial number ( can not do grouping it messes uo the order) >as below > >serial description >---------------------- >10001 yes > no > may be > he > she > them >1002 yes > no > may be > he > she > them > >Thanks a lot. Try to maintain a distinction between the design of your data set and the designs of reports you need to produce. You need a value of SERIAL in each and every observation. If order is important for the DESCRIPTION values, and alphabetical order is not right, you need to explicitly specify that order in a separate variable. Here is your data set design: data need; input serial $ desc_order description $6.; cards; 10001 1 yes 10001 2 no 10001 3 may be 10001 4 he 10001 5 she 10001 6 them 1002 1 yes 1002 2 no 1002 3 may be 1002 4 he 1002 5 she ...

Re: How to get rid of duplicates without using any group? #2
Thank you Howard. Unfortunately Proc print is not going to work for me. Either I have to create a dataset like the output or have to use proc report. Because whatever you see as the sample output will be a part of large proc report output. ...

How to get rid of duplicates without using any group?
I have a dataset as below: serial description ---------------------- 10001 yes no may be 10001 he she them 1002 yes no may be 1002 he she them How can I get rid of additions duplicate values for the same serial? I need only one serial number ( can not do grouping it messes uo the order) as below serial description ---------------------- 10001 yes no may be he she them 1002 yes no may be he she them Thanks a lot. On 12 Jun, 00:52, need_sas_h...@YAHOO.COM (Tom Smith) wrote: > I have a dataset as below: > > serial =A0 =A0description > ---------------------- > 10001 =A0 =A0 yes > =A0 =A0 =A0 =A0 =A0 no > =A0 =A0 =A0 =A0 =A0 may be > 10001 =A0 =A0 he > =A0 =A0 =A0 =A0 =A0 she > =A0 =A0 =A0 =A0 =A0 them > 1002 =A0 =A0 =A0yes > =A0 =A0 =A0 =A0 =A0 no > =A0 =A0 =A0 =A0 =A0 may be > 1002 =A0 =A0 =A0he > =A0 =A0 =A0 =A0 =A0 she > =A0 =A0 =A0 =A0 =A0 them > > How can I get rid of additions duplicate values =A0for the same serial? > I need only one serial number ( can not do grouping it messes uo the order= ) > as below > > serial =A0 =A0description > ---------------------- > 10001 =A0 =A0 yes > =A0 =A0 =A0 =A0 =A0 no > =A0 =A0 =A0 =A0 =A0 may be > =A0 =A0 =A0 =A0 =A0 he > =A0 =A0 =A0 =A0 =...

Re: generating consecutive integers for each group using SAS #3
Yes, you can generate consecutive integers using the undocumented function MONOTONIC, or using the RESOLVE function with a macro. ===== %macro increment_counter(varname); %global &VARNAME.; %let &VARNAME = %eval(&&&VARNAME. + 1); &&&VARNAME. %mend increment_counter; proc sql; create table classplus as select monotonic() as seq1, input(resolve('%INCREMENT_COUNTER(classplusvar)'), best.) as seq2, * from sashelp.class ; quit; ===== The monotonic function will, in general, start over at 1 in each query; the RESOLVE approach will remember the last value from its previous execution unless you reset it. On Tue, 2 Sep 2008 09:48:15 -0700, "Akshaya" <akshaya.nathilvar@GMAIL.COM> said: > I'm wondering, is this doable using Proc SQL or any other procedures, > except datastep? > > Thanks! > Akshaya -- Jack Hamilton Sacramento, California jfh@alumni.stanford.org <== Use this, not jfh@stanfordalumni.org ...

Re: Get meta data of XPT file without converting to SAS dataset #3
Thanks Sig, I was aware of this. But this means that I have to get the list of file names from the folder (probably with pipe), then loop through the list to 'unpack' the files individually. I think the key here is that for XPORT optioned libname, it has to be followed by a file name, NOT a folder name. Ya -----Original Message----- From: Sigurd Hermansen [mailto:HERMANS1@WESTAT.com] Sent: Thursday, October 15, 2009 11:42 AM To: Huang, Ya; SAS-L@LISTSERV.UGA.EDU Subject: RE: Get meta data of XPT file without converting to SAS dataset first? Ya: I haven't work with XPORT engine...

Re: Get data in Using Input: Log has SAS went to a new line when #3
Thanks. ...

Re: How to use SAS to determine patient group and control group?
Hi Tony, Do the patients in each of your 24 groups already have comparable size, age, gender, etc.? If not then you should develop an algorithm to match patients as good as possible (within limits). But do you really need matched (paired) patients? Can't you do with just two random (unpaired) groups that match on the average? Tell us about your design. Regards - Jim. -- Jim Groeneveld, Netherlands statistician, SAS consultant home.hccnet.nl/jim.groeneveld On Thu, 28 Sep 2006 11:14:00 -0700, Tonywang <tonywolf@YAHOO.COM> wrote: >Hi Guys, > >I have 24 groups of patients ...

Re: Difference Between PC SAS and UNIX SAS but getting off topic #3
Mary I was at NCSU and left in 1973. One of the young stat profs, Ron Gallant, if memory serves, came up with the Ames story. And I, too, do not recall the days of punched cards at all fondly. 1) you had to wait for a job to be read in. 2) cards became damaged on the edges from wear and had to be replaced regularly 3) you could drop the deck and scramble it. There were ways around this but they were imperfect 4) I had one experience with a new card reader which, upon encountering a damaged card, made you think that it was a different card that was the problem and one or more of your cards from that was read through the reader was/were never seen by the system. 5) try inserting new characters between columns on a punch card. There are more of these but I would rather not remember them. Nat vironmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977 Mary <mlhoward@AVALON. NET> To Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU Discussion" cc <SAS-L@LISTSERV.U GA.EDU> Subject Re: Difference Between PC SAS and UNIX SAS but getting off topic 06/...

Re: How to find out duplicates by using sql (Not using proc sort #3
On Tue, 1 Jul 2008 09:03:21 -0400, Steven Raimi <sraimi@MARKETINGASSOCIATES.COM> wrote: >On Tue, 1 Jul 2008 05:36:20 -0700, ravikumarpsas@GMAIL.COM wrote: > >>Hi, >> >>I am Ravi kumar. >>I have a simple question. >>data a; >>input x; >>cards; >>2 >>6 >>2 >>9 >>6 >>; >>run; >>For the above question,How to findout the duplicates by using sql. >>output: >>2 >>6 >>Please help me on the same >>Many Thanks >>Ravi > >proc sql; > select x > from a > group by x > having count('x') > 1; >quit; This ought to work, but it suggests, or may create, a misconception. The literal 'x' has nothing to do with column X. One could get rid of the quotation marks (so that the reference *is* to the column and the code should still work (assuming no nulls in column X). However, using COUNT(*) is more straightforward. ...

Re: How to get the location of SAS code in the same SAS code thru #3 685847
> From: Alok > I am facing a problem in which I need to get the > location/path of a SAS code in a macro variable. I need to > use the macro variable in the same SAS code. Is there any SAS > option available which can do this for me? Or is there a code > snippet which can achieve the same purpose? - - - MyMacro.sas - - - %macro MyMacro(path=); %*...; %Mend; - - - MyProgram.sas - - - %Let Path2MyMacro = c:\temp\MyMacro.sas; %Include "&Path2MyMacro."; %MyMacro(path = &Path2MyMacro.); Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov ...

Re: Reading & Writing SAS data sets without SAS #3
Chang, You're correct in that a number of companies have done it. I believe SPSS can do it, WPS, Stat Transfer, dbmscopy, and perhaps others have also done it. But what I think is unique about this is that Alan is talking about offering plug-ins so you can roll-your-own so to speak. How cool would it be to have some type of driver/plugin for R? Phil Philip Rack MineQuest, LLC SAS & WPS Consulting and WPS Reseller Tel: (614) 457-3714 Web: www.MineQuest.com Blog: www.MineQuest.com/WordPress -----Original Message----- From: Chang Chung [mailto:chang_y_chung@HOTMAIL.COM] Sent: Monday...

Re: Exit SAS gracefully / Condtional execution of code without SAS macro #3
> From: Jack Hamilton > I recall hearing an explanation of why %IF can't be made to > work in open code, for my macro kludge ifthenelse check our most excellent archives: http://www.listserv.uga.edu/archives/sas-l.html search for: ifthenelse substring search: [X] subject contains: author's address: RJF2 since: Jul 2004 until: Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov FAQ: How to use SAS-L http://www2.sas.com/proceedings/sugi29/247-29.pdf ...

Re: Emailing SAS Graphs using the pull down option -- SAS 9.1 #3
My knowledge of the American vernacular is limited, and I can't make the connection I'm afraid. The closest I come is something of similar ilk that refers to the value of anatomical portions of the female bovine on the male version. Depending on the verbiage chosen it too is probably offensive to some <grin> I've been tackling efficiency issues in my email server this weekend, and analysing the time between HELO and QUIT (the Alpha and Omega of an email...) and am finding an increase in a trend I wrote about two years ago for a SUGI paper. So swamped are some of the valida...

Re: Re: Re: Re: Getting the number of rows returned by a select with group by.
Let the world know your discovery... Chucho! -----Original Message----- From: rkusenet <rkusenet@gmail.com> To: Jean Sagi <jeansagi@myrealbox.com> Date: Thu, 23 Sep 2004 15:58:11 -0400 Subject: Re: Re: Re: Getting the number of rows returned by a select with group by. Yes I believe there should be no problem if derived tables (TABLE(MULTISET)) is used since technically we are not creating/dropping an object inside a SP. I was forced to find other workarounds for the SP problem by using real tables as global temp tables with SESSIONID column to link it to the session. Much less elegant than this. However I am not sure how good the performance of derived tables. I will try to do a bench mark. On Thu, 23 Sep 2004 14:45:25 -0500, Jean Sagi <jeansagi@myrealbox.com> wrote: > > Besides... > > Let say you call stored procedure for every row in a query, _and_ inside the stored procedure you create and drop a temporary table... > > I had a lot of problems doing this, unitl someone give a solution to this by using exceptions... > > I think no problem exist by using _derived tables_ > . > > Chucho! > > -----Original Message----- > From: "rkusenet" <rkusenet@gmail.com> > .. The problem comes in stored procedures where creation/destruction of a temp table inside the SP forces the engine to recompile, which in turn puts a lock on sysprocplan... > > ...

Re: How to use sftp in SAS #3
Paulo Rodirgo, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Thanks for your reply. I am usin= g unix. i dont know which version ssh is..how can i find that version?. the= n tell me how to generate public key. =C2=A0 Thanks 'n' Regards=20 alex .S. --- On Thu, 20/11/08, Paulo Rodrigo <rodrigo.paulo.sp@GMAIL.COM> wrote: From: Paulo Rodrigo <rodrigo.paulo.sp@GMAIL.COM> Subject: Re: How to use sftp in SAS To: SAS-L@LISTSERV.UGA.EDU Date: Thursday, 20 November, 2008, 6:01 PM Alex, You're using which operation system (Windows, Unix) and ssh version (Openssh ?) are you using ? Normally to work with sftp (secure ftp) on batc= h you must generate a public key to avoid type password. --=20 Att: Paulo R. Herculano Consultor SAS +55-11-9226 6618 Sk=C3=A5l Thunar!! On Thu, Nov 20, 2008 at 9:40 AM, Alex S <alex4sas@yahoo.co.in> wrote: > Hello, > Now i am using SFTP protocal to get the files from differnt servers. The > command i am using is "sftp userid@servername" then it will ask for > password once i provided then i will download that file using get > "filename". > Now I want to code it in SAS. instead of doing it manuall i want the sas > code to do it. I am using the below code: > Data _null_; > rc =3D system('sftp 123456@3.111.222.333'); /* userid@servername*/ > x=3Dsleep(3); > put 'secret@$' ; /*password*/ > Run; > > The problem is.. the code is tring to co...

Re: Use of a sas array #3
An array solution to your problem as presented will be both longer and more difficult to understand than the simple addition statement you show below. What is your actual problem? Do you have 10,000 pairs of variables, not just 3? On Wed, 11 Feb 2009 10:28:47 +0000, "kende jan" <kendejan@YAHOO.FR> said: > Hi, > > I Want to use a SAS array to compute a sum of variables. > > i have two sas data: > > array T1(3) x1 x2 x3 > array T2(3) n1 n2 n3 > > array T1 > > x1 x2 x3 > 14 6 0 > 10 7 3 > 11 5 4 > 15 2 3 > 14 3 3 > > and array T2 > > n1 n2 n3 > 3 2 0 > 3 2 1 > 4 2 2 > 3 1 1 > 1 1 1 > > with this two arrays how can i do, to compute this sum of by array > syntax: > TOT=n1*x1+n2*x2+n3*x3 > > Many thanks for your help > Jan > > > __________________________________________________________________________________________________ > Ne pleurez pas si votre Webmail ferme ! R�cup�rez votre historique sur > Yahoo! Mail ! http://fr.docs.yahoo.com/mail/transfert_mails.html -- Jack Hamilton Sacramento, California jfh@alumni.stanford.org <== Use this, not jfh @ stanfordalumni.org ...

Re: How to do this without using Arrays #3
Wow Richard , Thank a ton . Yeup that is what I am looking for thanks On 4/26/07, Richard A. DeVenezia <rdevenezia@wildblue.net> wrote: > > SAS_learner wrote: > > hello guys, > ... > > if all the condtions are met reason = 1, 2, 3 , 4 , 5. If one of > > them is missing they I need the result to be (for ex 3 and 4 is > > missing ) it should be reason = 1,2,5 ; For this I have solution > > using arrays l something ike this > ... > > You can use a combination of CATX and IFC. > > Example: > > data _null_; > x = 4; > y =...

Re: Optimization using SAS #3
Thank you all for the suggestions, here is my detailed information of the problem. >id var1 var2 var3 dep >3 6 2 30 300 >1 5 1 15 400 >4 10 2 25 400 >2 4 1 20 500 >5 15 2 50 600 >6 20 2 60 700 >7 30 3 70 800 >8 40 3 100 900 >9 35 3 120 1000 >10 50 3 130 1220 > >dv=a*var1+b*var2+c*var3; This not my entire data. My data is around 30000. I have constraints as 0<a,b,c<1 and a+b+c=1. and b > (a+c). My objective is to get the dv that is highly correlated to dep. I tried NLIN, but with only 10000 observation , i thought it ran infinitely !!! (more than 24 hours, so had to stop the process). Can any one help me on how to do this in SAS. Since i believe excel Solver is not all that reliable. It is quite urgent. Thank you once again!!! Hema ...

Re: Use of weights in SAS #3
If it was the paper on permutation tests of linear models then it was the very productive team of Jeff Kromrey and Kristine Hogarty. They have had joint papers in the conferences for a number of years. Jeff has two papers in this year's conference, although I can't find Kristine listed. There is a fair chance you'll find him in the Poster area of the demo room between 2pm and 3:30 on April 17th. Kind regards David The Moving Finger writes; and, having writ, Moves on: nor all your Piety nor Wit Shall lure it back to cancel half a Line, Nor all your Tears wash out a Word of it...

Re: SAS duplicating records #3
Why do you need to make records. You have COUNT and SAS has the FREQ statement or WEIGHT in PROC FREQ. You should be fine without makeing the extra records. On 3/30/09, Zish <zishanpurple@gmail.com> wrote: > Help me in creating the data set Sapmle2 from the data set sample1 as > shown below. > > Sample1::::::: > card_no count > 12567 2 > 23478 3 > 43789 1 > 11986 4 > > Sample2::::::: > > card_no count > 12567 2 > 12567 2 > 23478 3 > 23478 3 > 23478 3 > 43789 1 > 11986 4 > 11986 4 > 11986 4 > 11986 4 > > Please provide a general solution as the number of records will be > very high in original data set. > ...

Re: RE : Re: copulas and SAS #3 674067
joewhitehurst@GMAIL.COM replied: > >Adel, > >You may find the following artilce interesting. [article by Thomas Mikosch not copied] This is a really good article, and a really useful point to make. But 55K is a lot of article to copy. Would it have been easier to point to a URL? The people who read SAS-L as a digest and the people who have slow connections are probably not overly thrilled. I'll refrain from pointing out that you sound like me today. ("Are you sure you want to do this? Here's some material which suggests you should try a different approach..."...

Re: SAS Sample 1728 Was ---> Re: SAS Sample 1727 #3
First, let me admit/acknowledge that I have no knowledge of the history of this thread. Been tied up catching up post SAS Global Forum and post the announcement of sasCommunity.org. But I would like to offer some thoughts regarding Toby's comment: > No as for the sascommunity.org, do we really want a macro library. Well I > would say yes and no. I would like to have one and there are those who > have > paced some Macros on there already. I believe Don and Ron both have, > actually they were on there before the Wiki went public. However, since > people tend to get Ma...

Re: using the IN operator in SAS SQL #3
Rune, I think you meant to type: proc sql; title "Records where 'saksnr' not is fount in DOK"; select saksnr from &bibl..sak where SAKSNR not in (select saksnr from &bibl..dok); quit; Kind Regards, Venky On Tue, 30 Sep 2003 12:46:08 -0700, Rune Runnestoe <rune@FASTLANE.NO> wrote: >Hello, >I am executing the following: > >proc sql; > title "Records where 'saksnr' not is fount in DOK"; > select saksnr > from &bibl..sak > whe...

Re: Help using notepad in SAS #3
> -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On > Behalf Of Arthur Tabachneck > Sent: Monday, October 19, 2009 6:40 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: Help using notepad in SAS > > Dan, > > Thanks for looking, but you found what I did. > > The problem in more detail. > > First, I created a file called c:\copy.sas which contained > the following > lines: > > %window GET_LIB > rows=8 > columns=80 > irow=1 > icolumn=2 > color=black > > #2 @3 &#...

Web resources about - Re: How to get rid of duplicates without using any group? #3 - comp.soft-sys.sas

Duplicate bridge - Wikipedia, the free encyclopedia
Duplicate bridge is the most widely used variation of contract bridge in club and tournament play. It is called duplicate because the same bridge ...

Search for duplicate files - Wikipedia, the free encyclopedia
Language: English Home Random Search for duplicate files Search for duplicate files based on hash values. 900 × 600 pixel File size: 377 B MIME ...

How to Duplicate Facebook’s Hacktober
... build and maintain a security-aware culture. Director of security operations Jennifer Henley shared tips for other companies looking to duplicate ...

Facebook adds new duplicate page finder tool for admins to report unofficial pages
Some Facebook page owners are seeing a new “Report Duplicates” module that allows them to search for pages related to their own and report those ...

faroo_p2p: FAROO Search now with robust Near Duplicate Detection. Filters scraped or syndicated content ...
faroo_p2p: FAROO Search now with robust Near Duplicate Detection. Filters scraped or syndicated content. http://t.

Smart Merge - Duplicate Contacts Cleanup for AddressBook Gmail Facebook & Google contacts on the App ...
Read reviews, compare customer ratings, see screenshots, and learn more about Smart Merge - Duplicate Contacts Cleanup for AddressBook Gmail ...

Liberals to duplicate Cotter Road in $25 million plan
Duplication would close a &quot;missing link&quot; through a new 1.7 kilometre upgrade.

How-To: Safely shrink your Mac’s giant photo library, deleting duplicate images to save space
... Apple’s new Photos app , you might be surprised to learn that you’ve lost a lot of hard drive space, and that there are suddenly tons of duplicate ...

How to Fix Duplicate Content and Improve Your SEO
How to Fix Duplicate Content and Improve Your SEO Business 2 Community In 2013, Matt Cutts stated that 25% of the web was duplicate content, ...


Resources last updated: 3/17/2016 1:27:22 AM