IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Uploading from desktop, a CSV file, second column NULL VALUE


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
The_Gentleman

New User


Joined: 23 Apr 2021
Posts: 1
Location: Singapore

PostPosted: Fri Apr 23, 2021 8:54 am
Reply with quote

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?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Fri Apr 23, 2021 9:41 am
Reply with quote

Compare table definition across three regions , compare jobs that loads into the table and the input csv, if everything is 100% match then ask DBA.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Fri Apr 23, 2021 5:22 pm
Reply with quote

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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top