SQLCODE = -203 when running GTXMSKL job on z/OS

Document ID : KB000014818
Last Modified Date : 14/02/2018
Show Technical Document Details
Question:

When I am trying to GTXMAP job on the Mainframe,  I run into the following issue:

ERROR MESSAGE when executing mainframe JCL job GTXMSKL 

Program name GTXMAP 

Program version 5.0.1 

Program date 2014-06-09 

Program GTXMSKL 

Program version 5.1.1 

Program date 2016-07-08 

SQL ERROR: See REPORT for further info 

CUSTOMER_ID 

DSNT408I SQLCODE = -203, ERROR: A REFERENCE TO COLUMN CUSTOMER_ID IS 

AMBIGUOUS 

DSNT418I SQLSTATE = 42702 SQLSTATE RETURN CODE 

READY 

DSN SYSTEM(C10V) 

DSN 

RUN PROGRAM(GTXMSKL) PLAN(GTXMSKL) LIB('GRIDDEMO.LOADLIB') 

 

I see i am getting a SQLCODE = -203  What is causing this issue?

Environment:
TDM for Mainframe 5.4
Answer:

The issue is that you are running into an ambiguous error with a query that you are trying to mask with.

Assume you have these two tables:

Order

(id, quantity_on_hand, price, instock)

Detail

(id, orderid, partcode, instock)

 

and your masking query was this:

select * from order, detail

where order.id = detail.orderid and

stock = 3

 

You would generate SQLCODE -203 error on the stock field, since the query did not indicate to use the stock field from the order table or the detail table.

To address this issue, you would change your query to:

 

select * from order, detail

where order.id = detail.orderid and

order.stock = 3

 

This would resolve your SQLCODE = -203 error.