120 pts.
 RUNSQLSTM ALTER TABLE
i'm trying to run SQl statment in batch job to alter Table CCSID to 420 but i have error Reason code 10 

Hani 


Software/Hardware used:
AS400 V5R3M0
ASKED: Feb 14, 2012  10:51 AM GMT
UPDATED: February 27, 2012  8:43:17 PM GMT
120 pts.

Answer Wiki:
Message . . . . : Change to field INAME may result in data loss.
Cause . . . . . : A change to field INAME in file DWLOAD in library
TEST may cause data loss. The reason code is 8. The reason codes and
their meanings are as follows:
01 - The field will be dropped.
02 - The new length is shorter than the current length.
03 - The new precision is shorter than the current precision.
04 - The new scale is shorter than the current scale.
05 - The new data type is floating point and the current data type is not
floating point with the same length.
06 - The current data type is floating point and the new data type is not
floating point with the same length.
07 - The new attribute is not nullable and the current attribute is
nullable.
08 - The new CCSID is different from the current CCSID.
09 - The new data type is date, time, or timestamp and the current data
type is character, DBCS-open, or DBCS-either.
10 - The new data type is character, DBCS-either, or DBCS-only and the
current data type is DBCS-open, or the new data type is character or
DBCS-only and the current data type is DBCS-either.
Recovery . . . : If the changes to field INAME are not desired, change
the specified attributes of field INAME and try the function again.
Last Wiki Answer Submitted:  Feb 15, 2012  12:02 AM (GMT)  by  Hanisadeq   120 pts.
To see other answers submitted to the Answer Wiki View Answer History.
Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _




 

i have error Reason code 10

The reason code is not useful unless we have the error message identifier. Please post the error message including the message identifier.

Tom

 66,990 pts.

 

Message . . . . : Change to field INAME may result in data loss.
Cause . . . . . : A change to field INAME in file DWLOAD in library
TEST may cause data loss. The reason code is 8. The reason codes and
their meanings are as follows:
01 - The field will be dropped.
02 - The new length is shorter than the current length.
03 - The new precision is shorter than the current precision.
04 - The new scale is shorter than the current scale.
05 - The new data type is floating point and the current data type is not
floating point with the same length.
06 - The current data type is floating point and the new data type is not
floating point with the same length.
07 - The new attribute is not nullable and the current attribute is
nullable.
08 - The new CCSID is different from the current CCSID.
09 - The new data type is date, time, or timestamp and the current data
type is character, DBCS-open, or DBCS-either.
10 - The new data type is character, DBCS-either, or DBCS-only and the
current data type is DBCS-open, or the new data type is character or
DBCS-only and the current data type is DBCS-either.
Recovery . . . : If the changes to field INAME are not desired, change
the specified attributes of field INAME and try the function again

 120 pts.

 

That’s much more useful (though you still didn’t show the message identifier, but it probably isn’t needed if the full message data is shown — it might still be needed.)

Next, that shows reason code 8, not reason code 10. However, neither case is a problem unless it actually results in data loss that you cannot accept.

By changing the CCSID, you are potentially changing how much space is needed to store the value. If you don’t also change the size of the column, some of the data might be truncated.

It’s up to you to decide if any values in the column will be larger than the size of the column after the CCSID changes.

What is the error severity? What severity did you specify for the ERRLVL() parameter of the RUNSQLSTM command?

Tom

 66,990 pts.

 

ERRLVL 30
MSG ID SEV RECORD TEXT
SQL0952 30 1 Position 1 Processing of the SQL statement ended.
Reason code 10.

 120 pts.