LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2009, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 27 May 2009 13:44:48 -0700
Reply-To:     "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Subject:      Re: database
Comments: To: Bobs <fabianezte@GMAIL.COM>
In-Reply-To:  A<a03339f8-b000-40c5-a8a3-a689e261e290@y17g2000yqn.googlegroups.com>
Content-Type: text/plain; charset="us-ascii"

Hi Bobs,

You have some SQL versions. Here is some proc versions:

Data animals; Input animals treat $ weight type $ age; cards;

3 NI 33 PN 0 3 NI 216 PD 238 3 NI 299 P12 393 3 NI 362 P18 589 3 NI 416 P24 742 3 NI 416 PVE 758 3 NI 449 PVS 855 3 NI 596 PVS 2175 6 NI 346 PVE 755 6 NI 346 PVE 764 6 NI 346 PVE 790 6 NI 365 PVS 852 6 NI 420 PVP 1079 6 NI 473 PVE 1117 6 NI 430 PVS 1227 6 NI 510 PVD 3035 6 NI 524 PVP 3218 8 NI 27 PN 0 8 NI 174 PD 230 8 NI 240 P12 385 8 NI 277 P18 581 8 NI 323 P24 734 8 NI 461 PVE 2107 8 NI 499 PVS 2167 8 NI 516 PVE 2470 8 NI 516 PVS 2547 8 NI 437 PVP 2799 1 RC 27 PN 0 3 RC 29 PN 0 3 RC 194 PD 221 3 RC 284 P12 392 3 RC 314 PVE 419 3 RC 314 PVE 423 3 RC 572 PVS 2174 4 RC 30 PN 0 4 RC 185 PD 221 4 RC 312 P12 392 4 RC 352 P18 588 4 RC 410 PVS 1229 6 RC 28 PN 0 6 RC 238 PD 235 6 RC 312 P12 389 6 RC 364 P18 585 1 TA 31 PN 0 1 TA 256 PD 253 1 TA 333 P12 365 1 TA 380 PVE 407 1 TA 380 PVE 407 1 TA 380 PVE 407 1 TA 380 PVE 414 1 TA 432 PVS 540 1 TA 432 PVS 540 1 TA 432 PVS 540 1 TA 453 P18 603 1 TA 462 P24 703 1 TA 462 PVP 703 1 TA 462 PVE 768 1 TA 408 PVS 876 1 TA 445 PVD 958 1 TA 516 PVE 1134 1 TA 516 PVP 1135 1 TA 482 PVS 1244 1 TA 510 PVD 1360 1 TA 614 PVP 1495 5 TA 29 PN 0 5 TA 231 PD 248 5 TA 294 P12 360 5 TA 351 PVE 530 5 TA 351 PVE 531 5 TA 360 PVS 535 ; run;

title 'Number of Treatments Per Animal'; proc freq data=animals; table animals*treat / list missing; run;

title 'Number of Treatments'; proc freq data=animals; table treat / list missing; run;

title 'Number of Animals Per Treatment'; proc sort data=animals out=temp1 nodupkey; by treat animals; run; proc freq data=temp1; table treat / list missing; run;

Hope this is helpful.

Mark Terjeson Investment Business Intelligence Investment Management & Research Russell Investments 253-439-2367

Russell Global Leaders in Multi-Manager Investing

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Bobs Sent: Wednesday, May 27, 2009 1:30 PM To: SAS-L@LISTSERV.UGA.EDU Subject: database

Hello SAS experts,

I am working with a database in which animals of different treatments are repeated in the same columm several times.. I wonder know how many animals have by treatments. How to do it? Data animals; Input animals treat $ weight type $ age; cards;

3 NI 33 PN 0 3 NI 216 PD 238 3 NI 299 P12 393 3 NI 362 P18 589 3 NI 416 P24 742 3 NI 416 PVE 758 3 NI 449 PVS 855 3 NI 596 PVS 2175 6 NI 346 PVE 755 6 NI 346 PVE 764 6 NI 346 PVE 790 6 NI 365 PVS 852 6 NI 420 PVP 1079 6 NI 473 PVE 1117 6 NI 430 PVS 1227 6 NI 510 PVD 3035 6 NI 524 PVP 3218 8 NI 27 PN 0 8 NI 174 PD 230 8 NI 240 P12 385 8 NI 277 P18 581 8 NI 323 P24 734 8 NI 461 PVE 2107 8 NI 499 PVS 2167 8 NI 516 PVE 2470 8 NI 516 PVS 2547 8 NI 437 PVP 2799 1 RC 27 PN 0 3 RC 29 PN 0 3 RC 194 PD 221 3 RC 284 P12 392 3 RC 314 PVE 419 3 RC 314 PVE 423 3 RC 572 PVS 2174 4 RC 30 PN 0 4 RC 185 PD 221 4 RC 312 P12 392 4 RC 352 P18 588 4 RC 410 PVS 1229 6 RC 28 PN 0 6 RC 238 PD 235 6 RC 312 P12 389 6 RC 364 P18 585 1 TA 31 PN 0 1 TA 256 PD 253 1 TA 333 P12 365 1 TA 380 PVE 407 1 TA 380 PVE 407 1 TA 380 PVE 407 1 TA 380 PVE 414 1 TA 432 PVS 540 1 TA 432 PVS 540 1 TA 432 PVS 540 1 TA 453 P18 603 1 TA 462 P24 703 1 TA 462 PVP 703 1 TA 462 PVE 768 1 TA 408 PVS 876 1 TA 445 PVD 958 1 TA 516 PVE 1134 1 TA 516 PVP 1135 1 TA 482 PVS 1244 1 TA 510 PVD 1360 1 TA 614 PVP 1495 5 TA 29 PN 0 5 TA 231 PD 248 5 TA 294 P12 360 5 TA 351 PVE 530 5 TA 351 PVE 531 5 TA 360 PVS 535 Proc print;run; Thanks in advance


Back to: Top of message | Previous page | Main SAS-L page