BookmarkSubscribeRSS Feed
parmeshpara
Calcite | Level 5

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)

2 REPLIES 2
andreas_lds
Jade | Level 19

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.

Kurt_Bremser
Super User

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).

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1067 views
  • 0 likes
  • 3 in conversation