BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DavidPhillips2
Rhodochrosite | Level 12

I have a dataset with two "Section 2" rows.  When I run the below it merges the two columns together.  I am trying to sort the rows manually by using a format then display the rows without merging them. 

 

proc sql;
insert into FacultyProfileFall
(colPreOrdering2, colPreOrdering, _c2_, _c3_, _c4_, _c5_, _c6_, _c7_)
values (20, 'Section 2', 0, 0, 0, 0, 0, 0);
quit;

 

title1 'FacultyProfileFall Output';
proc report data=FacultyProfileFall;
column colPreOrdering2 _c2_ _c3_ _c4_ _c5_ _c6_ _c7_;
define _c2_ / format=comma9. '2011-12';
define _c3_ / format=comma9. '2012-13';
define _c4_ / format=comma9. '2013-14';

define _c5_ / format=comma9. '2014-15';
define _c6_ / format=comma9. '2015-16';
define _c7_ / format=comma9. '2016-17';
define colPreOrdering2 / group order = internal left '';
format colPreOrdering2 rankFormatValue.;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:
Take a look here:
http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#p0wy1vqwvz43uhn1g77eb...

At the statement that the ORDER= option on the DEFINE statement ONLY will be used for ORDER, GROUP or ACROSS items. That option will be ignored for DISPLAY items and you should be seeing the sorted order of the rows by default (if all your variables are DISPLAY).

The specific sentence on the doc page for ORDER= says
"ORDER=DATA | FORMATTED | FREQ | INTERNAL
orders the values of a group, order, or across variable according to the specified order..."

cynthia

View solution in original post

3 REPLIES 3
Cynthia_sas
SAS Super FREQ

Hi:
Well, the default behavior of using GROUP for an item on the report row is to collapse or summarize all the numeric variables for that group. So if you do NOT want GROUP as the usage, why not try ORDER as the usage.

Consider the difference in the 2 outputs below. You didn't provide your format, so it is impossible to understand what you are trying to do with the format and I might not have understood what you mean by having 2 section 2 rows, since you did not provide data, but I think the sample code and image shows what the difference is between GROUP and ORDER.
cynthia

 

grp_vs_order.png

DavidPhillips2
Rhodochrosite | Level 12

I was able to sort the data and then order by data.

 

define colPreOrdering2 / display order=data left '';

Cynthia_sas
SAS Super FREQ

Hi:
Take a look here:
http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#p0wy1vqwvz43uhn1g77eb...

At the statement that the ORDER= option on the DEFINE statement ONLY will be used for ORDER, GROUP or ACROSS items. That option will be ignored for DISPLAY items and you should be seeing the sorted order of the rows by default (if all your variables are DISPLAY).

The specific sentence on the doc page for ORDER= says
"ORDER=DATA | FORMATTED | FREQ | INTERNAL
orders the values of a group, order, or across variable according to the specified order..."

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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