Set off all indicators in RPG program
RPG INDICATORS are switches
Just like car indicators (or 'blinkers' as my American cousins call them) they can be switched *ON or *OFF in a program to indicate the state of a certain piece of logic. Using numeric indicators has been frowned upon for years, since the introduction of alphanumeric 'indicators' in programming code. After all, what makes more sense checking a value of *IN66 or checking a value of a field called ItemCodeValid?
Now saying that, older programs some times use numeric indicators extensively and this is just a neat way of turning off blocks of indicators:
// *IN is a standard RPGLE array for *IN(01) thru *in(99) - and it says turn off all from 01 to 99 %SubArr(*IN : 01 : 99) = *Off;
In older column based RPG (or RPG400) you could use the MOVEA (move array command) turn them all off
C MOVEA *ALL:‘0’ *in01
Or specify a smaller block of indicators:
C MOVEA ‘0000’ *in80
would move *zeros to *in80, *in81, *in82, *in83
Lots of other techniques but I like the %subarr solution.