BookmarkSubscribeRSS Feed
Babloo
Rhodochrosite | Level 12

Appreciate if someone of you guide me to derive the expression with the following condition. I'm using DI Studio 4.21.

 

I want to derive the new variable KNDATL and mapping is to take the policy issue date from POLICY dataset.  If this policy issue date is empty than check if the knkatd (it's a another variable) of current run month <> knkatd of previous month.  If there is difference then take end of month as KNDATL; if no difference, take the same value for KNDATL as previous month. Data for knkatd looks like

1 to 12 (Jan as 1 to Dec as 12)

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Again, please post test data in the form of a datastep and show what you want out at the end.  SAS is a data based programming language, without this it is not possible to fully answer any question, this has been mentioned many times.

LinusH
Tourmaline | Level 20
This is quite advanced logic, and hard to guide for a DI Studio use case. But doesn't seem like a single derived expression to me (and yes, source and sample output data would help).
You probably need a join, perhaps multiple times with the same source table.
Data never sleeps

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 747 views
  • 0 likes
  • 3 in conversation