BookmarkSubscribeRSS Feed
Aaron19
Calcite | Level 5

CODE:

Data New;

  merge WORK.COMBINED _EXP2_.TRADES_22FEB2010;

  by symbol time;

Run;

ISSUE: want to merge two data sets so that there are unique entries for each time by symbol, such that at each "TIME" there is a row in each data set with 120 unique "SYMBOL".

ERROR: BY variables are not properly sorted on data set WORK.COMBINED.

time=57599970 symbol=MELI best_hft_bid=40.78 best_nonhft_bid=40.91 best_hft_ask=41.04

best_nonhft_ask=40.93 hft_bsize=1200 hft_asize=3100 nonhft_bsize=100 nonhft_asize=2839 date=22FEB2010

shares=50 buysell=B price=36.8300 type=NN FIRST.symbol=0 LAST.symbol=0 _ERROR_=1 _N_=505346

NOTE: MERGE statement has more than one data set with repeats of BY values.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: There were 29127 observations read from the data set WORK.COMBINED.

NOTE: There were 480364 observations read from the data set _EXP2_.TRADES_22FEB2010.

WARNING: The data set WORK.NEW may be incomplete.  When this step was stopped there were 505345

         observations and 15 variables.

WARNING: Data set WORK.NEW was not replaced because this step was stopped.

2 REPLIES 2
stat_sas
Ammonite | Level 13

Before merge both data sets should be sorted by symbol time. Sort WORK.COMBINED before merging.

proc sort data=WORK.COMBINED;

by symbol time;

run;

Reeza
Super User

Sort each dataset before merge as the error indicates.

Or switch to a proc sql.

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
  • 2 replies
  • 1185 views
  • 0 likes
  • 3 in conversation