BookmarkSubscribeRSS Feed
deleted_user
Not applicable
input id cwk :$4. wk day x y;
datalines;
1 sc 0 1 11 10
1 wk1 1 1 12 20
1 wk1 1 2 23 34
1 wk10 10 1 13 30
1 wk10 10 2 33 45
1 wk4 4 1 14 40
2 sc 0 1 13 15
2 sc 0 2 23 43
2 wk1 1 1 14 25
2 wk1 1 2 24 35
2 wk10 10 1 15 35
2 wk10 10 2 45 56
2 wk3 3 1 16 45
2 wk3 3 2 36 46
2 wk4 4 1 17 55
;
I have above data and written the following code
proc sort data=test;
by week;
run;
proc report data=test(drop=wk) nowd;
columns cwk day id,(x y);
*define wk/group order=data noprint;
define cwk/group "week";

define day/group "Day";
define id/across "ID";
define x/ "X";
define y/ "Y";
run;
getting output as follows
ID
1 2
week Day X Y X Y
sc 1 11 10 13 15
2 . . 23 43
wk1 1 12 20 14 25
2 23 34 24 35
wk10 1 13 30 15 35
2 33 45 45 56
wk3 1 . . 16 45
2 . . 36 46
wk4 1 14 40 17 55
but not getting the output in asending sequence of the week.
but I want to display wk10 after wk3, wk4. I mean I just want to display week in asending sequence.
1 REPLY 1
deleted_user
Not applicable
It has been resolved, small mistake. Thank you

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 569 views
  • 0 likes
  • 1 in conversation