08-28-2012 07:35 AM
I have dataset example Test which has huge data present in that, its located in unix server.
I have some new data which need to be appended to the existing dataset (say test has 10 years data , 11th year data is new data) in that case i want to check the dataset filesize and disk free space before archiving the 1 year data. Anytime you open the file i should have only 10 years data.
This has to be done through SAS coding.
I would appreciate if someone help me on this.
Thanks in advance..MVK
08-28-2012 07:56 AM
What about storing data in yearly data sets? That would circumvent such issues. https://communities.sas.com/message/136439#136439
For checking the filesize and especially how much space is left on disk you will need to issue an OS command like DF and then pipe the result into your SAS process for further execution.
If you follow this "yearly datasets" approach then it would be easier: You first archive the oldest year (give you space) then you create the most current year. The one issue with having yearly slices with a view on top is when it comes to the need to create and use indexes. On the other hand if people are only interested in the current year then having a single physical table only containing this current year is kind of unbeatable.
08-28-2012 08:08 AM
Adding to the question , is there a way that to find out the Disk space command included in the code then append the data to the dataset.
Yes its great idea to create datasets splitting them with yearly data.
08-28-2012 08:28 AM
If you really want to automate the disk space check, you can run it through the 'X" command in SAS and then capture and parse the results to use in your branching logic.