BookmarkSubscribeRSS Feed
Q1983
Lapis Lazuli | Level 10

data step_1300 step_1302;

set my_steps;

if step_cd='1300' then output m_1300; else

if step_cd='1303 then output m_1302;

run;

data m_1300;

set m_1300;

1300_dt=compl_dt;

step1300=step_cd;

format 1300_dt mmddyy10.;

run;

data m_1302;

set m_1302;

1302_dt=compl_dt;

step1302=step_cd;

format 1300_dt mmddyy10.;

run;

data merge;

merge m_1300 m_1302;

by loan_num;

date1=max(1300_dt.1302_dt);

run;

sample output

Loan_Num       date1                    step_cd

00000              6/15/2014               "the max step cd according to the step date"

Here is my question. I can get the max compl_dt as shown here.  I need to be able to also show the max step (step1300 or step1302  and apply this to multiple dates and step cd) I am just using two here as example.  So if step1300 ended up being the max date I want to display in a char column '1300'

1 REPLY 1
Q1983
Lapis Lazuli | Level 10

Cancel the question

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
  • 1 reply
  • 638 views
  • 0 likes
  • 1 in conversation