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
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.
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.
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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.