Help using Base SAS procedures

Archiving the data

Occasional Contributor
Posts: 12

Archiving the data

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

Respected Advisor
Posts: 3,894

Re: Archiving the data

What about storing data in yearly data sets? That would circumvent such issues.

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.

Occasional Contributor
Posts: 12

Re: Archiving the data

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.

Trusted Advisor
Posts: 2,113

Re: Archiving the data

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.

Ask a Question
Discussion stats
  • 3 replies
  • 3 in conversation