BookmarkSubscribeRSS Feed
Q1983
Lapis Lazuli | Level 10

data want;

set have;

if step=1 then step1 =completion_dt;

if step=2 then step2=completion_dt;

if step=3 then step3=completion_dt;

run;

proc sql;

create table want1 as

select a.ln_no,

a.address,

a.city,

b.step1,

b.step2,

b.step3

from main  a

inner join  want b

on a.ln=b.ln;

quit;

Here is the issue.  If say step3 has no value then the proc sql statement fails because it is a null value.  How can I address this when the value is null however I still need to join the two datasets

1 REPLY 1
Tom
Super User Tom
Super User

In the code you posted it would not matter if the variable STEP3 had a null value.

Can you post an example with some values?

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

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
  • 909 views
  • 0 likes
  • 2 in conversation