proc sql;
create table students (name varchar(12),
address varchar(20),
marks num(3));
quit;
proc sql;
insert into students
values('Anand','Hyderabad',80)
values('Siva','Bangalore',65)
values('aditya','Rjy',65)
values('Krishna','Pune',65)
values('vasu','Vja',65);
quit;
proc sql;
delete from students
where name='Krishna' marks=65;
quit;
Here i want to delete kirshna marks how to delete rows conditionally
If you want to delete the value of a specific column instead of a row, use update.
proc sql;
update students
set marks=null /* set null or . */
where name='Krishna';
quit;
You can delete rows this way.
proc sql;
delete from students
where name='Krishna' and marks=65;
quit;
or
proc sql;
delete from students
where name='Krishna';
quit;
To specify multiple conditions, use And, Or, etc. to connect them.
How delete krishna's marks only
If you want to delete the value of a specific column instead of a row, use update.
proc sql;
update students
set marks=null /* set null or . */
where name='Krishna';
quit;
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.