Menu

#25 Doing EBCIDIC to ASCII Conversion on the fly

v1.0_(example)
open
None
1
2018-09-04
2018-09-02
Mandy P
No

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.

Related

Bugs: #25

Discussion

  • Mandy P

    Mandy P - 2018-09-02

    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 ?
    ^

     
  • Mandy P

    Mandy P - 2018-09-03

    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
  • Mandy P

    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

     
  • Mandy P

    Mandy P - 2018-09-03

    ebcidic file is fro US IBM mainframe 37 ,

    ReportEditor shows
    NULLIF_SVF-NXT-DTE as -1
    SVF-NXT-DTE blank

     
  • Bruce Martin

    Bruce Martin - 2018-09-03

    Have a look at XmplLineIOE.java (sourceforge.net)

    in particular

                while ((line = reader.read()) != null) {
                    for (AbstractFieldValue v : line.getFieldIterator(0)) {
                        System.out.println(v.getFieldDetail().getName()
    
                                + "\t\t" + v.getTypeName()
                                + "\t\t" + v.asString());
                    }
    
                    System.out.println();
                }
    
    • 10 NULLIF_SVF-SBS-PCT PIC 9 USAGE COMP. ---> shows -1 but it should be 255`- is it an issue in the latest version; could be coded for
    • SVF-SBS-PCT PIC S9(4)V9(5) USAGE COMP-3 - use isNumeric() isSpaces() tests on the fieldvalue
     

    Last edit: Bruce Martin 2018-09-03
  • Bruce Martin

    Bruce Martin - 2018-09-04

    You coud also define the output record with JRecord with:

    • Cobol copybook (just use the same field names)
    • Xml-Schema (just use the same field names)
    • Java code
     

Anonymous
Anonymous

Add attachments
Cancel