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

$

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: