Questions tagged [copybook]

Questions about library text as used in COBOL. This text is often used to define the structure and format of the data for records in a file. When the copybook is used as a source for a tool for data conversion, use a tag for the tool, if available; otherwise, use the 'cobol' tag and identify the tool by name. For other questions about the use or content of a copybook use the 'cobol' tag.

52 questions
1
vote
1 answer

packed decimal to zoned decimal or decimal conversion python

I need to write code in python which will convert packed decimal data to zoned decimal or decimal data.If anybody already have written function for it please help me with it. Thanks in Advance.
user3118158
  • 93
  • 2
  • 7
1
vote
1 answer

Java mapping for cobol display and unpacked numeric fields

I am confused about 9(display format) and S9 (unpacked numeric) type. I was reading copybook output from DB2 stored procedure using Java * copy book 05 ABC PIC X(01). 05 XYZ PIC +9(09). Using the below Java code I was able to read the values…
Sridhar
  • 1,832
  • 3
  • 23
  • 44
1
vote
0 answers

jrecordbind - XSD for mainframe packed decimals

I started using jrecordbind to convert COBOL data to Java using a copybook. I saw the basic example here. Noticed, xs:float is used for floating point values. Some of my COBOL output fields are in COMP-3 and some are in COMP packed decimals. How…
Sridhar
  • 1,832
  • 3
  • 23
  • 44
1
vote
1 answer

Convert Excel into Variable Length Data File based on CopyBook Format with Java

I am trying to convert excel to COBOL data file which has variable length format. I am able to convert excel into tab formatted text file. This data file involves around 400 fields. Instead of trying to set the block length for each block of data, I…
SamK
  • 377
  • 9
  • 27
1
vote
0 answers

Error converting data in MFL

I have a MFL in OSB that converts data received from mainframe system to XML . Till recently it was working fine . But recently mainframe system started sending some data which in OSB is seen like this…
user1496397
  • 21
  • 1
  • 4
1
vote
2 answers

COBOL store file with multiple record types

The goal of this exercise is to read and store an input file into a table then validate certain fields within the input and output any error records. The input file that needs to be stored is 285 records. The problem is that each record is…
Meg
  • 91
  • 2
  • 12
1
vote
2 answers

Do you know a way to convert CopyBook to XSD in Java?

I'm trying to do it quickly with java - get CopyBook file, and generate xsd from this CopyBook. (I know there are some open source projects to create xml from cb, but unfortunately, thay generate xml with items and lot of tags and attributes, and…
Erez
  • 51
  • 1
  • 5
0
votes
1 answer

schema to copybook mapping - number

I have a mapping from xml schema(number) to copybook, copybook field is a number PIC S9(03). If my input xml element is 67, it is getting transformed to 06G. If the input is 65, getting transformed to 06E, in copybook. 14 to 01D, 15 to 01E. -14 to…
Suresh
  • 1,081
  • 4
  • 21
  • 44
0
votes
1 answer

Reading/parsing a copybook in text format using JRecord, the builder seems to think it's an XML file

I'm trying to read,parse a copybook in .txt format using JRecord and then process a binary file using the copybook schema. When I try to read the binary file using schemaBuilder.newReader(binaryFile), it gives me an exception saying…
Mathamagic
  • 97
  • 9
0
votes
0 answers

Installation of [copybook] failed

I am trying to use the python module copybook in my conda environment. However, I keep getting the PackagesNotFoundError. I have also downloaded the package from github, but had no luck installing that. Would you have any recommendations? I tried…
0
votes
1 answer

PowerShell: Code to extract data length and precision from Cobol Copybooks

=== Problem Statement === Code to extract data length in digits (not in bytes) and precision from Cobol Copybooks considering all the different data types for PIC format Will this code be sufficient to handle all cases of PIC data ? Please let me…
0
votes
1 answer

DFHJS2LS - generating Json structure from cobol copybook

I have my output structure in COBOL - from which I try to generate to a JSON structure through DFHJS2LS - IBM tools. All the fields change to be required - this giving trouble when generating classes in .Net as all the fields are not…
Remy Fale
  • 3
  • 4
0
votes
2 answers

cobol : how to use a copy on linux?

I would like to know how to use a COPY statement. I am on Linux and I use GnuCOBOL with Visual Studio. I have already tried several things but nothing works... Here is my code: identification division. environment division. data division. …
0
votes
0 answers

How to resolve these python copybook parser errors

I have just tried the copybook parser from this site on a windows laptop with Python 3.7. The error messages are: Traceback (most recent call last): File "test3.py", line 3, in root = copybook.parse_file(filename) File…
0
votes
1 answer

How to decode Signed Display field in Cobol response to BigDecimal in Java

I'm using the CopyBook4Java library where I can find decoding options that are not completely resolving my case with mainframe signed display field to BigDecimal type variable. Below you can see my test: assertEquals(new BigDecimal("0.00"),…
Epredator
  • 109
  • 3
  • 8