You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rdw header missing for variable size ebcdic file #772
I do not have rdw headers ,when it is single copybook it works with variable size true .but with multiple copybooks in used copybooks as well as combined all 4 into single copybook using redefines. Both r giving arrayindexouf of bounds exception as it might not be getting record length correctly for ebcdic file. It is working fine for txt file. I have each record starting with 01ABC1 , 01ABC2, 01ABC3, 01ABC4 which is the record id for 1st , 2nd and so on . How do I tackle this ?
Hi @sobhaw , please share options you pass to 'spark-cobol', and the copybook, if possible. Array index out of bounds error should not be happening in any circumstance.
I used the options like variable_size_occurs schema retention keep original and removed the ascii option and tried to read a binary file the copy had last part as array so once it can't determine the length after reading the first record it gives this issue
I do not have rdw headers ,when it is single copybook it works with variable size true .but with multiple copybooks in used copybooks as well as combined all 4 into single copybook using redefines. Both r giving arrayindexouf of bounds exception as it might not be getting record length correctly for ebcdic file. It is working fine for txt file. I have each record starting with 01ABC1 , 01ABC2, 01ABC3, 01ABC4 which is the record id for 1st , 2nd and so on . How do I tackle this ?
I used the options like variable_size_occurs schema retention keep original and removed the ascii option and tried to read a binary file the copy had last part as array so once it can't determine the length after reading the first record it gives this issue
There are multiple ways to read variable record length file depending on the way to determine the length of each record. From your description looks like record lengths can be derived from record types. If so, you can use the mapping option:
I cannot send anything outside of my org. So just typing it.
file_start _offset 274, file_end _offset 303
Copybooks , copybooks paths
Variablesize true also checked with recordformat f
Generate record id true
After ur suggestion put a recordlength map 01ABC1 etc
Activity
yruslan commentedon Aug 15, 2025
Hi @sobhaw , please share options you pass to 'spark-cobol', and the copybook, if possible.
Array index out of boundserror should not be happening in any circumstance.sobhaw commentedon Aug 19, 2025
I used the options like variable_size_occurs schema retention keep original and removed the ascii option and tried to read a binary file the copy had last part as array so once it can't determine the length after reading the first record it gives this issue
sobhaw commentedon Aug 19, 2025
Not closed i closed it
sobhaw commentedon Aug 19, 2025
I do not have rdw headers ,when it is single copybook it works with variable size true .but with multiple copybooks in used copybooks as well as combined all 4 into single copybook using redefines. Both r giving arrayindexouf of bounds exception as it might not be getting record length correctly for ebcdic file. It is working fine for txt file. I have each record starting with 01ABC1 , 01ABC2, 01ABC3, 01ABC4 which is the record id for 1st , 2nd and so on . How do I tackle this ?
sobhaw commentedon Aug 19, 2025
I used the options like variable_size_occurs schema retention keep original and removed the ascii option and tried to read a binary file the copy had last part as array so once it can't determine the length after reading the first record it gives this issue
yruslan commentedon Aug 19, 2025
There are multiple ways to read variable record length file depending on the way to determine the length of each record. From your description looks like record lengths can be derived from record types. If so, you can use the mapping option:
where
FIELD_STRis the field that determines the record type. When it equals toSEG1the record length is 100, and so on.Here are details: https://github.com/AbsaOSS/cobrix?tab=readme-ov-file#variable-length-records-support
sobhaw commentedon Aug 19, 2025
Ok thx for the solution let me try that. I suppose 100 and 200 will change according to the copybook
sobhaw commentedon Aug 20, 2025
I tried with 01ABC for record field length it didn't accept a string unsupported function ABC expr syntax error
sobhaw commentedon Aug 20, 2025
I tried giving the field name also from the copybook
yruslan commentedon Sep 5, 2025
Please, send all options you are passing to spark-cobol.
sobhaw commentedon Sep 19, 2025
I cannot send anything outside of my org. So just typing it.
file_start _offset 274, file_end _offset 303
Copybooks , copybooks paths
Variablesize true also checked with recordformat f
Generate record id true
After ur suggestion put a recordlength map 01ABC1 etc