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-white.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.

 

Early bird rate extended! Save $200 when you sign up by March 31.

Register now!

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 778 views
  • 2 likes
  • 3 in conversation