I am reading an excel file with multiple tabs. I am using SAS 9.4 Following is the approach that I am using. Libname xllib xlsx “path”; All the tabs contain a column Last_date. According to the excel file , if Last_date is blank,it means the record is active else the record is closed. Now the issue is:if all the records are active, then last_date is blank.As a result when I use the above stmt to import, if one sheet has all active records ,it is imported as character. If other sheet of same spreadsheet has dates in Last_date,it is imported as date. Now I am supposed to replace blank with a default date 9000/01/01 . Because I am using libname statement ,it is dynamic,meaning I wouldn’t know what tab will be imported as character or what tab will be imported as date. I needed an opinion here; 1. Should I be writing the logic to handle this situation in a SAS code. 2. Should this situation be handled in the raw data file itself. Like,Last_date should be populated with default date in raw file itself. The pros of the second method is all the tabs will be imported as date, which means ,the SAS code would be simpler and there will be less testing efforts. PS :the raw data file here will be manually edited by some user.
... View more