How to perm save a data set

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 78
Accepted Solution

How to perm save a data set

I have a
libname test 'h:/report';

It brings 2 days input1 and input2
I need to append a daily file

Proc append base=test.input1
Data=test.input2 force;
Run;
Which works
I do a proc sort Nodup
By date ticket;
Run,

The data appends and removes the dups. The issue is if I run script and it saves 5 days worth of data .the issue if I refer the library next day to pull the 5 days and it's blank data is not stored for future refer

Accepted Solutions
Solution
‎07-03-2017 04:30 PM
Super User
Posts: 11,134

Re: How to perm save a data set

Why can't you post a log? Copy the log from SAS and paste here.

 

Or at least show the entire code.

But if naming is an issue then assigning "good" names is important.

 

Keep the data sets that you need to persist in that TEST library and then create the newer data as temporary input1 dataset in the work library.

Then:

Proc append base=test.input1

                      data= work.input1;

run;  

 

Nothing in the test.input1 should go away without a specific statement by you that references test.input1.

View solution in original post


All Replies
Trusted Advisor
Posts: 2,114

Re: How to perm save a data set

Gil,

 

post your log.  You seem to be mixing Unix and Windows syntax, so I'm not sure what is happening.

 

One, non-SAS, possibility is that a system utility is 'cleaning up' at night and deleting files from that directory.

 

Is "h:/reports" a shared directory?  Could other users be deleting your files?

Super User
Posts: 11,134

Re: How to perm save a data set

Since you do not demonstrate how you are "pulling" the 5 days of data that the "pull" is the issue, not the append. Note that if you append a dataset with no observations you are not going to have anything added.

 

I am going to suspect from your data set names your process may be overwriting data sets.

 

You may also want to explain why you need the "force" option. Many times I see that option it is an indication that a process is not in good control, sometimes over reliance on Proc Import and dealing with multiple definitions of variables because each set is different.

 

Frequent Contributor
Posts: 78

Re: How to perm save a data set

Ballardw I think you might be right on it overwriting ...the lib creates .sas7bdat of input1 and input2 so when I refer the lib test it brings it in than than I import the daily input2 I see now that I have 2 input2 tables ..
I wish I could post log ...the better question to have ask how save a sas7bdat file ?
Solution
‎07-03-2017 04:30 PM
Super User
Posts: 11,134

Re: How to perm save a data set

Why can't you post a log? Copy the log from SAS and paste here.

 

Or at least show the entire code.

But if naming is an issue then assigning "good" names is important.

 

Keep the data sets that you need to persist in that TEST library and then create the newer data as temporary input1 dataset in the work library.

Then:

Proc append base=test.input1

                      data= work.input1;

run;  

 

Nothing in the test.input1 should go away without a specific statement by you that references test.input1.

Frequent Contributor
Posts: 78

Re: How to perm save a data set

Thanks it work ..
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 151 views
  • 0 likes
  • 3 in conversation