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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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