Doing EBCIDIC to ASCII Conversion on the fly
Read Cobol data files in Java
Status: Beta
Brought to you by:
bruce_a_martin
Is there any sample code to do EBCIDIC to ASCII coversion on the fly i.e give Cobol copybook , EBCIDIC file , output fileame as input parameters and it generates the output ASCII file
The idea is too run it as a background job.
RecordEditor gives an option to generate code but that is specific for that particular CopyBook and corresponding java schema code also gets generated which needs to be compiled individually.
Anonymous
Tried using XmplLineIO2 .
showed XmplLineIO2.java:48: error: package net.sf.JRecord.zTest.Common does not exist
import net.sf.JRecord.zTest.Common.TstConstants;
I have cb2xml.jar , Cobol2Xml.jar in the classpath , something I am missing ?
^
net.sf.JRecord.zTest.Common is in the JRecord source but not the jar. It references Cobol copybooks/data files and used in the automated testing / example programs.
You could look at:
For generic processing, the 2 main options are
getCobolItems() on RecordDetail gives you a Cobol view of the data. PrintInCobolTree uses it
Downloaded JRecord documentation (/JRecord_0.90_ReleaseCandidate7/lib/Overview.html#Csv2Cbl) makes a mention of Cobol2Csv.jar being present in Examples directory but not able to find them , is this present elsewhere ?
From: Bruce Martin bruce_a_martin@users.sourceforge.net
Sent: Sunday, September 2, 2018 11:53 PM
To: [jrecord:bugs]
Subject: [jrecord:bugs] #25 Doing EBCIDIC to ASCII Conversion on the fly
net.sf.JRecord.zTest.Common is in the JRecord source but not the jar. It references Cobol copybooks/data files and used in the automated testing / example programs.
You could look at:
For generic processing, the 2 main options are
*
[bugs:#25]https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsourceforge.net%2Fp%2Fjrecord%2Fbugs%2F25%2F&data=02%7C01%7C%7Cc802d038ec8449e0208508d6112f52b7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636715292276726745&sdata=wWuolkxJDdMax7KP6VpYvVww8%2BjmUL3k9Gqek9k62hA%3D&reserved=0 Doing EBCIDIC to ASCII Conversion on the fly
Status: open
Group: v1.0_(example)
Created: Sun Sep 02, 2018 02:19 PM UTC by Mandy P
Last Updated: Sun Sep 02, 2018 03:49 PM UTC
Owner: Bruce Martin
Is there any sample code to do EBCIDIC to ASCII coversion on the fly i.e give Cobol copybook , EBCIDIC file , output fileame as input parameters and it generates the output ASCII file
The idea is too run it as a background job.
RecordEditor gives an option to generate code but that is specific for that particular CopyBook and corresponding java schema code also gets generated which needs to be compiled individually.
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/jrecord/bugs/25/https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsourceforge.net%2Fp%2Fjrecord%2Fbugs%2F25%2F&data=02%7C01%7C%7Cc802d038ec8449e0208508d6112f52b7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636715292276726745&sdata=wWuolkxJDdMax7KP6VpYvVww8%2BjmUL3k9Gqek9k62hA%3D&reserved=0
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsourceforge.net%2Fauth%2Fsubscriptions%2F&data=02%7C01%7C%7Cc802d038ec8449e0208508d6112f52b7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636715292276726745&sdata=99iHwk6M6G2uxlUroe%2FfXg9C%2B0Hz%2BeavG%2BhlMZTMf3g%3D&reserved=0
Related
Bugs: #25
There is a seperate Cobol2Csv project
It is written using JRecord 0.81.4; not much would of changed.
Alternatively it is in subversion (or Github via subversion clone)
trying out CobolToCsv/Version_0.81.4
these are the parameters i pass to ReportWriter that gives a reasonable outpit viz.
split copybook = No split
Font cp037
dialect - GNU Cobol little Endian (intel)
File structure - Fixed length binary
System -Ams
putting the same as a batch file as below introduces a tab between each field how to eliminate that
java -jar ../lib/Cobol2Csv.jar -I In/0.NONFIN -O Out/0.NONFIN.txt -C tgen534.cbl -IC CP037 -D tab -OFS Text -Dialect 4 -CsvParser 0
Last edit: Mandy P 2018-09-03
java -jar ../lib/Cobol2Csv.jar -I In/ebcdic.NONFIN -O Out/ebcdic.NONFIN.txt -C 540lay.cbl -IC CP037 -D tab -OFS Text -Dialect 4 -CsvParser 0
I am running the above but output not on expected lines eg.
10 NULLIF_SVF-SBS-PCT PIC 9 USAGE COMP. ---> shows -1 but it should be 255
10 SVF-SBS-PCT PIC S9(4)V9(5) USAGE COMP-3. ---> shows 40404.04040 but should be 0000.00000
have attached the files
ebcidic file is fro US IBM mainframe 37 ,
ReportEditor shows
NULLIF_SVF-NXT-DTE as -1
SVF-NXT-DTE blank
Have a look at XmplLineIOE.java (sourceforge.net)
in particular
Last edit: Bruce Martin 2018-09-03
You coud also define the output record with JRecord with: