Desktop productivity for business analysts and programmers

excel header Date validation

Reply
Frequent Learner
Posts: 1

excel header Date validation

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)

Valued Guide
Posts: 628

Re: excel header Date validation

Posted in reply to parmeshpara

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.

Super User
Posts: 10,557

Re: excel header Date validation

Posted in reply to parmeshpara

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

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 2 replies
  • 75 views
  • 0 likes
  • 3 in conversation