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.

44 questions
22
votes
8 answers

Reading COBOL datastructures from Java

Is there a way to read COBOL data in a Java program? More concretely I'm confronted with the following case: I have a file with fixed length records of data. The data definition is done as COBOL copybooks. I think of a library which is taking into…
paweloque
  • 17,185
  • 25
  • 75
  • 131
5
votes
2 answers

COBOL Copybook Specifications for a C# programmer

I am working on an application that requires me to produce a COBOL copybook to define a data file. Does anyone have a good reference on how to write out a copybook?
Jeremy
  • 6,312
  • 2
  • 22
  • 32
5
votes
5 answers

Convert Cobol copybook to XSD

Does anyone know a tool to convert from Cobol Copybook to XSD? Or XML.
lemotdit
  • 428
  • 1
  • 9
  • 21
3
votes
2 answers

Why does loading Cobol Copybook file fail with "ClassNotFoundException: java.time.temporal.TemporalAccessor"?

I have following spark program which i am trying to run the purpose of it is to convert copybok file into Parquet file.(Program link of Cobrix https://github.com/AbsaOSS/cobrix) in this i am just trying to run a file called…
3
votes
2 answers

Put decimal point in right position while parsing data by cobol descriptor

I am trying to parsing data from txt file by cobol descriptor in java. There is something wrong when I use this method: Record net.sf.cb2java.copybook.Copybook.parseData(byte[] arg0). In cobol descriptor, there is a line: 20 ACCD-LONG-SECONDS …
WangMango
  • 35
  • 5
2
votes
1 answer

cobol to xml schema - WTX Tool

We are doing xml to copybook and vice versa conversions in a middleware system, using IBM Websphere transformation extender. From this link Cobol to xsd mapping , we realised that PIC X(03), in copybook, has to be converted to the below xml…
Suresh
  • 1,039
  • 4
  • 21
  • 44
2
votes
0 answers

How to create a mule 4.3 copy book of flat file for complex data structure?

Need to read a fixed length file and transform it into a java object. Can anyone help to create a mule 4.3 copy book for below data structure transformation? Header headerValue2headerValue3headerValue4headerValue5 T_Level1…
2
votes
1 answer

COBOL copybook blank fields

Simple question that I cannot find an answer to through web-searching. Is it valid to have a field in a COBOL copybook without a name? i.e. is the following valid? 05 SUMMARY. 07 DETAILS OCCURS 3 TIMES PIC X(10). …
Morag Hughson
  • 6,241
  • 14
  • 40
2
votes
1 answer

How do you edit a Binary Mainframe file in the RecordEditor using a Cobol Copybook (pt1)

How do you edit a Single-Record-type Binary Mainframe file in the RecordEditor using Cobol Copybook on a Windows or Linux PC. Note: This is an attempt to split a very broad question into a series of simpler Question and Answers.
Bruce Martin
  • 9,845
  • 1
  • 24
  • 36
2
votes
1 answer

Expanding COBOL copybook based on OCCURS clause using java

I am writing a java program in which I have to expand a COBOL copybook if it contains OCCURS clause. The number next to OCCURS keyword defines repetition of lines child to the OCCURS clause. First number of line defines level. There may be more than…
Madhusudan
  • 4,017
  • 10
  • 45
  • 81
2
votes
2 answers

How to repeat a block of lines using awk?

I'm trying to repeat the block of lines avobe the OCCURS word the number of times inticated in the line. The block of lines to repeat have a smaller number at the start of the line. I mean, with this input: 01 PATIENT-TREATMENTS. 05 …
harrison4
  • 6,152
  • 15
  • 49
  • 81
2
votes
5 answers

Copybook field start-positions

Does anyone have a quick method for finding a COBOL copybook start-positions for fields? For example: 000100 01 BGG-FILE-REC. 000200 03 BGG-RCD-KEY. …
noogrub
  • 862
  • 2
  • 12
  • 20
1
vote
2 answers

How to read VSAM file in Python3

I have VSAM file in the unix system. I want to read the file using the layout of that file in the python. Out of the .idx and .dta, I copied .dta to my local machine and tried to read using the below code, infile =…
Nilesh
  • 51
  • 9
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
  • 1
  • 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,572
  • 1
  • 18
  • 38
1
2 3