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
PROC Star

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 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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