packed-decimal

SQL How to get COMP-3 Packed Decimal?

强颜欢笑 提交于 2019-12-11 02:08:01
问题 I am creating an ASCII output file contain some information and two of my fields require the date and time to be in packed decimal fields (COMP-3). I am using SQL and SSIS to generate my file. Field Name Format Length Picture Date YYYYMMDD 5 S9(8) C-3 Time HHMMSS 4 S9(6) C-3 I have searched multiple sites and I still can't figure out how to convert a date/time into a packed decimal field. Any help would be greatly appreciated. The following site http://www.simotime.com/datapk01.htm

Unpacking COMP-3 digit using Java

女生的网名这么多〃 提交于 2019-12-08 04:54:47
问题 I have a file with some COMP-3 encoded fields. Can someone please tell me how do I test this code in below thread ? How to unpack COMP-3 digits using Java? Code I tried is BufferedReader br = new BufferedReader(new FileReader(FILENAME))) { String sCurrentLine; int i=0; String bf =null; while ((sCurrentLine = br.readLine()) != null) { i++; System.out.println("FROM BYTES "); System.out.println(unpackData(sCurrentLine.getBytes(), 5)); for (int j = 0; j < sCurrentLine.length(); j++) { char c =

Unable to unpack comp 3 to numeric in java

≯℡__Kan透↙ 提交于 2019-12-04 05:54:42
问题 I referred a code on the internet to unpack comp 3 to numeric in java. I tried to pass a sample comp3 file to the code but I didn't get the proper unpacked data. I got some weird numbers. I am new to this concept(comp 3) so can you guys help me on this. Thanks in advance Below is my code import java.math.BigInteger; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; /** * Converts between integer and an array of bytes in IBM mainframe packed * decimal format.

Unpacking COMP-3 digit using Record Editor/Jrecord

十年热恋 提交于 2019-12-02 20:47:39
问题 I have created layout based on cobol copybook. Layout snap-shot: 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 result snapshot Input file can be find below attachment enter link description here or https://drive.google.com/open?id=0B-whK3DXBRIGa0I0aE5SUHdMTDg Expected

Unpacking COMP-3 digit using Record Editor/Jrecord

可紊 提交于 2019-12-02 11:52:09
I have created layout based on cobol copybook. Layout snap-shot: 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 result snapshot Input file can be find below attachment enter link description here or https://drive.google.com/open?id=0B-whK3DXBRIGa0I0aE5SUHdMTDg Expected output: Related thread Unpacking COMP-3 digit using Java First Problem you have done an EBCDIC --> ascii

How to convert unpacked decimal back to COMP-3? [closed]

五迷三道 提交于 2019-11-30 06:02:45
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago . I had asked a question about converting COMP fields, for which I did not get any answer. I hope stack-overflow can help me on this question. I succeeded in converting COMP-3 to decimal. I need your help in converting the unpacked decimal back to COMP-3, in any high level programming language, but

How to convert unpacked decimal back to COMP-3? [closed]

北慕城南 提交于 2019-11-28 14:00:19
I had asked a question about converting COMP fields, for which I did not get any answer. I hope stack-overflow can help me on this question. I succeeded in converting COMP-3 to decimal. I need your help in converting the unpacked decimal back to COMP-3, in any high level programming language, but preferably in Java or c#.net. Bruce Martin In packed decimal -123 is represented as X'123d' (the last nyble c,d or f being the sign). One of the simplest ways to handle packed decimal is to simply convert the bytes to a hex string (or vice versa as required) then use normal string manipulation. This

How to unpack COMP-3 digits using Java?

左心房为你撑大大i 提交于 2019-11-26 18:25:41
问题 I have huge mainframe file and there are some packed digits in that file. I would like to know how to unpack following digit using java? packed digit : ? I read tutorials for unpacking digits and found the following rule to count the number of bytes required to unpack digits : total_number_of_bytes = (no. of digits + 1) / 2 I wrote the following code to unpack digits : public String unpackData(String packedData, int decimalPointLocation) { String unpackedData = ""; char[] characters =