使用记录编辑器/Jrecord解压缩COMP-3位数字 [英] Unpacking COMP-3 digit using Record Editor/Jrecord
问题描述
我已经基于cobol字帖创建了版面.
I have created layout based on cobol copybook.
布局快照:
我也尝试选择相同的布局来加载数据,这对某些列给了我错误的结果.我尝试使用所有二进制数字类型.
I tried to load data also selecting same layout, it gives me wrong result for some columns. I try using all binary numeric type.
- CLASS-ORDER-EDGE
- DIV-NO-EDG
- OFFICE-NO-EDG
- REG-AREA-NO-EDG
- CITY-NO-EDG
- COUNTY-NO-EDG
- BILS-COUNT-EDG
- REV-AMOUNT-EDG
- USAGE-QTY-EDG
- GAS-CCF-EDG
- CLASS-ORDER-EDGE
- DIV-NO-EDG
- OFFICE-NO-EDG
- REG-AREA-NO-EDG
- CITY-NO-EDG
- COUNTY-NO-EDG
- BILS-COUNT-EDG
- REV-AMOUNT-EDG
- USAGE-QTY-EDG
- GAS-CCF-EDG
结果快照
输入文件可以在附件下面找到
Input file can be find below attachment
或
https://drive.google.com/open?id=0B-whK3DXBRIGa0I0aE5SUHdMTDgg
预期输出:
相关线程 使用Java解压缩COMP-3位数字
推荐答案
第一个问题是您对文件进行了 EBCDIC-> ascii 转换!!!!
First Problem you have done an EBCDIC --> ascii conversion on the file !!!!
EBCDIC-> ascii 转换还将尝试转换二进制字段和文本.
The EBCDIC --> ascii conversion will also try and convert binary fields as well as text.
例如:
Comp-3 value hex hex after Ascii conversion
400 x'400c' x'200c' x'40' is the ebcdic space character
it gets converted to the ascii
space character x'20'
您需要执行二进制传输,将文件保留为ebcdic:
You need to do binary transfer, keeping the file as ebcdic:
- 检查大型机上的文件是否具有RECFM = FB,您可以进行传输
- 如果文件为RECFM = VB,请确保传输 RDW(记录描述符词)</strong>(或将VB文件复制到大型机上的FB文件).
其他要点:
Other points:
您将必须更新RecordEditor/JRecord
You will have to update RecordEditor/JRecord
- 字体必须为ebcdic(美国ebcdic为cp037;其他查找为
- 文件结构/文件组织需要更改(固定长度/VB)
- The font will need to be ebcdic (cp037 for US ebcdic; for other lookup)
- The FileStructure/FileOrganisation needs to change (Fixed length / VB)
最后
- BILS-Count-EDG的长度为9个字符,或者从第85列开始(长度为8个字节).
- 您应将Xml作为文字包含在内,而不要在其中复制图片.
- 在RecordEditor中,如果您右键单击>>>编辑记录;它将显示字段为值",原始文本"和十六进制".这对于查看发生了什么情况很有用
- 您似乎并没有接受很多答案;答案是否能解决您的问题并不重要;是答案是否是问题的正确答案.
- BILS-Count-EDG is either 9 characters long or starts in column 85 (and is 8 bytes long).
- You should include Xml in as text not copy a picture in.
- In the RecordEditor if you Right click >>> Edit Record; it will show the fields as Value, Raw Text and Hex. That is useful for seeing what is going on
- You do not seem to accept many answers; it is not relevant whether the answer solves your problem; it is whether the answer is correct answer for the question.
这篇关于使用记录编辑器/Jrecord解压缩COMP-3位数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!