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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.