|
View previous topic :: View next topic
|
| Author |
Message |
Charles Wolters
New User
Joined: 30 Mar 2011 Posts: 48 Location: United States
|
|
|
|
I have 20 SAS data sets on tape and I need to sort each one. These data sets are for enrollees in certain programs and each enrollee can have multiple events with the date of the event being recorded on the record. I have the processing set up in a SAS macro and the steps can be delineated as shown below. The "sledgehammer" approach is to allocate 20 temporary data sets on tape but I am looking for a more efficient approach with considerably fewer resources.
1. Sort the data set which I will call &macvar.mydata and output the sorted temporary data which I will call tempdata.mydata to tape
2. Set tempdata.mydata in a data set which I will call &macvar.agg by enrollee ID and event date and construct enrollee-level counts on the basis of the certain event variables.
3. Append the data set &macvar.agg to a base data set using Proc Datasets.
4. Now at this point what I would like to do is use Proc Datasets to delete tempdata.mydata but since this data set is on tape SAS will not let me do this.
Has anybody been confronted with this problem?
Charles Wolters |
|
| Back to top |
|
 |
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1056 Location: Richmond, Virginia
|
|
|
|
| Why tapes for temps? |
|
| Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
| Many sites place restrictions on tapes, such as not allowing the tape to be overwritten (which would be required for SAS to delete a temporary work data set on tape). Contact your site support group to make sure or to clarify what you need to do to allow this. |
|
| Back to top |
|
 |
Charles Wolters
New User
Joined: 30 Mar 2011 Posts: 48 Location: United States
|
|
|
|
Robert,
That is a good point. When creating permanent SAS data sets on tape, our tape management system lets one assign a special code to the expiration date which tells the system to keep the data set indefinitely or until the user decides to uncatalog it. When uncataloged my understanding is that you are giving the tape management system the green light to overwrite your data set(s).
It is possible that the tape management system won't let you delete the temporary data sets on tape during the job so I will find this out.
Charles |
|
| Back to top |
|
 |
|
|