BookmarkSubscribeRSS Feed
Mirisage
Obsidian | Level 7

Hi SAS Forum,

Could you please help me to find out the reason for the error messege (highlighted in red below) when I have called the macro?

%macro newname (MTH_YR=, ym=) ;

proc sql;

create table out.cccc_&mth_yr._v2 as

select     min(a.var1    )        as var1      ,

           min(a.custno  )        as cif       ,

           min(b.cif     )        as cif       ,

          min(b.yearmonth)        as yearmonth       

          

from   out.cccc_&mth_yr._v1                  a,

        extra.age_profile                     b

                    

              where  a.custno= b.cif

               and  b.yearmonth = 201104

                         group  by b.cif

                     ;

                            quit;

%mend newname;

/*macro call*/

%newname(MTH_YR=Apr11, ym=201104) ;

 

ERROR: Expression using equals (=) has components that are of different data types.

Thanks

Mirisage

2 REPLIES 2
allurai0412
Fluorite | Level 6

hi

Since you have not provided the data sets' strucure..

please check the line......

where a.custno=b.cif 

i guess ...these are different data  types !!

Regards

ALLU

AncaTilea
Pyrite | Level 9

HI.

I believe your problem may be here:

where  a.custno= b.cif

               and b.yearmonth = 201104


I think you should replace it with: (Please note the quotations around the 2011104)

where  a.custno= b.cif

               and  b.yearmonth = "201104"




Let me know.

Good luck!

Anca.

PS: Also, in your macro, shouldn't your line ...

where  a.custno= b.cif

               and b.yearmonth = 201104

actually read:

where  a.custno= b.cif

               and b.yearmonth = "&ym."

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
  • 2 replies
  • 643 views
  • 1 like
  • 3 in conversation