I understand how to parse a workbook using one schema or another, but I'm not sure how to use multiple schemas on 1 workbook, especially when the schema parsing itself doesn't provide the necessary "REDEFINES" location....
I know that the different segments define the data that may be found within the RDT-ADDL-DATA, but there is nothing in the copybook to inform Stingray of that....
Also, using Stingray is it possible to access schema_dict['RDT-ADDL-SEG-KEY'].value since RDT-ADDL-SEG-KEY isn't actually a PICTURE itself?
Would it be inappropriate to define the value of a group to be the concat values of the elements making up the group?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"the different segments define the data that may be found within RDT-ADDL-DATA"
Aha.
That clarifies many things. And that provides a strategic direction to me.
In COBOL, they probably do a simple move from RDT-ADDL-DATA to the appropriate 01 level storage.
A similar effect is available in Python if we pick the source record's bytes apart to create a secondary bunch of bytes for this sub-record or segment as they're calling it.
should build a row-like object bound to the sheet's schema.
But that's not quite it; we also need to build a new kind of Sheet with the right schema based on DDE that applies to that segment. Once we have this segment-specific Sheet, we can build LazyRow objects and the rest of the machinery should work correctly.
This can map a field, GENERIC-FIELD, to an 01-level schema, self.segment_abc.
We can then pick fields out of subrow using fields defined in self.segment_abc.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I understand how to parse a workbook using one schema or another, but I'm not sure how to use multiple schemas on 1 workbook, especially when the schema parsing itself doesn't provide the necessary "REDEFINES" location....
I know that the different segments define the data that may be found within the
RDT-ADDL-DATA, but there is nothing in the copybook to inform Stingray of that....Also, using Stingray is it possible to access
schema_dict['RDT-ADDL-SEG-KEY'].valuesinceRDT-ADDL-SEG-KEYisn't actually a PICTURE itself?Would it be inappropriate to define the value of a group to be the concat values of the elements making up the group?
"the different segments define the data that may be found within RDT-ADDL-DATA"
Aha.
That clarifies many things. And that provides a strategic direction to me.
In COBOL, they probably do a simple move from
RDT-ADDL-DATAto the appropriate 01 level storage.A similar effect is available in Python if we pick the source record's bytes apart to create a secondary bunch of bytes for this sub-record or segment as they're calling it.
At first blush is seems that something like
should build a row-like object bound to the sheet's schema.
But that's not quite it; we also need to build a new kind of Sheet with the right schema based on DDE that applies to that segment. Once we have this segment-specific Sheet, we can build LazyRow objects and the rest of the machinery should work correctly.
That might be closer to what's required.
Last edit: Steven F. Lott 2014-05-24
Release 4.4.4 may solve this via "subrecord" processing.
See :py:class:
stingray.test.cobol_2.Test_Copybook_13( DDE_Test ).The idea is that we can do
This can map a field,
GENERIC-FIELD, to an 01-level schema,self.segment_abc.We can then pick fields out of
subrowusing fields defined inself.segment_abc.