packed decimal

33 views
Skip to first unread message

Chethan h.s

unread,
Feb 14, 2015, 11:11:06 PM2/14/15
to legsta...@googlegroups.com
Hi Fadys

I have data compressed in this format I am not sure is this standard packing http://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/rpgrpack.gif 
Will I able to use leg star to read the data into my java object 


*01  FEE-REC                                         <<CommonCbLayout>>
           03   RECORD-KEY.
               05   CLIENT-NO           PIC  X(3).
               05   CLIENT-SUFFIX       PIC  X.
               05   LOAN-NO.
                   07   OUR-NO          PIC  X(6).
                   07   CK-DIG          PIC  X.
               05   REC-CODE            PIC  X.
               05   REC-NUMBER          PIC  999.

section highlighted is packed data, Can write custom transformer and read this data using legstar 

when I read the data IBM037 charset I could see the loan num is like this.
Record [clientNo=384, clientSuffix=1, loanNo= ?? ?? , recCode=P, recNumber=1]


Fady

unread,
Feb 15, 2015, 4:10:30 AM2/15/15
to legsta...@googlegroups.com
Hello Chethan,

Your copybook says that LOAN-NO is composed of 7 bytes. By default, these are converted to a java String.

Your test shows that the content of this field is not displayable EBCDIC characters.

You say the content might be packed decimal but if this was the case, your copybook does dot match (a packed decimal is not a PIC X).

My advice is to look at the data from the file you are reading, for instance you can do:

System.out.println(HostData.toHexString(data, 0, 15));

right after you read the data, it should tell you what you have at offset 4.

Fady
Reply all
Reply to author
Forward
0 new messages