i dont know what u mean by show it in output?
let's say it very simple: i want to use a value later in a data set..
What do you want the output data set to look like?
@MirLuie wrote:
i dont know what u mean by show it in output?
let's say it very simple: i want to use a value later in a data set..
Hi
As I understand your problem, it is because the input data is not sorted on y and x.
The supplied code gives 2 output records: Y1 X1 and Y2 X2
data have;
input Y$ X$;
datalines;
y1 x1
y2 x2
y1 x3
y1 x4
y1 x5
y2 x6
;
run;
proc sort data=have; by Y X;
run;
data want; set have; by Y;
retain wantx;
if first.y then wantx = x;
if last.y then output;
run;
I would like to see your lag/delete solution to this problem. Please post it and mark your topic solved.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.