BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Gil_
Quartz | Level 8
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
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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

5 REPLIES 5
Doc_Duke
Rhodochrosite | Level 12

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?

ballardw
Super User

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.

 

Gil_
Quartz | Level 8
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 ?
ballardw
Super User

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.

Gil_
Quartz | Level 8
Thanks it work ..

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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