Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
557 views
in Technique[技术] by (71.8m points)

iconv to convert Mainframe EBCDIC file to Unix readable format writes data in one single row

I am trying to convert Mainframe file to Unix readable format using below iconv command.
iconv -f IBM-037 -t ISO8859-1 FileA > FileB

This command converts data as expected, but writes output data in one single row. Can someone help on how to handle this file format conversion?

question from:https://stackoverflow.com/questions/65854440/iconv-to-convert-mainframe-ebcdic-file-to-unix-readable-format-writes-data-in-on

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I guess you transfer the data in binary from z/OS to UNIX, then use iconv on the UNIX side. There are no line end characters on z/OS data set records, so there is nothing in the data that iconv can convert to line end character(s).

You need to transfer in ASCII. FTP will take care of the translation, and will insert line end character(s).

You can set influence the code pages used in translating, if the fefault set on the FTP server on z/OS is not what you need:

quote site sbdataconn=(*host-code-page*,*network-(unix)-code-page*)

Default line end characters are 0x0d0a. You can change this with

quote site sbsendeol=NL
                     CR
                     CRLF  (default)
                     NONE

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...