DATA Step, Macro, Functions and more

How to import an excel (with unusual data entry) into SAS

Reply
Contributor
Posts: 20

How to import an excel (with unusual data entry) into SAS

Hi,

 

Please see the attached excel file.

 

Need to import this as a sas7bdat. You can clearly see the problem here.I want A1 to A9 (and A27 to A38) as variables in my SAS data alongside the data block in the middle (row 12 to 24). Basically I want to have a meaningful sas dataset out of this sheet.

This is just an example with 2 subjects. I have total 88 subjs spread across 10 different spreadsheets. Is there a way in SAS to import this kind of file?

 

Any help will be greatly appreciated.

 

Thanks!

PROC Star
Posts: 7,366

Re: How to import an excel (with unusual data entry) into SAS

The only way I would know how to accomplish this task would be to create an Excel macro that rearranged the data. I did it for the two sets of data that were included in the example you sent and have attached the resulting file. That file would be easy to import into SAS.

 

Requires quite a bit of manual work as the macro would have to be run for each patient's data, but definitely doable. But, like I said, you would have to be proficient in creating Excel macros that use relative references.

 

Art, CEO, AnalystFinder.com

Ask a Question
Discussion stats
  • 1 reply
  • 93 views
  • 0 likes
  • 2 in conversation