Visual RPG Language Reference  

Matching Record Indicator (*INMR)

To support the RPG cycle in Monarch migrated applications, the Visual RPG compiler has predefined the matching record indicator *INMR.  This matching record indicator will be migrated as such, and does not need to be explicity declared. 

Remarks

Statements are in a file are conditioned on the following:
1.  The kind of record read.
2. The Level Break indicator.
3. The Matching Record indicator.
4. The Printer Overflow indicator.
Matching Record Fields
You can specify up to 9 field(s) that are defined as the 'control' matching field is read from the buffer.  You can specify up to 9 different fields, or levels using DclFmtCycleAttr.   These are defined as M1 .... M9.  When the field is different, a level break occurs, and the defined level indicators are set; thus the calculations totals and output is printed.
When a level indicator gets turned on, then all level indicators underneath that level will turn on also.

The following image shows the Matching Record field as M1 is defined by Item#; OOItem# and DOrder# and BOOrder#.

 

]

 Code Example

BegClass MyCycleProgram Access(*Public)

      ...

      dclDiskFile Order Type(*input) Designation(*primary) ...   
      dclDiskFile Detail Type(*input) Designation(*secondary) ...       
      dclDiskFile BackOrder Type(*input) Designation(*secondary) ...

      dclPrintFile OrderRpt OverflowInd(*INOF) ...

      DclFmtCycleAttr ROrder     *in77 M1(OOrder#)  L2(OOrder#)
      DclFmtCycleAttr RDetail    *in42 M1(DOrder#) 
      DclFmtCycleAttr RBackOrder *in43 M1(BOOrder#) L1(BOOrder#,BOItem#)

      BegCyclePrintAttr

            headingspec rptHeader cond(*in1p *or *inOF) 
            detailspec rptDetail fetchOverflow(*yes) cond(*inL1)
            totalspec rptTotal fetchOverflow(*yes) cond(*inl2) 
      EndCyclePrintAttr \avrlrfDatabaseMembers.htm

      Begsr Main shared(*yes) access(*public) 
            dclsrparm args type(*string) rank(1) 
            dclfld pgm Type(MyCycleProgram) new() 
            pgm.*StartCycle() 
            Close pgm.CustRpt 
            Console.ReadLine() 
      endsr

     

      BegSr *DetailCalc 
            if *inMR 
                  ... 
            endif 
      EndSr

     

      BegSr *TotalCalc 
            if *inL1
                  ... 
            endif 
      EndSr
EndClass 

See Also

Cycle Overview 
DclFmtCycleAttr
Level Break Indicators