Reputation: 1
I am working to Mainframe to Hadoop migration and have very knowledge in Java. I have a cobol flat file which contains computational fields (COMP, COMP-1, COMP-2). I have to use this file in Java application.
Need help to understand below points:
How to FTP mainframe flat file which has COMP fields. I tried to FTP it but got non readable characters. I tried to FTP in Binary Mode but still its not readable.
How to convert Cobol COMP fields in to JAVA int/long. If you have any sample java snippet. Please share.
I have found java snippet for COMP-3 to Java Long on below link: http://www.coderanch.com/t/411222/java/java/Packed-decimal-conversion-Java
Appreciate you help.
Upvotes: 0
Views: 2262
Reputation: 1333
You can take a look at the parser behind Cobrix. This is an open-source COBOL data source for Spark and it copes with COMP fields.
Upvotes: 1