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 23:56:20 +0000
Reply-To:   toby dunn <tobydunn@HOTMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   toby dunn <tobydunn@HOTMAIL.COM>
Subject:   Re: How to create a 120 distincts datasets from a master dataset
Comments:   To: jazzviewer@hotmail.com
In-Reply-To:   <BAY108-F4C344E55DF8D16CFD28DCDE970@phx.gbl>
Content-Type:   text/plain; format=flowed

John paul,

I think you missed Roy's point o fwhy would you want to do this. In general its a bad bad bad way to store your data. The file format you had was better than breaking it up. It allows for use of where statements and by-group processing. Both of which make your coding life and those that come after you a whole lot better.

Toby Dunn

From: John Paul <jazzviewer@HOTMAIL.COM> Reply-To: John Paul <jazzviewer@HOTMAIL.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: Re: How to create a 120 distincts datasets from a master dataset Date: Thu, 22 Sep 2005 18:24:50 -0400 MIME-Version: 1.0 X-Originating-IP: [209.71.240.249] X-Originating-Email: [jazzviewer@hotmail.com] X-Sender: jazzviewer@hotmail.com Received: from mailgw.cc.uga.edu ([128.192.1.101]) by MC8-F37.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 22 Sep 2005 15:24:53 -0700 Received: from listserv.cc.uga.edu (listserv.uga.edu [128.192.1.75])by mailgw.cc.uga.edu (8.12.11/8.12.11) with ESMTP id j8MKpZE6030410;Thu, 22 Sep 2005 18:24:52 -0400 Received: from LISTSERV.UGA.EDU by LISTSERV.UGA.EDU (LISTSERV-TCP/IP release 1.8d) with spool id 7898678 for SAS-L@LISTSERV.UGA.EDU; Thu, 22 Sep 2005 18:24:52 -0400 Received: from hotmail.com (bay108-f4.bay108.hotmail.com [65.54.162.14]) by listserv.cc.uga.edu (8.12.11/8.12.11) with ESMTP id j8MMOpCn013941 for <SAS-L@LISTSERV.UGA.EDU>; Thu, 22 Sep 2005 18:24:51 -0400 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 22 Sep 2005 15:24:50 -0700 Received: from 65.54.162.200 by by108fd.bay108.hotmail.msn.com with HTTP; Thu, 22 Sep 2005 22:24:50 GMT X-Message-Info: GQXpnklFM/cRmqA4IYI+ucBmQWN2YJ0H08t+H6CuS+g= X-OriginalArrivalTime: 22 Sep 2005 22:24:50.0946 (UTC) FILETIME=[72BDBE20:01C5BFC4] Comments: To: pardee.r@ghc.org Return-Path: owner-sas-l@LISTSERV.UGA.EDU

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