[004] IBM i (AS/400): Import CSV file into physical file

preview_player
Показать описание
In this video we use the CPYFRMIMPF (copy from import file) command to load data from a CSV file into a physical file (database table) we created in the last video. We'll see how error rows are handled, as well as options we have for dealing with NULL values.
Рекомендации по теме
Комментарии
Автор

Fearless teacher!
Very nice video explaining CSV import!
Thank you!

higiniofuentes
Автор

Thanks again for the nice video. I should be able to create my own databases from the different tables I used in courses before.

Stosszahlansatz
Автор

You can see the error messages by moving the cursor on the ..x number of records copied ...status message, then press F1 then F10. A list of errors will be displayed and you can press F1 on each message.

roadgeek
Автор

Thank you for this very interesting video!
Have you a video to do the way round (export from DB2 to CSV)?
Or you can explain how to do it?
Thank you!

higiniofuentes
Автор

thank you for your video! so, can i use the windows command prompt the same way, you are using it, to ftp?

alkisko
Автор

Thanks for your helpful guide.

But I'm facing some problems related to "file encoding".

I should import data from a vendor CSV file encoded in UTF-8 BOM format.

I tried to use command parameter TOCCSID trying some corresponding values with no success.

I mean, the result is that the command writes all the CSV data on the physical file, I correctly managed every import feature on the command but not CCSID.

When I try to use the data written on the physical file (also a simple SQL select), the data are displayed as "corrupted".

In fact in the UTF-8 BOM encoding standard, the file has a starting hidden value that specifies the file encoding that is wrongly managed by the CPYFRMIMPF command and corrupt all the datas... this special character looks like  checking the csv file content from QSHELL - CAT command and also at the beginning of each row there is a special character that the system can't decode and that I can see using an external SQL client ...

Do you have any suggestions?

Filippo
Автор

I have to do the same thing by FTP, need to import a CSV file through cl programming any help.

shashankrai
Автор

Hi Mentor ..

Can we create text file whatever we are seeing on green screen for our reading purpose?

ersushildubey