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.
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
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.
@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.
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 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.