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

sas-innovate-2024.png

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.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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