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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 957 views
  • 0 likes
  • 1 in conversation