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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 1182 views
  • 0 likes
  • 5 in conversation