- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
In my sample test dataset, is there a way to get counts in Order_Test variable and assign descending date in the date variable?
Proc report data=Test;
column Health_Department epi_message_sender eor_spec_id Order_Test Updated_Date;
define Health_Department / group ;
define epi_message_sender / group ;
define eor_spec_id / group ;
define Order_Test / group ;
define Updated_Date / group ;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Tested code requires example data.
Which do you want the value of Order_test to serve as a group, the count of Order_test (which would be a poor group value) or both?
If you want both here is an example using an alias with a data set you should have so you can test the code.
proc report data=class; columns sex age age=agen ; define sex /group; define age /group; define agen/ n 'Age count'; run;
A specific order of values, such as descending date value, if Updated_date is indeed a date value (Guessing here as no example data provided), often requires sorting data and using the Define option Order=data to display them in the order they appear in the data set for group, order or across variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@ybz12003 wrote:
My Order_Test variable is a character, not numeric.
Ok. So? What does that mean in terms of what type of report you want?
Your original post did not really explain what you wanted. You might be able to make it clearer by sharing some example data and what report you want from that data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can use the DESCENDING option in the DEFINE statement.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
proc report data=sashelp.heart(obs=1000) nowd; column status sex bp_status n ageatstart; define status/group; define sex/group; define bp_status/group; define ageatstart/group descending; run;