BookmarkSubscribeRSS Feed
abhra07
Calcite | Level 5

I am new to Jump Scripting Language  .  How do I delete rows depending on the value in the column . 

eg . column name

 DAT

DAT6

DAT6

DAT6

DAT8

DAT9

 

So in my column DAT i want to keep only DAT6 and delete the other rows DAT8 and DAT9

 

6 REPLIES 6
Bhushan
Calcite | Level 5

any other supporting variable which can trigger  DAT6 Obsn ? whatever data you have provided based on that i can say only one thing 

 

data want;

set have ;

If _n_=1 ;

run;

thanks

 

Bhushan
Calcite | Level 5

data aa;
input dat $;
datalines;
DAT6
DAT6
DAT6
DAT6
DAT8
DAT7
;
proc sql;
create table want as
select distinct dat from aa
where Dat contains ("6");
quit;

SuryaKiran
Meteorite | Level 14

Use if condition like any other language.

 

DATA want;

SET have;

if DAT ^="DAT6" then DELETE ;

RUN;

Thanks,
Suryakiran
Reeza
Super User

@abhra07 JSL is part of JMP isn't it? Not part of SAS Base? If you're using JMP this is not the correct forum. 

 

If JSL is supported within SAS now, feel free to correct me and disregard this entire message 🙂

abhra07
Calcite | Level 5

Yeah your right , I couldn't find the right forum I guess to ask this question . I'm a new user , excuse my mistake .

 

Reeza
Super User

The JMP forum is here:

https://community.jmp.com/

 

Good Luck 🙂

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 916 views
  • 0 likes
  • 4 in conversation