排序的SAS表没有合并

时间:2015-03-31 14:36:12

标签: sas

我正在尝试进行简单的合并并收到“BY变量未在数据集WORK.GMBY1上正确排序”的错误

对它们进行了排序,我对它们进行了排序并手动检查它们是否已经过排序。

每个表中的变量大小和格式相同。

proc SQL连接也不起作用。

关于这里可能出现什么问题的任何线索?

感谢。

proc sort data=total_channels (where=(orders ne . and website_country='UK')) out=sorted_channels; 
by website_country year_order month_order channel;
run;

proc sort data=gmby out=gmby1;
by website_country year_order month_order channel;
where website_country='UK';
run;

data gmby_merge;
merge sorted_channels gmby1;
by website_country year_order month_order channel;
run;

LOG

ERROR: BY variables are not properly sorted on data set WORK.GMBY1.
website_country=UK year_order=2012 month_order=9 orders=. bookings=. gm=. channel=DisplayRetargeting order_count=3
fo_gm_euro=22.605769157 yr1_gm_euro=67.88001442 cum_yr2=90.972795325 cum_yr3=108.83075505 cum_yr4=124.35002072 cum_yr5=138.15287302
fiscal_year=2013 fiscal_quarter=1 FIRST.website_country=0 LAST.website_country=0 FIRST.year_order=0 LAST.year_order=0
FIRST.month_order=0 LAST.month_order=0 FIRST.channel=1 LAST.channel=1 _ERROR_=1 _N_=40
NOTE: The SAS System stopped processing this step because of errors.

1 个答案:

答案 0 :(得分:0)

这实际上是由于“频道”包含大写变量。

我有“DRTV”和“Direct Type-In”,前者在后者之前被排序,因为SAS在小写之前排序大写因此加入失败。我降低了DRTV。

我不知道帽子很重要!很高兴知道。

谢谢大家。

相关问题