BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Lamia
Fluorite | Level 6

thank you very much, the code worked perfectly, can you explain me please what is the use of drop c for the original dataset, and retain for the output one?

also why this instuction: put first.id last.id; ?

thank you 

 

vijaylaxmi
Fluorite | Level 6

Using Drop C is the main trick here. What is does is it will drop that column when creating dataset.

Try this

Data ratings1;

set ratings(drop = C);

run;

 

Ratings1 will have all variable apart from C.

 

Retain C. What this statement does it,

1 it will not reinitialize value of C to missing on reading new observation,

2 remember value from previous obsevration.

 

Try reading some sas paper for more on retain statement, it pretty powerful statement.

 

put first.id last.id;

 

well this statement is not needed, I was just trying out something. You can remove this statement and program will work just fine. Main purpose of put is in debugging, it will write/print values in log for reach observation.

 

 

 

 

 

 

 

Lamia
Fluorite | Level 6
thanks alot, it helps alot

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 17 replies
  • 95789 views
  • 6 likes
  • 10 in conversation