|
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*.
|