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 (March 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 18 Mar 2004 18:54:40 -0600
Reply-To:   pudding man <pudding_man@MAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   pudding man <pudding_man@MAIL.COM>
Subject:   Re: Split one big output ASCII file to smaller files
Comments:   To: Daixin Yin <dx35y@YAHOO.COM>
Content-Type:   text/plain; charset="iso-8859-1"

You may want to consider using FILE ... FILEVAR= for this.

For 11 recs distributed 3-recs-to-a-file it could look something like (tested):

data xx; do x = 1 to 11; output; end; run;

%let max_recs = 3;

data _null_; fileno + 1; filespec = 'd:\xx_sas\dum' || put(fileno, z3.); file bedlam filevar = filespec;

do until (ct = &max_recs); set xx; ct = sum(ct, 1); put x; end;

run;

Hope this is helpful ...

Prost, Puddin

******************************************************* ***** Puddin' Man **** Pudding_Man-at-mail.com ******** *******************************************************;

"I'm gonna leave heah' running 'cause walkin'd be Most Too Slow." from "Key To The Highway", Wm. Broonzy, around 1939

----- Original Message ----- From: Daixin Yin <dx35y@YAHOO.COM> Date: Thu, 18 Mar 2004 19:11:06 -0500 To: SAS-L@LISTSERV.UGA.EDU Subject: Split one big output ASCII file to smaller files

I'm generating ASCII files from SAS datasets using DATA _NULL_; FILE ****; PUT ...; The nubmer of observations in each SAS dataset range from 4000+ to 20000+. I want to restrict the number of observations of the output files to no more than 2000, i.e. need to split one big output file to some smaller files. How do I do that efficiently? I'm thinking of SET POINT=, but not familiar with it. Thanks in advance!

-- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm


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