|Date: ||Sun, 16 Mar 2008 09:33:59 -0500|
|Reply-To: ||"Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||"Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>|
|Subject: ||Re: Appending to multiple files|
|Content-Type: ||text/plain; charset="iso-8859-15"|
"S. K. Agarwal" wrote:
> I have stock market trade data in different files with each files
> giving a list of transactions on a particular date (e.g. file names
> for transaction in 2005 Jan are 20050101, 20050102, ... 20050131)..
> Each file contains 4 variables (stockcode time quantity price).. My
> objective is to extract the data of all trades of 100 companies to
> separate files company-wise. For example, all trades where stock =
> 'Rel' in the month of Jan 2005 should be stored in a file called
> One way to do this is to write 'proc append' (where stock = '')
> command .. but this is very time consuming because it opens each date
> file 100 times when I am working with 100 companies. Each of my
> transaction file is around 200 MB which makes the process very time
> What I am thinking is rather than opening each transaction file 100
> times, is there a procedure to open each transaction file once and
> append the information relating to particular stock in each stock
> files. e.g. Calling file 20050101 once and storing data for REL to
> REL200501, ICICI to ICICI200501.. (and so on for 100 companies)
> then calling file 20050102 and appending data for REL to REL200501,
> ICICI to ICICI200501.
> This I think will save a lot of the processing time.
In a single data step, you can use a hash to split the incoming data into
subtables named by company. The subtables can be appended using call
EXECUTE after all the data has been split.
Some priors posts discuss splitting data with hash object.
Richard A. DeVenezia