2

I'm uploading an ebcdic file(converted from ascii) from Windows OS to Mainframe. My problem is that when I checked the file after uploading it, I see alot of new lines. When I tried to check it with its hex dump I discovered that when mainframe sees a x'15' it translates it into a newline. In the file there are packed decimals so the hex could contain let say a x'001500001c' but when I upload it, mainframe mistook it as a new line. Can anyone help me with this problem?

4

2 回答 2

2

You should put your FTP client (or library if the upload is done by your code) into binary (IMAGE TYPE) mode instead of ascii/EBCDIC if you are sending a file already in EBCDIC i believe.

于 2009-02-23T03:45:05.483 回答
1

这取决于您要上传到的目标“文件”的类型。

如果您要上传到具有固定块大小的成员(例如,FB80),则需要确保在传输之前用空格填充所有行(以二进制模式)。

文本模式传输不适合二进制文件(如果您的文件包含压缩小数,则它们二进制文件 - FTP 没有可靠的方法来检测真正的行尾字符)。

您需要修复 Windows ASCII 到 EBCDIC 转换器才能生成固定长度的记录。

唯一的其他选择是在大型机上使用 REXX 脚本,但这仍然需要能够区分真正的行尾标记和二进制数据中的标记。

您可以通过它由 BCD nybbles 组成的事实来判断是否存在压缩十进制,其中最后一个是 0xC 或 0xD,但这也可能导致误报或误报。

我的建议:当您将其从 ASCII 转换为 EBCDIC 时,同时将行填充到所需的记录长度。

我想提出的另一点是,如果您只想查看大型机上的文件(不要在任何需要 EBCDIC 的代码中使用它们),ISPF 编辑器包括一些新命令(从 z/OS 1.9 开始)如果我没记错的话)。

SOURCE ASCII将数据显示为 ASCII 而不是 EBCDIC。此外,该LF命令允许您按摩 FB 成员中的 ASCII 流以正确修复行尾。

于 2009-02-23T05:05:29.347 回答