# leftouter.s
leftouter_function (A,B,AKEY=1,BKEY=1)
{
# A,B are input matrices
# AKEY is the position of the column to be matched in A
# BKEY is the position of the key column in B
# result is a matrix
# e (matrix) = records present in a
acols_dim(A)[2]
bcols_dim(B)[2]
erows_dim(A)[1]
ecols_acols+bcols-1
alocinb_match(A[,AKEY],B[,BKEY])
e_matrix(NA,erows,ecols)
e[,1:acols]_A[,]
# change only the matching rows
ii_(1:erows)[alocinb!="NA"]
jj_alocinb[alocinb!="NA"]
e[ii,(acols+1):ecols]_B[jj,-BKEY]
e
}

