Hi! I'm trying to automate a piece of code that works well. My goal is to list all the students who did an activity, but I need to report this on a list within my current table. So, I use the following code: data students_list;
set WORK.students;
SP='; ';
students=catx(sp, of STUDENT_1-STUDENT_45);
run;
PROC SQL;
Create Table final as
select t1.*, t2.students from activity t1, students_list t2;
Quit; But I don't want to have to indicate the number of students manually, as this has caused me to generate many errors. So I'm trying to do it with the following code, but it's not working. Can someone help me? Attempt using &n_students: PROC SQL noprint;
SELECT count(*)
INTO :n_students
FROM WORK.class_activity;
QUIT;
data students_list;
set WORK.students;
SP='; ';
students=catx(sp, of STUDENT_1-STUDENT_&n_students);
run;
PROC SQL;
Create Table final as
select t1.*, t2.students from activity t1, students_list t2;
Quit;
... View more