aws-samples / mainframe-data-utilities

Python scripts to convert and unpack mainframe EBCDIC data on the cloud or any ASCII environment.
Apache License 2.0
36 stars 12 forks source link

Copy Book reading issue. #7

Closed anilcert closed 2 years ago

anilcert commented 2 years ago

We are getting an error while running the copybook to json python script.Attached the copybook and error files.Please take a look thank you Error.txt syndisp.zip

luisdant commented 2 years ago

Hi Anil,

It seems to be VB file, which is not supported. But anyways I'll fix this weird parsing error.

luisdant commented 2 years ago

Hi Anil,

I found that the error happens because the copybook is shifted to the left (it's starting on column 1 and it should be starting at 7) and there is also a blank line within it. I'll create a fix to validate this and make it clearer.

Anyways, OCCURS DEPENDING ON and VB aren't supported yet. I'm also documenting this on readme to make it clearer.

Regards

anilcert commented 2 years ago

Are you planning to add the OCCURS DEPENDING ON < column> in the utility soon? Please let me know.

luisdant commented 2 years ago

I've changed the current version (pushed to git yesterday) and the copybook above (SYNDISP) is already being interpreted.

Let me know if you have data that could be used to test the encoding conversion.

anilcert commented 2 years ago

Thank you Luis. Is this version take care of files having OCCURS DEPENDING ON in it ? I have a very big file to test, in my server and we already requested a small sample masked file to TEST with, and waiting.

luisdant commented 2 years ago

Yes, the current version of the parser is already handling SYNDISP and probably other copybooks with similar characteristics.

I haven't tested the converter yet as I don't have test data.

Attention: VB is still not supported. If the data file is VB it must be converted to FB considering the largest LRECL that this copybook can assume.

I believe this file's record length is 1171 (without the RDW).

anilcert commented 2 years ago

I parsed the SYNDISP copybook with the new version of python code. The EBCDIC to ASCII conversion program worked correctly but didn't gave a proper output.

anilcert commented 2 years ago

After the fix we are able to convert the copybook to json which has an option to parse the copybook having OCCURS DEPENDING ON.

Thank you