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-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!

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.

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