FTP unicode file from Windows to z/OS

Frédéric Bothy

FTP unicode file from Windows to z/OS

Hi, 

I have a got unicode files on windows that I need to load into aDB2 z/OS unicode tables. 

When transferring the files in ASCII, the CR & LF (Carriage Return & Line Feed) at the end of the lines are correctly handled, and I have as many records / lines in the files on z/OS as on windows. 

But I am obviously loosing the special (non-ASCII) characters during the transfer.

 

When transferring the data in binary, I correctly receive the unicode data on z/OS, but am loosing the CR & LF record, so only get ONE long record.  That can't be used by the LOAD utility ( If there is more than 1 record in the source files)

Does anyone have an idea on how to get a well formatted unicode on z/OS ? ( similar to an UNLOAD sysrec file of the target unicode table ?  All in unicode UTF-8 but with 1 record per line. )

 

Thanks in advance for your help. 

Fred Bothy

email:[login to unmask email]

 

 

 

Marcel Harleman

Betr: FTP unicode file from Windows to z/OS
(in response to Frédéric Bothy)

Hi Frédéric, I use binary file transfer to z/OS and copy the resulting file
with "cp -F cr <utf8-infile> <utf8-outfile>" to its final destination. Hope
this is acceptable for the LOAD utility (I have not tested that).

Regards, Marcel.




Van: Frédéric Bothy <[login to unmask email]>
Aan: [login to unmask email]
Datum: 12-02-2019 15:56
Onderwerp: [DB2-L] - FTP unicode file from Windows to z/OS





Hi,


I have a got unicode files on windows that I need to load into aDB2 z/OS
unicode tables.


When transferring the files in ASCII, the CR & LF (Carriage Return & Line
Feed) at the end of the lines are correctly handled, and I have as many
records / lines in the files on z/OS as on windows.


But I am obviously loosing the special (non-ASCII) characters during the
transfer.





When transferring the data in binary, I correctly receive the unicode data
on z/OS, but am loosing the CR & LF record, so only get ONE long record.
That can't be used by the LOAD utility ( If there is more than 1 record in
the source files)


Does anyone have an idea on how to get a well formatted unicode on z/OS ?
( similar to an UNLOAD sysrec file of the target unicode table ?  All in
unicode UTF-8 but with 1 record per line. )





Thanks in advance for your help.


Fred Bothy


email:[login to unmask email]













Site Links: View post online View mailing list online Start new thread
via email Unsubscribe from this mailing list Manage your subscription


This email has been sent to: [login to unmask email]


ESAi has well-regarded tools for Fast Cloning, Buffer Pool Tuning, Log
Analysis, TDM & more.
BCV4, BCV5, BPA4DB2, ULT4DB2... modern power tools to get the job done
faster & easier than ever.
http://www.ESAIGroup.com/idug



Use of this email content is governed by the terms of service at:
http://www.idug.org/p/cm/ld/fid=2








------------------------------------------------------------------------
De Belastingdienst stelt e-mail niet open voor aanvragen, aangiften, bezwaarschriften, verzoeken, klachten, ingebrekestellingen en soortgelijke formele berichten.
Dit bericht is uitsluitend bestemd voor de geadresseerde. Het bericht kan vertrouwelijke informatie bevatten waarvoor de fiscale geheimhoudingsplicht geldt. Als u dit bericht per abuis hebt ontvangen, wordt u verzocht het te verwijderen en de afzender te informeren.

The Dutch Tax and Customs Administration does not accept filings, requests, appeals, complaints, notices of default or similar formal notices, sent by email.
This message is solely intended for the addressee. It may contain information that is confidential and legally privileged. If you are not the intended recipient please delete this message and notify the sender.
Attachments

  • graycol.gif (<1k)

Bernard JABAS

RE: FTP unicode file from Windows to z/OS
(in response to Frédéric Bothy)

Hi Frederic,

If you are using IBM Personal Communications, I think the transfer options for binary files are without crlf by default.  But you can  define a customized transfer type :

On the transfert screen, select 'Options' and then the 'MVS/TSO' tag, transfert type 'binary' and customize it to a new one with 'crlf' selected and recordformat VB for instance ...

Hope this helps,

Regards,

Bernard

Fr&#233;d&#233;ric Bothy

RE: FTP unicode file from Windows to z/OS
(in response to Bernard JABAS)

Hi Bernard, Marcel, 

I have find a way to do it with our Reflection emulator.  You have the option to transfer the file in binary with our without CRLF.    

Many thanks for you help. Really appreciated !

Fred

Kai Stroh

RE: FTP unicode file from Windows to z/OS
(in response to Frédéric Bothy)

You can transfer plain text files that are encoded in UTF-8 into a VB data set on z/OS. Using the following FTP commands, you will get one record in the z/OS data set for each line in your Windows file. The line terminator should CR+LF, which is the default for Windows.

Simply use the Windows command line FTP program to connect to z/OS and then issue the following commands:



ascii
quote site lrecl=32700 recfm=vb cyl pri=10 sec=10
quote site ENCODING=MBCS MBDATACONN=(1208,1208)
put sourcefilename.txt 'TARGET.DATA.SET.NAME'

 

Adjust the first "quote site" statement to set your space attributes and RECFM, if necessary.


This example assumes that your Windows file is encoded in UTF-8. If you use UTF-16, the CCSID would be 1200 instead of 1208. Pay attention to the byte order mark (BOM), which may or may not be present in the first couple of bytes in your Windows file (use a hex editor to check). If present, the BOM may show up in the first couple of bytes of the first record in the z/OS data set and you may need to get rid of it.

FTP will not do any code page conversion when used in this way. It will only detect CR+LF and treat it as the end of a record. The host data set will also be in UTF-8. Therefore, if you want to load it into a Db2 table, you need to specify UNICODE CCSID(1208,1208,1208) in your LOAD statement. That should take care of it.

Best regards
Kai

--
Kai Stroh
UBS Hainer
Fast, efficient Db2 z/OS data migrations and renewals. That’s BCV5.
Learn how the Test Data Management Field Guide can help you to improve your own process.

Fr&#233;d&#233;ric Bothy

RE: FTP unicode file from Windows to z/OS
(in response to Kai Stroh)

Hi Kai. 

I just gave it a try and it works perfectly.

Thanks for your help,

Fred