I have a sub procedure that I want to define a file within a sub procedure and then chain to that file and populate an external data structure based on the file being chained to. My preference, if possible, is to prefix the fields in the externally defined data structure.
DCL-DS dsPrdmstl1 Extname('PRDMSTL1') END-DS;
Chain prmPrdno Prdmstl1 dsPrdmstl1;
I get the following syntax error
How can I populate a data structure with the fields prefixed in a chain operation in a subprocedure
DCL-DS dsPrdmstl1 Extname('PRDMSTL1') END-DS;
Chain prmPrdno Prdmstl1 dsPrdmstl1;
I get the following syntax error
RNF7595
The result data structure does not include a subfield in position 1 for a record format.
20
Cause . . . . . : A result data structure is specified for an input operation by file name but does not contain a subfield data structure for at least one of the record formats in that file. The data structure is ignored.
Recovery . . . : For an input operation by file name, the result data structure must contain one subfields data structure corresponding to each record format in the file. These subfield data structures must be defined using LIKEREC or LIKEDS such that the definition of the subfields is based on the fields in the input record. In addition, each subfield data structure must be at the beginning of the result data structure. Compile again.
The result data structure does not include a subfield in position 1 for a record format.
20
Cause . . . . . : A result data structure is specified for an input operation by file name but does not contain a subfield data structure for at least one of the record formats in that file. The data structure is ignored.
Recovery . . . : For an input operation by file name, the result data structure must contain one subfields data structure corresponding to each record format in the file. These subfield data structures must be defined using LIKEREC or LIKEDS such that the definition of the subfields is based on the fields in the input record. In addition, each subfield data structure must be at the beginning of the result data structure. Compile again.
Comment