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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 885 views
  • 4 likes
  • 4 in conversation