I want to use the record selection feature to filter only the records I want to read. Also, I want to separately group the columns based on the record. I see some code example of Record Selector / setRecordSelection which shows how to set but I dont see an example of how to use it.
Also, I have a complex record selection rule, like below. I would like to know how to define this and how to retrieve only the records I need. Thanks
if RDT-REC-CODE-KEY "D" or reject the record
if RDT-REC-TYPE-CONTROL = "", "A","B","E","F","N","S" then REPORT-TAPE-DETAIL-RECORD
if RDT-REC-TYPE-CONTROL = "C","T","X" then RDT-RECORD-TYPE-DCX
if RDT-REC-TYPE-CONTROL = "P" then RDT-RECORD-TYPE-DP
if RDT-REC-TYPE-CONTROL = "R" then RDT-RECORD-TYPE-DR
if RDT-REC-TYPE-CONTROL = "S" RDT-DS-RECORD-TYPE-MULTRAN
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The way to get the record-type is via the getPreferredLayoutIdx (I should change it to get...RecordIndex ???). i.e
intrecordIndex=line.getPreferredLayoutIdx()
There is 3 ways decide on the record Type:
Hard-Coded in the java code (see AmsPoDownload02.java ). JRecord you does not need to know the RecordType. You can decide what the record is after it has been read.
Using the RecordDecider interface - its a java interface for determining the RecordType
Using RecordSelection option, use IoBuilder.setRecordSelection(...). This Option has its origin in saving FileDescriptions as Xml. See .setRecordSelection in TstMultiCopybookDef.java
I want to use the record selection feature to filter only the records I want to read. Also, I want to separately group the columns based on the record. I see some code example of Record Selector / setRecordSelection which shows how to set but I dont see an example of how to use it.
Also, I have a complex record selection rule, like below. I would like to know how to define this and how to retrieve only the records I need. Thanks
if RDT-REC-CODE-KEY "D" or reject the record
if RDT-REC-TYPE-CONTROL = "", "A","B","E","F","N","S" then REPORT-TAPE-DETAIL-RECORD
if RDT-REC-TYPE-CONTROL = "C","T","X" then RDT-RECORD-TYPE-DCX
if RDT-REC-TYPE-CONTROL = "P" then RDT-RECORD-TYPE-DP
if RDT-REC-TYPE-CONTROL = "R" then RDT-RECORD-TYPE-DR
if RDT-REC-TYPE-CONTROL = "S" RDT-DS-RECORD-TYPE-MULTRAN
The way to get the record-type is via the getPreferredLayoutIdx (I should change it to get...RecordIndex ???). i.e
There is 3 ways decide on the record Type:
I will try and write a Wiki entry
Anyway AmsPoDownload01.java:
Last edit: Bruce Martin 2018-10-18
With regards RecordSelection, I do not have any good examples beyond the java do,. You can use And / Or classes to do multiple tests i.e.
for
you would code