I have 50 excel files which has to be imported and appended. Which i have done using a macro but the challenge is each excel sheet has a report date in the header . Which needs to be validated like for example if i am running the code for july the report date should be july 1 else those excel files should be thrown as exception which has a different report date. (ie. report date should be 1st of every month)
I have no idea how to get the header (you don't mean the first row containing variable names, don't you) can be read with sas. Or do you mean an information in the first row?
Please, don't post excel files, i won't open them.
Define "Header". You can only import data into SAS that is contained in the spreadsheet from cell A1 to [last used cell]. Everything else is out of reach of proc import.
If it is contained in a separate line (apart from the line that defines the columns), you need to do two separate steps: one that fetches the date, and one that fetches the data.
For further help, export the data to a csv file and post that into a {i} window or as an attachment (just enough lines to illustrate your issue).
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.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.