-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Data read error: Downloads\COMP.DETAILS.SEP30.DATA.dat that are NOT DIVISIBLE by the RECORD SIZE calculated from the copybook
I am new to Cobrix and trying to explore for my use case: Read Mainframe data using copy book
Question
I am trying to use the data file and copy that presents in this repo.
examples/example_data/companies_data ------------ as the data file
examples/example_data/companies_copybook.cpy --- as the copy book
I am using spark 3.5.8 and using local machine.
Here is my code that I am trying:
spark = get_spark_session()
# Parse the file using Cobrix
df = spark.read.format("cobol") \
.option("copybook", copybook_path) \
.option("is_record_sequence", "true") \
.option("is_rdw_big_endian", "true") \
.option("debug", "true") \
.load(datafile_path)
# Show the Schema
st.subheader("Parsed Copybook Schema:")
# We extract the schema as a readable tree-like list
schema_fields = [f"{field.name} ({field.dataType.simpleString()})" for field in df.schema.fields]
st.write(schema_fields)
# Show the Data
st.subheader(f"Data Preview (First {num_rows} records):")
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested