We are converting from a Sybase database to DB2 and I am working to create extract files of the data to load to DB2. All tables with only column definitions from the source and target loaded fine.
There are other tables where the first column is defined as char and the last column is defined as varchar in both sybase and db2. Using bcp, I set the prefix-length equal to 2 for the varchar column. From my understanding this will store the actual size of the varchar content in the first two bytes prior to the value. This file is then ftp'd to the mainframe and processed in the load jcl. In a file of 5 rows, all will load in DB2 except the first. It is not calculating the prefix length value correctly, therefore it is being thrown out.
I don't understand it will create 4 of the 5 rows correctly with the correct value in the prefix length. Is this happening because it is the first record? The format file looks similar to the following:
10.0
2
1 SYBCHAR 0 1 "" 1 income_need
2 SYBCHAR 2 34 "\n" 2 income_need_desc
When I increased the size of the 2nd column, by 2 bytes for the storage, it loaded fine, with the exception of the first record.
Any suggestions or thoughts appreciated.
There are other tables where the first column is defined as char and the last column is defined as varchar in both sybase and db2. Using bcp, I set the prefix-length equal to 2 for the varchar column. From my understanding this will store the actual size of the varchar content in the first two bytes prior to the value. This file is then ftp'd to the mainframe and processed in the load jcl. In a file of 5 rows, all will load in DB2 except the first. It is not calculating the prefix length value correctly, therefore it is being thrown out.
I don't understand it will create 4 of the 5 rows correctly with the correct value in the prefix length. Is this happening because it is the first record? The format file looks similar to the following:
10.0
2
1 SYBCHAR 0 1 "" 1 income_need
2 SYBCHAR 2 34 "\n" 2 income_need_desc
When I increased the size of the 2nd column, by 2 bytes for the storage, it loaded fine, with the exception of the first record.
Any suggestions or thoughts appreciated.