TechTalk: Level Breaks on Partial Fields

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

From: Luis Munoz To: All

I'm new to RPG and I am having a problem with level breaks. I need to create a report that breaks on a 12-byte character field but I only want to break on the first two positions of the field. Is this possible? How? The field is from an externally defined file. Thank you for your help.

From: James Coolbaugh To: Luis Munoz

Are you using the cycle for the level breaks or are you doing this yourself in the program?

If you are using the cycle, you might be able to create a field definition in the I-specs for the external file and then put your level indicator on that. I am not sure if that would work but you could give it a try. It would look something like the I-specs in 1. This would create a field over positions 10 and 11 within the database record. Your program will still pull in every field available.

If you are using the cycle, you might be able to create a field definition in the I-specs for the external file and then put your level indicator on that. I am not sure if that would work but you could give it a try. It would look something like the I-specs in Figure 1. This would create a field over positions 10 and 11 within the database record. Your program will still pull in every field available.

If you are performing the tests within your program yourself, you can just move the first two characters to a work field, as shown in 2. You can then perform your tests on this.

If you are performing the tests within your program yourself, you can just move the first two characters to a work field, as shown in Figure 2. You can then perform your tests on this.

From: Pete Hall To: Luis Munoz

You can't put level break indicators on parts of fields unless the file is program described. You can, however, create a logical view of the data, containing a field which is a substring of the physical file field. Then you may use this derived field for your level break, as 3 illustrates.

You can't put level break indicators on parts of fields unless the file is program described. You can, however, create a logical view of the data, containing a field which is a substring of the physical file field. Then you may use this derived field for your level break, as Figure 3 illustrates.

You would just use NEWFLD as your level break. You would still use the data in FIELD2.


TechTalk: Level Breaks on Partial Fields

Figure 1 Defining control breaks

 Figure 1: Defining Control Breaks ... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 IFORMAT NS I 10 11 BREAK L1 
TechTalk: Level Breaks on Partial Fields

Figure 2 Program-defined breaks

 Figure 2: Program-defined Breaks ... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 C MOVELFIELD BREAK 2 
TechTalk: Level Breaks on Partial Fields

Figure 3 Control break on partial field

 Figure 3: Control Break on Partial Field Physical file DDS ... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 A R PFREC A FIELD1 5 A FIELD2 12 A FIELD3 7 0 Logical file DDS ... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 A R LFREC PFILE(PFNAME) A FIELD1 A FIELD2 A FIELD3 A NEWFLD I SST(FIELD2 1 2) 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$0.00 Raised:
$