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
SAS Super FREQ

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

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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