BookmarkSubscribeRSS Feed
wwwckk
Calcite | Level 5

/* FOLLOWING ARE MY CODES */

 

title "Base salary discrepancy within ranks";

title2 "By Gender";
PROC MEANS DATA=MD_Data  mean;
VAR 'Base Salary'n;
CLASS 'Department Name'n Grade Gender;
output out = PayGap;
RUN;

 

The new dataset 'PayGap' looks different from the PROC MEANS table I generated. Why and how to fix it?

Thank you!

3 REPLIES 3
Reeza
Super User

Because it does 🙂

(Different output options can generate differently styled output).

Use the STACKODS option and ODS OUTPUT statement to get a table that looks like the output though.
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p17h6q7ygvkl1sn13qzf947dundi.htm

 


@wwwckk wrote:

/* FOLLOWING ARE MY CODES */

 

title "Base salary discrepancy within ranks";

title2 "By Gender";
PROC MEANS DATA=MD_Data  mean;
VAR 'Base Salary'n;
CLASS 'Department Name'n Grade Gender;
output out = PayGap;
RUN;

 

The new dataset 'PayGap' looks different from the PROC MEANS table I generated.

Thank you!


 

Tom
Super User Tom
Super User

Because you asked for the DEFAULT output dataset instead of telling the OUTPUT statement what you actually wanted.

 

This should generate a dataset that is much closer.

output out = PayGap  mean=;

Read the documentation on what the OUTPUT statement can do.

 

If you are really desperate you could try using ODS OUTPUT statement to snag a copy of the data that the proc used to generate the printed report.  But since that was structure designed to be PRINTED and not ANALYZED it will usually require a fair amount of work to make it useful.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 336 views
  • 2 likes
  • 3 in conversation