Re: Convert Packet decimals comp-3 and comp-6

2011-05-09 Thread JosepM
Hi Peter, So PIC9(5) COMP-3 is 5 bytes / 2 = 2.5 rounded to 3 bytes? Also I see that the first record contain some garbage or almost I don't have idea how decode it. Salut, Josep -- View this message in context:

Re: Convert Packet decimals comp-3 and comp-6

2011-05-09 Thread Peter W A Wood
Josep On 9 May 2011 18:28, JosepM jmye...@mac.com wrote: Hi Peter, So PIC9(5) COMP-3 is 5 bytes / 2 = 2.5 rounded to 3 bytes? No, PIC9(5) is a 3 byte field - 5 digits + sign - each of which is 4 bits long. When a PIC9(5) field is included in a record the compiler might insert a 'padding'

Re: Convert Packet decimals comp-3 and comp-6

2011-05-08 Thread Peter W A Wood
Hi Josep The file come from a PC-MSDOS with a old ACUCOBOL-GT application, it's the customer file data, I have the File Definition with the structure of record. Then the test will be ASCII encoded so you don't need to worry about having to convert the text; It's a one-off conversion but I

Re: Convert Packet decimals comp-3 and comp-6

2011-05-06 Thread Peter W A Wood
Hi Josep On 6 May 2011, at 00:36, JosepM wrote: Hi, I need to read a file from a Cobol application and import the data files. I have the file description but I don't have idea how convert the decimals fields. 01 NAME PIC X(30) -- This I guess is 30 chars 02 CODE PIC 9(5) COMP-6 -- This

Re: Convert Packet decimals comp-3 and comp-6

2011-05-06 Thread JosepM
Many thanks! I will try... But how I must read the file? as file: or as binfile:? I mean how get the chars... :( Salut, Josep -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Convert-Packet-decimals-comp-3-and-comp-6-tp3498822p3502906.html Sent from the

Re: Convert Packet decimals comp-3 and comp-6

2011-05-06 Thread Peter W A Wood
I suspect the answer partly lies in knowing where the file originated from and where you are reading it from. (By where, I mean what computer/operating system.) By the way, one thing that is easy to overlook is that if the file has come directly from an IBM Mainframe any character strings will