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 (December 2002, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sat, 7 Dec 2002 03:20:25 +0000
Reply-To:     sashole@bellsouth.net
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Paul Dorfman <paul_dorfman@HOTMAIL.COM>
Subject:      Re: data set compression en masse
Comments: To: dickinsn@URREA.ORG
Content-Type: text/plain; format=flowed

David,

I am not sure what sort of simplicity you are looking for in the COPY or DATASETS procs. Both will copy each data set in the library as is, preserving indices and what have you, regardless of whether the copies are compressed or not. For instance, the following copies the data sets WORK.A, WORK.AB, and WORK.ABC having simple and composite, single and multiple indices defined on their columns, to like-named data sets in the permanent library SQUEEZED (irrelevant notes killed):

138 option compress = no ; 139 libname squeezed "H:\" ; NOTE: Libref SQUEEZED was successfully assigned as follows: Engine: V9 Physical Name: H:\

140 data a (index= (a=(a) )) 141 ab (index= (a=(a) ab=(a b) )) 142 abc (index= (a=(a) ab=(a b) abc=(a b c))) 143 ; 144 do a = 1 to 1e2 ; 145 output a ; 146 do b = 1 to 1e2 ; 147 output ab ; 148 do c = 1 to 1e2 ; 149 output abc ; 150 end ; 151 end ; 152 end ; 153 run ;

NOTE: The data set WORK.A has 100 observations and 3 variables. NOTE: Simple index a has been defined. NOTE: The data set WORK.AB has 10000 observations and 3 variables. NOTE: Composite index ab has been defined. NOTE: Simple index a has been defined. NOTE: The data set WORK.ABC has 1000000 observations and 3 variables. NOTE: Composite index abc has been defined. NOTE: Composite index ab has been defined. NOTE: Simple index a has been defined. NOTE: DATA statement used (Total process time): real time 7.43 seconds cpu time 7.39 seconds

154 option compress = yes nocenter nodate nonumber ; 155 proc copy in = work out = squeezed ; 156 run ;

NOTE: Copying WORK.A to SQUEEZED.A (memtype=DATA). INFO: Engine's block-read method is in use. INFO: Engine's block-write method is in use. NOTE: Simple index a has been defined. NOTE: There were 100 observations read from the data set WORK.A. NOTE: The data set SQUEEZED.A has 100 observations and 3 variables. NOTE: Copying WORK.AB to SQUEEZED.AB (memtype=DATA). INFO: Engine's block-read method is in use. INFO: Engine's block-write method is in use. NOTE: Simple index a has been defined. NOTE: Composite index ab has been defined. NOTE: There were 10000 observations read from the data set WORK.AB. NOTE: The data set SQUEEZED.AB has 10000 observations and 3 variables. NOTE: Copying WORK.ABC to SQUEEZED.ABC (memtype=DATA). INFO: Engine's block-read method is in use. INFO: Engine's block-write method is in use. NOTE: Simple index a has been defined. NOTE: Composite index ab has been defined. NOTE: Composite index abc has been defined. NOTE: There were 1000000 observations read from the data set WORK.ABC. NOTE: The data set SQUEEZED.ABC has 1000000 observations and 3 variables. NOTE: PROCEDURE COPY used (Total process time): real time 7.92 seconds cpu time 7.81 seconds

157 proc contents data = squeezed._all_ ; 158 run ;

The log itself shows that the indices were being recreated (or perhaps rather just copied), which is confirmed by the CONTENTS output (severely groomed below):

Data Set Name SQUEEZED.A Alphabetic List of Indexes and Attributes # of Unique # Index Values 1 a 100 ----------------------------------------- Data Set Name SQUEEZED.AB Alphabetic List of Indexes and Attributes # of Unique # Index Values Variables 1 a 100 2 ab 10000 a b ----------------------------------------- Data Set Name SQUEEZED.ABC Alphabetic List of Indexes and Attributes # of Unique # Index Values Variables 1 a 100 2 ab 10000 a b 3 abc 1000000 a b c -----------------------------------------

Kind regards, ---------------- Paul M. Dorfman Jacksonville, FL ----------------

----Original Message Follows---- From: David D <dickinsn@URREA.ORG> Reply-To: David D <dickinsn@URREA.ORG> To: SAS-L@LISTSERV.UGA.EDU Subject: data set compression en masse Date: Fri, 6 Dec 2002 14:49:41 -0800

I would like to move through series of libraries and apply SAS compression to all the datasets in them. Since I didn't see anything simple in proc datasets or proc copy to do this, I began to write a macro that would run through the _all_ contents in each library and apply compression using an automatically generated data step.

This would work fine, it seems, if most of my datasets did not have multiple composite indexes, which I would like to maintain. I'm having a hard time interpreting the contents output; it seems as if I should be able to recreate the indexes based on this information.

Any ideas? Many thanks in advance.

David

_________________________________________________________________ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


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