BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
sasphd
Lapis Lazuli | Level 10

Hello, 

when I run the program below there is no error in the log but the variable EPU is empty "."


proc sql;
 create table test1 as
 select Distinct R.*, B.EPU
 from test as R
 left join  EPU_Data as B on R.sas_date=B.sas_date
order by R.Secid, R.sas_date;
 quit;
1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Maybe you imported the dates from somewhere where they are not represented quite the same as in SAS (e.g. Excel)? Happened to me once. The date numbers were not integers. Try:

 

left join  EPU_Data as B on round(R.sas_date) = round(B.sas_date)

 

PG

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

This happens because one (or both) of the following is true:

 

  1. Variable EPU is always missing data set B; or
  2. variable SAS_DATE in data set A never matches the values of SAS_DATE in data set B
--
Paige Miller
sasphd
Lapis Lazuli | Level 10
thanks for the response.
I have the same data format for sas_date variable and EPU is not missing there is a number for each data?
PaigeMiller
Diamond | Level 26

@sasphd wrote:
I have the same data format for sas_date variable and EPU is not missing there is a number for each data?

Not the format ... the actual values of SAS_DATE don't match.

--
Paige Miller
Kurt_Bremser
Super User

Run this:

data test1,
merge
  test (in=t)
  epu_data (
    in=e
    keep=sas_date epu
  )
;
by sas_date,
if t and e;
run;

and then post the complete log (code and messages) from this step.

PGStats
Opal | Level 21

Maybe you imported the dates from somewhere where they are not represented quite the same as in SAS (e.g. Excel)? Happened to me once. The date numbers were not integers. Try:

 

left join  EPU_Data as B on round(R.sas_date) = round(B.sas_date)

 

PG

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!

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