Please paste you code using the appropriate icon.
And show us your expected output.
72
73 Data new;
74 input id ba
75 Cards;
76 101
___
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
77 101
78 101
79 101
80 101 5
81 102
82 102
83 102
84 102 9
85
86 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
87 ODS HTML CLOSE;
88 &GRAPHTERM; ;*';*";*/;RUN;
ERROR: No DATALINES or INFILE statement.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.NEW may be incomplete. When this step was stopped there were 0 observations and 3 variables.
NOTE: Verwendet wurde: DATA statement - (Gesamtverarbeitungszeit):
real time 0.00 seconds
cpu time 0.00 seconds
Taking a guess at what you hope to achieve ...
This program would move in the right direction, by selecting observations with a nonmissing value for BA:
data want;
set new;
where ba > .;
run;
And this program would take it a step further, selecting just the last such observation for each ID:
data want;
set new;
where ba > .;
by id;
if last.id;
run;
If you want to read all observations, update your code as follows
Data new;
input id ba;
infile datalines missover;
datalines;
101
101
101
101
101 5
102
102
102
102 9
;
run;
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 lock in 2025 pricing—just $495!
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.