[CMS-PIPELINES] Updating a field in a STRUCTURE
I have an application that defines a data structure using the STRUCTURE stage. I can define the structure and read the values of individual members without difficulty – there’s a nice example of how to do it in the docs. What I’m trying to do is reference a field of the structure for update with new data. I understand that using PICK with the MEMBER operand lets me filter the records down to the one I want, but nothing seems to let me update the value. Questions: 1. Is this possible? It would seem to be something that would fit in SPECS, but I can’t find any obvious keyword or combination of keywords that would allow me to specify the structure.field name as an output target. 2. If not, would keeping a reference list of the field names and column ranges be the most straightforward approach? I think I can construct the SPECS magic I need, but if there’s a better way, please enlighten me. I’m targeting the last runtime library version and the 7.1 version of pipes. All advice gladly accepted.
Re: [CMS-PIPELINES] Updating a field in a STRUCTURE
pipe spec 1 m abc PIPQUA1395E Unqualified member name: abc. So you should be able to specify the member name as the output, but you must specify the keyword, "Member". On 1/22/20 16:14, David Boyes wrote: I have an application that defines a data structure using the STRUCTURE stage. I can define the structure and read the values of individual members without difficulty – there’s a nice example of how to do it in the docs. What I’m trying to do is reference a field of the structure for update with new data. I understand that using PICK with the MEMBER operand lets me filter the records down to the one I want, but nothing seems to let me update the value. Questions: 1. Is this possible? It would seem to be something that would fit in SPECS, but I can’t find any obvious keyword or combination of keywords that would allow me to specify the structure.field name as an output target. 2. If not, would keeping a reference list of the field names and column ranges be the most straightforward approach? I think I can construct the SPECS magic I need, but if there’s a better way, please enlighten me. I’m targeting the last runtime library version and the 7.1 version of pipes. All advice gladly accepted.
Re: [CMS-PIPELINES] Updating a field in a STRUCTURE
On Wed, 22 Jan 2020 at 16:22, David Boyes wrote: > I have an application that defines a data structure using the STRUCTURE > stage. I can define the structure and read the values of individual members > without difficulty – there’s a nice example of how to do it in the docs. > What I’m trying to do is reference a field of the structure for update with > new data. I understand that using PICK with the MEMBER operand lets me > filter the records down to the one I want, but nothing seems to let me > update the value. > There is no provision to change the structure once it is defined. If you change your mind on what the layout of the record is (possibly based on fields you've seen) you would use a different structure to map that new content. You can also make overlays if that makes more sense. You could have a selection stage split between different type of records and use the corresponding structure downstream. You can also map just the variant portion at some column in the record. But these definitions are all done before records flow through the SPEC or PICK stage. If the change of mind happens in a separate stage, you can define that new structure with the same name as local structure. The STRUCTURE LIST produces the layout as STRUCTURE understood it. I would imagine any non-trivial structure to be defined by some external layout transformed into STRUCTURE format. You could use the LIST output to verify your transformation process. Rob
Re: [CMS-PIPELINES] Updating a field in a STRUCTURE
I’m not trying to change the structure definition, I’m trying to fill in one of the fields I’ve already defined, similar to moving data into 02 items defined within a 01 record in COBOL. I think John’s idea will do what I want. If it does, I’ll do a RCF for chapter 6 of the combined PIPE doc that comes with 7.1. Tnx.
Re: [CMS-PIPELINES] Updating a field in a STRUCTURE
In the Author's Edition on Marist, please refer to p. 708 (physical 736) for the "Output Placement" track. You will see the Member as the penultimate choice in the first selection. I'd be rather surprised if the 7.x doc hasn't got it. On 1/22/20 18:27, David Boyes wrote: I’m not trying to change the structure definition, I’m trying to fill in one of the fields I’ve already defined, similar to moving data into 02 items defined within a 01 record in COBOL. I think John’s idea will do what I want. If it does, I’ll do a RCF for chapter 6 of the combined PIPE doc that comes with 7.1. Tnx.
Re: [CMS-PIPELINES] Updating a field in a STRUCTURE
The RCF I was planning to write was a suggestion for heading “Referencing Fields in a Structure” in chapter 6. An example of updating the value of a field would be helpful (that’s where reading the current value is discussed).
Re: [CMS-PIPELINES] Updating a field in a STRUCTURE
On Wed, 22 Jan 2020 at 20:44, David Boyes wrote: > The RCF I was planning to write was a suggestion for heading “Referencing > Fields in a Structure” in chapter 6. An example of updating the value of a > field would be helpful (that’s where reading the current value is > discussed). But it’s not really about updating. You’re creating a new record and writing the members in that. Sure, you can overwrite a member with something else. I would use updating for a read-modify-write cycle. Either way, it’s good when people read the book, and I’m looking forward to your comments and suggestions. Rob >