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
24
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
  • 18,466
  • 26
  • 80
  • 136
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,580
  • 2
  • 25
  • 33
5
votes
5 answers

Convert Cobol copybook to XSD

Does anyone know a tool to convert from Cobol Copybook to XSD? Or XML.
lemotdit
  • 448
  • 1
  • 10
  • 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…
Touseef Zaki
  • 59
  • 2
  • 10
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,081
  • 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
  • 7,255
  • 15
  • 44
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
  • 10,358
  • 1
  • 27
  • 38
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,637
  • 12
  • 55
  • 86
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 …
mllamazares
  • 7,876
  • 17
  • 61
  • 89
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
  • 872
  • 2
  • 12
  • 20
1
vote
1 answer

How to process mainframe numbers where "{" is the last character

I have a one mainframe file data like as below 000000720000{ I need to parse the data and load into a hive table like below 72000 the above field is income column and "{" sign which denotes +ve amount datatype used while creating table income…
1
vote
1 answer

MQ Copybook libraries

In which library can we find layout of IBM supplied Mq copybooks(like CMQV, CMQODV) in COBOL. By compilation am able to see the expanded copybooks but would like to know the library.
MCN
  • 83
  • 1
  • 7
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
  • 69
  • 1
  • 11
1
2 3 4