I have found what I feel is a simple but better alternative to the first page indicator 1P. The problem with using 1P is that program-supplied information will not show up on the first page of the report. The solution I have used in the past is what seems to be the common method. (See 5.)
I have found what I feel is a simple but better alternative to the first page indicator 1P. The problem with using 1P is that program-supplied information will not show up on the first page of the report. The solution I have used in the past is what seems to be the common method. (See Figure 5.)
This method works fine but requires an indicator and the additional SETOF at the beginning of each detail cycle.
What works better is a slight modification of the above. Instead of the SETON 81, use SETON OF and use only the overflow indicator on the output specs. (See 6.)
What works better is a slight modification of the above. Instead of the SETON 81, use SETON OF and use only the overflow indicator on the output specs. (See Figure 6.)
This works, since H and D output is done at the same time, causing the headings to be the first thing printed on the first detail cycle. This method requires no additional indicator and saves the SETOF that would occur on each cycle, a small benefit of this method but one which requires no effort.
This method also works well if your report is done with exception output. The heading will be printed on the first detail cycle, and by using a FETCH on the Exception line, overflow will be taken care of. (See 7.)
This method also works well if your report is done with exception output. The heading will be printed on the first detail cycle, and by using a FETCH on the Exception line, overflow will be taken care of. (See Figure 7.)
There may be some types of reporting that are too complicated for this method. But it seems to work fine for most reporting requirements. I can't remember the last time that I used 1P or SETON/SETOF method.
Mike Sopotnick Leesburg, Florida
TechTalk: RPG 1P Indicator Alternative
Figure 5 Conventional first-page processing
Figure 5: Conventional First-Page Processing 6...1....+....2....+....3....+....4....+....5....+....6....+....7 C SETOF 81 C HHMMSS IFEQ *ZERO C TIME HHMMSS 60 C . C first cycle processing C . C SETON 81 C END OREPORT H 106 81 O OR OF O Heading output 6...1....+....2....+....3....+....4....+....5....+....6....+....7
TechTalk: RPG 1P Indicator Alternative
Figure 6 Alternative first-page processing
Figure 6: Alternative to Conventional First-Page Processing 6...1....+....2....+....3....+....4....+....5....+....6....+....7 C HHMMSS IFEQ *ZERO C TIME HHMMSS 60 C . C first cycle processing C . C SETON OF C END OREPORT H 106 OF O Heading output O DF 1 01 O Detail output 6...1....+....2....+....3....+....4....+....5....+....6....+....7
TechTalk: RPG 1P Indicator Alternative
Figure 7 Using alternative with exception output
Figure 7: Using Alternative First-Page Method with Exception Output 6...1....+....2....+....3....+....4....+....5....+....6....+....7 OREPORT EF 1 DETAIL O Detail exception output
LATEST COMMENTS
MC Press Online