BookmarkSubscribeRSS Feed
BrahmanandaRao
Lapis Lazuli | Level 10

Hi Good Morning,

 

i have two columns  in bank loan application data 

in those columns 

1.Customer_id

2.Year

 

NOTE:-Customer_ID is not  in sequence and year is 2019 only not given mmddyyy format 

so how to get very latest customer id for applying for loan

5 REPLIES 5
novinosrin
Tourmaline | Level 20

Assuming you have a Date variable

 

proc sql;
select *
from have
having date=max(date);
quit;

The max function should give you the latest date

if it is year , just take the last record of the dataset

 

 

BrahmanandaRao
Lapis Lazuli | Level 10

 

HI Novinosrin

 

in that FY' column only 2019 not given date month 

then how we get latest  customer_id and also customer_id is not in sequence 

novinosrin
Tourmaline | Level 20
Hi Can you plz post a sample? of your data and expected output?
SASKiwi
PROC Star

@BrahmanandaRao - If all you have to work with is a customer ID and a year not a proper date with day, month and year then I'd say you can't do it.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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