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 (September 2005, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 22 Sep 2005 18:24:50 -0400
Reply-To:   John Paul <jazzviewer@HOTMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   John Paul <jazzviewer@HOTMAIL.COM>
Subject:   Re: How to create a 120 distincts datasets from a master dataset
Comments:   To: pardee.r@ghc.org
In-Reply-To:   <8AD8F86B3312F24CB432CEDDA71889F21D5D25@ex06.GHCMASTER.GHC.ORG>
Content-Type:   text/plain; format=flowed

You rock my friend,

Thanks a lot everything works perfectely. I wasted my time this morning trying to get hint from SAS Tech support. You gave me the solution in 5 minutes ... You da man buddy!!!.

Many thanks .

This group is wonderfull.

John

>From: "Pardee, Roy" <pardee.r@ghc.org> >To: "John Paul" <jazzviewer@HOTMAIL.COM>, <SAS-L@LISTSERV.UGA.EDU> >Subject: RE: Re: How to create a 120 distincts datasets from a >master dataset >Date: Thu, 22 Sep 2005 14:53:27 -0700 > >Ew. Why would you want to do that? > >;-) > >proc sql ; > create table all_reps as > select distinct rep_name > from master ; > > * For the DATA statement ; > select rep_name into :repnames separated by ' ' > from all_reps ; > > * For the dstep select statement ; > select 'when ("' || rep_name || '") output ' || rep_name > into :case_statements separated by '; ' > from all_reps ; > >quit ; > > >data &repnames ; > set master ; > select (rep_name) ; > &case_statements ; > otherwise ; * should never happen ; > end ; >run ; > >-----Original Message----- >From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of >John Paul >Sent: Thursday, September 22, 2005 2:36 PM >To: SAS-L@LISTSERV.UGA.EDU >Subject: Re: How to create a 120 distincts datasets from a master >dataset >Importance: High > >Hi list, >I have a master sas dataset with 500,000 records (transactions from 120 >Sales Rep). >I would like to create 120 datasets from my mater dataset using a field >called Rep_Name to allocate transactions for every Rep. >In fact below is what I would like to do; > >Let's say I have a dataset called MASTER. >DATA MASTER; >INPUT SALEID REP_NAME $ AMOUNT; >CARDS; >1 A 3000 >2 A 4000 >3 B 5000 >4 A 6000 >5 B 2000 >RUN; >From MASTER,I would like to get 2 datasets as follow: > >REP_A >1 A 3000 >2 A 4000 >4 A 6000 > >REP_A >3 B 5000 >5 B 2000 > >do you know how I can do that.. > >Many thanks . > >John > >_________________________________________________________________ >MSN(r) Calendar keeps you organized and takes the effort out of >scheduling get-togethers. >http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU >=http://hotmail.com/enca&HL=Market_MSNIS_Taglines > Start enjoying all the benefits of MSN(r) Premium right now and get >the first two months FREE*.

_________________________________________________________________ Designer Mail isn't just fun to send, it's fun to receive. Use special stationery, fonts and colors. http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines Start enjoying all the benefits of MSNŽ Premium right now and get the first two months FREE*.


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