BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
EinarRoed
Pyrite | Level 9

Can someone please define the difference between a BASE file and a DATA file? I surprisingly have a very hard time finding any information on this. Is the DATA file the physical file, whereas the BASE file is the metadata file?

 

In example, an error table fails with these warnings:

WARNING: Variable CustomerId was not found on DATA file.

WARNING: Variable CustomerType was not found on BASE file. The variable will not be added to the BASE file.

1 ACCEPTED SOLUTION

Accepted Solutions
Damo
SAS Employee

Hi @EinarRoed

 

Are you using the DATASETS procedure with the APPEND statement?

 

BASE and DATA are both referencing data sets.

The difference is that BASE is about the one "you want to add observations" to, where DATA references the "SAS data set containing observations that you want to append to the end of the SAS data set specified in the BASE= argument".

You'll find further details about the APPEND statement from http://go.documentation.sas.com/?docsetId=proc&docsetTarget=n19kwc3onglzh2n1l2k4e39edv3x.htm&docsetV...

 

Hope that helps.

 

Cheers,
Damo

View solution in original post

3 REPLIES 3
djfoot
Fluorite | Level 6

Looks like you're doing a PROC APPEND. The base table is the dataset you are appending to while the data dataset contains the records you wish to append to the base dataset.

 

The warning messages you are receiving are advising that your data dataset does not contain the column CustomerID, but it is on the base dataset (so values for these new records in the column CustomerID will be blank). The column CustomerType is not on your base dataset but is on the data dataset so the missing column will not be added. You can override this by adding the FORCE option to the procedure.

ballardw
Super User

@djfoot wrote:

Looks like you're doing a PROC APPEND. The base table is the dataset you are appending to while the data dataset contains the records you wish to append to the base dataset.

 

The warning messages you are receiving are advising that your data dataset does not contain the column CustomerID, but it is on the base dataset (so values for these new records in the column CustomerID will be blank). The column CustomerType is not on your base dataset but is on the data dataset so the missing column will not be added. You can override this by adding the FORCE option to the procedure.


Note that the Force option in this case will not add Customertype to the data, just allow the appending of the matching variables. Also the CustomerID would be missing in the result as well.

Damo
SAS Employee

Hi @EinarRoed

 

Are you using the DATASETS procedure with the APPEND statement?

 

BASE and DATA are both referencing data sets.

The difference is that BASE is about the one "you want to add observations" to, where DATA references the "SAS data set containing observations that you want to append to the end of the SAS data set specified in the BASE= argument".

You'll find further details about the APPEND statement from http://go.documentation.sas.com/?docsetId=proc&docsetTarget=n19kwc3onglzh2n1l2k4e39edv3x.htm&docsetV...

 

Hope that helps.

 

Cheers,
Damo

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
  • 3 replies
  • 3872 views
  • 8 likes
  • 4 in conversation