BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
tijanagilic
Obsidian | Level 7

Hello, I work in sas eg and I have data of the following format

tijanagilic_0-1710188353169.png

 

I'd like to create a final table, the following layout

tijanagilic_1-1710188408468.png

 

I want columns that contain numeric data to be subcolumns of column MESEC

Can anyone tell me if something like this can be done in the SAS EG and if so, in what way?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
LinusH
Tourmaline | Level 20

If you are suppoed to deliver this to someone else - why not align with them?

And I agree with @SASJedi , your desired output looks more like a report than a data set (which is what it looks like in your project).

You can use PROC MEANS (or correponding task in EG) or PROC REPORT to create such a repot.

Data never sleeps

View solution in original post

3 REPLIES 3
SASJedi
Ammonite | Level 13

It appears that you want to create a report from the data that you have. If this is true, please supply an example input dataset - preferably as a DATA step that creates actual data - something like this:

data have;
   input MSEC:$5. Number1 Number2;
 datalines;
JAN04 1 2
JAN04 3 4
MAR04 5 6
MAR04 7 8
;

And an example of what you have tried so far - like this:

proc print data=have;
   by MSEC;
run;
 
Obs Number1 Number2
1 1 2
2 3 4
 
Obs Number1 Number2
3 5 6
4 7 8

 

This will generally get you the help you need much more quickly.

 

Check out my Jedi SAS Tricks for SAS Users
tijanagilic
Obsidian | Level 7

This is my whole project 

tijanagilic_1-1710228861165.png

I'm not sure if There's anything else I need to deliver.

The end table, is a seemingly that I primarily delivered.

LinusH
Tourmaline | Level 20

If you are suppoed to deliver this to someone else - why not align with them?

And I agree with @SASJedi , your desired output looks more like a report than a data set (which is what it looks like in your project).

You can use PROC MEANS (or correponding task in EG) or PROC REPORT to create such a repot.

Data never sleeps

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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