BookmarkSubscribeRSS Feed
apolitical
Obsidian | Level 7

I want to read in an Excel table like the following. The table extends to the right with more years and months under the year. The entire window is from August 2012 to September 2017.

 

 Year2012
 Month89101112
ProductNet Sales UnitsNet Sales $Product Margin $Net Sales UnitsNet Sales $Product Margin $Net Sales UnitsNet Sales $Product Margin $Net Sales UnitsNet Sales $Product Margin $Net Sales UnitsNet Sales $Product Margin $

 

I would like to read it into SAS and transform the table into something like this:

 

Product   Year_Month   Net_Sales_Units   Net_Sales$   Product_Margin$

 

This can be done by reading the table into SAS and performing manual manipulations. But is there a quicker way to achieve that? Thanks.

3 REPLIES 3
apolitical
Obsidian | Level 7

Sorry the table got screwed up a bit. It should be 3 columns (Net Sales Units, Net Sales$, Product Margin$) under each month (8,9..12).

Reeza
Super User

I think you need to provide better sample data in this case.

apolitical
Obsidian | Level 7

I figured it out. Sorry for the the lack of clarity in my question. Mod please feel free to delete this post if that's consistent with forum rules. Thank you. 

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!

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
  • 3 replies
  • 669 views
  • 0 likes
  • 2 in conversation