DATA Step, Macro, Functions and more

BASE file versus DATA file

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 100
Accepted Solution

BASE file versus DATA file

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.


Accepted Solutions
Solution
‎02-07-2018 02:57 AM
SAS Employee
Posts: 199

Re: BASE file versus DATA file

Posted in reply to EinarRoed

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


All Replies
Occasional Contributor
Posts: 8

Re: BASE file versus DATA file

Posted in reply to EinarRoed

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.

Super User
Posts: 13,283

Re: BASE file versus DATA file


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.

Solution
‎02-07-2018 02:57 AM
SAS Employee
Posts: 199

Re: BASE file versus DATA file

Posted in reply to EinarRoed

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

☑ This topic is solved.

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

Discussion stats
  • 3 replies
  • 185 views
  • 8 likes
  • 4 in conversation