BookmarkSubscribeRSS Feed
kingCobra
Obsidian | Level 7

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!

1 REPLY 1
art297
Opal | Level 21

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

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

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 1241 views
  • 0 likes
  • 2 in conversation