- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 03-19-2019 03:44 PM
(905 views)
Hi All,
i have the following data, for every on record i need to create two records with stdy and endy values populated under col1 and values in res must be populated under res1 as follows
any suggestions?
This is what i have
sub stdy endy res
111 1 7 10
111 8 10 20
111 11 13 20
111 15 20 40
222 12 17 70
222 18 30 70
the final output
sub col1 res1
111 1 10
111 7 10
111 8 20
111 10 20
111 11 20
111 13 20
111 15 40
111 20 40
222 12 70
222 17 70
222 18 70
222 30 70
Thanks
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
data want;
set have;
col1=stdy;
output;
col1=endy;
output;
keep sub col1 res;
run;
--
Paige Miller
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
data have;
input sub stdy endy res;
cards;
111 1 7 10
111 8 10 20
111 11 13 20
111 15 20 40
222 12 17 70
222 18 30 70
;
data want;
set have;
do col1=stdy,endy;
output;
end;
drop stdy endy;
run;