TechTalk: "Local" Indicators

RPG
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

The January 1986 issue of DataNetwork (now Midrange Computing) included the article, "Indicator Integrity Through Subroutines." The idea was that you can save the current settings of selected or all indicators when calling subroutines that might alter the indicators.

Two techniques were presented in that article, one using bit fields to store the settings (see also the August 1990 issue of Midrange Computing, "Using Bit Fields as Data"), the other using a character array of up to 99 elements to store the settings.

By making use of the RPG/400 predefined *IN array, the technique can be greatly simplified. The RPG/400 Reference (SC09-1089) gives an example of this technique on page 3/36; see 1. The idea here is that all of the numeric indicators, 01 - 99, are mapped into the *IN array. The settings of a contiguous group of indicators can be saved by moving the *IN array to a save field, then restoring the save field into the *IN array. Using the same technique, you can also save all 99 indicators, simply by using a larger save field and applying the MOVEA to the entire *IN array, as in 2.

By making use of the RPG/400 predefined *IN array, the technique can be greatly simplified. The RPG/400 Reference (SC09-1089) gives an example of this technique on page 3/36; see Figure 1. The idea here is that all of the numeric indicators, 01 - 99, are mapped into the *IN array. The settings of a contiguous group of indicators can be saved by moving the *IN array to a save field, then restoring the save field into the *IN array. Using the same technique, you can also save all 99 indicators, simply by using a larger save field and applying the MOVEA to the entire *IN array, as in Figure 2.

This technique can also be used for nested subroutines, if you use a separate save field for each subroutine.

Craig Pelkie San Mateo, California


TechTalk: "Local" Indicators

Figure 1 Saving selected contiguous indicators 61 - 68

 Figure 1: Saving Selected Contiguous Indicators 61 - 68 .30....+...40....+...50....+ MOVEA*IN,61 SAV8 8 EXSR SUB1 MOVEASAV8 *IN,61 
TechTalk: "Local" Indicators

Figure 2 Saving all numeric indicators

 Figure 2: Saving All Numeric Indicators .30....+...40....+...50....+ MOVEA*IN SAV99 99 EXSR SUB1 MOVEASAV99 *IN 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: