cobrix icon indicating copy to clipboard operation
cobrix copied to clipboard

SYNC support

Open arykov opened this issue 4 years ago • 5 comments

It appears that SYNC clause in copybooks is not supported at the moment. Would be good if they were. 01 LN-HEADER-1 SYNC.

arykov avatar Dec 02 '20 22:12 arykov

Could I ask you to provide an example of a data file that has such a field? Maybe a very small synthetic example. This will speed up the implementation.

yruslan avatar Dec 04 '20 09:12 yruslan

Sorry for being that guy, who asked yet is to lazy to do anything. Trying to find or generate a sample. So far unsuccessfully. At this point I only have a copybook.

arykov avatar Dec 09 '20 15:12 arykov

SYNC Clause : This clause ensures that the item is placed at the next natural boundary, if applicable. The COBOL compiler achieves that by inserting slack bytes before the item.

In mainframe, the address resolution is efficient if the values are located at the word boundaries in the memory. for example, if the memory word size is 4 bytes that means that each word should start from an address divisible by 4.

So ideally, its not required to be fixed in spark since memory alignment is not as strict as mainframe and it does not change any value;

AnshumanDwivedi avatar Sep 30 '21 02:09 AnshumanDwivedi

@yruslan : Could you please suggest ? if Ive missed any point;

AnshumanDwivedi avatar Sep 30 '21 02:09 AnshumanDwivedi

Yes, thanks a lot for the explanation!

Since SYNC fields are not supported yet, can manually insert FILLERS before such fields as a workaround?

Putting this to the TODO list. But still, it would be very nice to have an example, it will speed things up and ensure the implementation is as expected.

yruslan avatar Oct 05 '21 07:10 yruslan