From 1bb95cb1771c8d7f7c8954e3f70f03f30ba206d8 Mon Sep 17 00:00:00 2001 From: Evan Miller Date: Tue, 9 Apr 2019 08:52:46 -0400 Subject: [PATCH] SAS reader: Report row/column of bad strings --- src/sas/readstat_sas7bdat_read.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sas/readstat_sas7bdat_read.c b/src/sas/readstat_sas7bdat_read.c index 7ac46f94..61dc159e 100644 --- a/src/sas/readstat_sas7bdat_read.c +++ b/src/sas/readstat_sas7bdat_read.c @@ -379,8 +379,8 @@ static readstat_error_t sas7bdat_handle_data_value(readstat_variable_t *variable if (retval != READSTAT_OK) { if (ctx->handle.error) { snprintf(ctx->error_buf, sizeof(ctx->error_buf), - "ReadStat: Error converting string to specified encoding: %.*s", - col_info->width, col_data); + "ReadStat: Error converting string (row=%u, col=%u) to specified encoding: %.*s", + ctx->parsed_row_count+1, col_info->index+1, col_info->width, col_data); ctx->handle.error(ctx->error_buf, ctx->user_ctx); } goto cleanup;