cobrix icon indicating copy to clipboard operation
cobrix copied to clipboard

Does Cobrix handle the Easytrieve layout ?

Open henryc12990 opened this issue 2 years ago • 3 comments

Background

I am having the Easytrive layout which is having the Packed unsigned fields (data-type U in Easytrieve), binary unsigned fields (data-type B in Easytrieve) and Alpha-numeric fields (data-type A in Easytrieve and storing Hexbit). The Data file that we are trying to convert is EBCDIC data

Question

We were using cobrix for couple of files which it worked fine till now. Recently encountered one new file of Easytrieve layout which is not cobol and we are not able to decode the file into ascii.

We are using below options/parameters to read the file.

def read_dataframe(spark, copybook):     return (         spark.read.format("cobol")         .option("record_format","F")         .option("encoding", "ebcdic")         .option("copybook", copybook) #Copybook         .option("enable_indexes", "false")         .option("input_split_size_mb", "256")         .option("drop_value_fillers", "true")         .option("drop_group_fillers", "false")         .option("generate_record_id", "false")         .option("schema_retention_policy", "keep_original")         .option("paths", ",".join(data_files)) #EBCIDIC File         .load()     )

Please find the attached sample data and layout for your reference @yruslan .

henryc12990 avatar May 08 '23 15:05 henryc12990

Looks like your copybook does not match the data sample. The first 20 bytes should have DISPLAY type, but the data does not have 20 consecutive bytes of DISPLAY data. The maximum DISPLAY byte sequence length is 17 in the sample file.

Screenshot 2023-05-09 at 8 43 15

yruslan avatar May 09 '23 06:05 yruslan

@yruslan . Could you please check with attached copybook.

henryc12990 avatar May 09 '23 07:05 henryc12990

Same issue

yruslan avatar May 09 '23 07:05 yruslan