BookmarkSubscribeRSS Feed
cathreid
Calcite | Level 5

So when I try to change one of my variables in a data set (397 observations), it deletes the entire data set. I am not sure what im doing wrong, but I am constantly running into the same problem. I made a copy of the original data set so I would not erase the original. Here is my code:

 

data cat.pat93;
set cat.pat92;
run;

 

data cat.pat93;
set cat.pat93;
fldVL_1_numeric=input(fldVL_1,best5.);
run;

 

Proc contents of cat.pat92

 

proc92.PNG    

 

Proc contents of cat.pat93

 

proc93.PNG

 

4 REPLIES 4
Astounding
Opal | Level 21

This would happen if your DATA step with the INPUT function omitted the SET statement (by mistake).

Reeza
Super User

I suspect the error is in something else not here. Check your log thoroughly for notes or warnings. 

Also, I highly recommend against the coding style used below where you use the same name in the data and set statement. Once you make a mistake in a step it's hard to correct or test with this style, instead make sure the DATA and SET statements refer to unique data sets.

 

 

data cat.pat93;
set cat.pat92;
run;

 

data cat.pat93;
set cat.pat93;
fldVL_1_numeric=input(fldVL_1,best5.);
run;

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 4 replies
  • 548 views
  • 0 likes
  • 5 in conversation