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 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 19 Mar 2008 08:43:41 -0400
Reply-To:     Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject:      Re: keeping variables

Maybe there is a very elegant solution, here is a "quick and dirty one":

data test; set sashelp.class; run;

data a; set test; array x(*) n1-n400; do i=1 to dim(x); x(i)=age*i; end; run;

data vars; set sashelp.vcolumn; length list $500; retain list; where libname="WORK" and memname="A"; if _n_<=100 then do; list=trim(left(list))!!" "!!compress(name); call symput("klist1",list); end; if _n_=100 then list=""; if 101<=_n_<=200 then do; list=trim(left(list))!!" "!!compress(name); call symput("klist2",list); end; if _n_=200 then list=""; if 201<=_n_<=300 then do; list=trim(left(list))!!" "!!compress(name); call symput("klist3",list); end; if _n_=300 then list=""; if 301<=_n_ then do; list=trim(left(list))!!" "!!compress(name); call symput("klist4",list); end; run;

data a(keep=&klist1) b(keep=&klist2) c(keep=&klist3) d(keep=&klist4); set a; run;

Gerhard

On Wed, 19 Mar 2008 05:11:28 -0700, RAVI <ravikumar.anni@GMAIL.COM> wrote:

>hi all > >i have file having 400 variables, need to devide file and save it in >separate fie keeping onlly 100 variables each. if you have any thought >on this plse reply. > >Thanks in advance > >Ravikumar


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