将COMP-3压缩的十进制字段解释为数值 [英] Interpreting COMP-3 Packed Decimal Fields into numeric values

查看:269
本文介绍了将COMP-3压缩的十进制字段解释为数值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个SSIS包,以从一系列抄写本文件中读取解压缩的数据。我不确定以下字段定义的正确解释,并希望有人知道:

I am creating an SSIS package to read in unpacked data from a series of copybook files. I am unsure of the correct interpretation of the following field definitions and was hoping someone would know:

FIELD-NAME-1 PIC S9(15)V9(3)COMP- 3.

FIELD-NAME-2 PIC S9(3)V9(8)COMP-3。

FIELD-NAME-3 PIC S9(3)V9(6)COMP- 3。

FIELD-NAME-1 PIC S9(15)V9(3) COMP-3.
FIELD-NAME-2 PIC S9(3)V9(8) COMP-3.
FIELD-NAME-3 PIC S9(3)V9(6) COMP-3.

数据以固定宽度的文本存储。以上字段的数据长度如下:

The data is stored in fixed width text. The data for the above fields has the following lengths:

FIELD-NAME-1:19
FIELD-NAME-2:11
FIELD- NAME-3:9

FIELD-NAME-1: 19 FIELD-NAME-2: 11 FIELD-NAME-3: 9

我不确定如何解释小数位和符号。

I am unsure how to interpret the decimal place and sign.

任何帮助都会

亲切的问候,
火腿

Kind Regards, Ham

推荐答案

请参见 http://jrecord.cvs.sourceforge.net/viewvc/jrecord/jrecord/src/net/sf/JRecord/Common/Conversion.java?revision=1.2&view=markup

有关在Java中转换压缩十进制的示例(它是jrecord项目jrecord.sf.net的一部分)

for an example of converting packed decimal in java (it is part of the jrecord project jrecord.sf.net)

这篇关于将COMP-3压缩的十进制字段解释为数值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆