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-2024.png

📢

ANNOUNCEMENT

The early bird rate has been extended! Register by March 18 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

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.

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
  • 4 replies
  • 593 views
  • 0 likes
  • 5 in conversation