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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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