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
Proc contents of cat.pat93
This would happen if your DATA step with the INPUT function omitted the SET statement (by mistake).
What does the log say?
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;
As can be seen in the output from proc contents, fldVL_1 is already numeric, so the conversion makes no sense.
And POST THE LOG.
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!
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.
Ready to level-up your skills? Choose your own adventure.