We have a process involving preparation of csv file for uploading to the AS400 via "DATA TRANSFER TO IBMi" tool.
The second column of the DB2 file must be populated with a NULL VALUE.
The second column of the DB2 file is already set as being "NULL CAPABLE".
In the csv file, the second column is simply represented as two consecutive comma with no spaces in between (the first comma being the delimiter of the first field/column).
We have 3 IBM AS400 machines, my tester is claiming that it is not uploading as expected on one machine (SIT machine) but is working on the other two machines (UAT and Production machines).
I am at loss on why the csv file is not uploading properly in the SIT machine and instead of populating the second row of the DB2 file with NULL VALUE, it is populating it with SPACE VALUE.
I even tried putting the word NULL on the second row of the csv file but it still wont populate the second row of the DB2 file with NULL VALUE in the SIT Machine.
Does anybody know how to make sure that the uploading works properly on all 3 machines?
The “empty” value from a CSV data line (e.g. two commas in a row - ...,,...) is considered as NULL value when, and only when the corresponding database field is not defined with NOT NULL attributes.
If NOT NULL is presented in the field definition, then two commas in a row from input data are converted to “empty character string” - ‘’, which further might be either extended to CHAR(nn), or not extended for a VARCHAR field.
P.S.
Explicit “empty character string” in CSV data is coded as ...,””,..., and is always loaded as string value (not NULL), no matter how the field is defined.