22
Fri, Nov
1 New Articles

Printer File Creation and Management Made Easy

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

A tutorial on IBM's Report Layout Utility--RLU

How do you lay out AS/400 reports? Do you do it the old System/36 way by writing output specs right in your program? Do you create externally defined printer files through DDS? The latter is better than the first, but there is an even better way! Each AS/400 that has the IBM Application Development Tools (ADT) licensed program (which should be virtually every development AS/400) has Report Layout Utility (RLU).

RLU lets a programmer employ the computer--instead of pencil and paper--to help lay out reports. Not only will report layouts be easier but programming errors can be avoided by eliminating the tedious coding of DDS or RPG Output specifications. With RLU, you will be able to easily create and modify reports with the assurance that the report is going to look just as you designed it.

It's not the most intuitive utility I have used, but with a little effort I was able to whip out printer specs in no time. RLU has gotten a bad rap-- you've probably heard that it is difficult to use, or you may have actually tried it and given up. However, the benefits it offers far outweigh the time spent learning it. This article will get you going with RLU as quickly as possible, by guiding you through the design of a typical report.

RLU creates externally described printer files via DDS specifications. It cannot create RPG output specifications and I'm glad it doesn't. Program- described printer files should be avoided. Externally described printer files have several advantages over program-described printer files: 1) Reports can be shared. For example, a four-up Cheshire label printer file could be used by every program that outputs a Cheshire format. If you need to make an adjustment to the format, you only need to change it in one place. 2) A change to a report format doesn't necessarily require a recompile of the program used to drive the report. 3) You can kick the dependency on a particular language to drive a report. 4) It makes programming print attributes such as underlining and highlighting much easier and special print functions such as bar coding are a breeze.

With RLU, printer file attributes can be permanently attached to the source code so you never have to be concerned about losing previously defined attributes when you recreate the file. (IBM should add this feature to SDA for those display files that need special create options; e.g., RSTDSP, MAXDEV, DFRWRT, etc.) RLU also allows report prototyping, which gives you confidence that reports will appear as intended. RLU can be used to edit and prototype any externally described printer file, even though it wasn't created by RLU. So, with a little practice, you can start using RLU for all of your externally described printer files.

The following typical report layout session will demonstrate most of what you need to know to start using RLU. You should be familiar with IBM's Source Entry Utility (SEU) and externally described printer and database files.

Getting Started

We are going to lay out a report for the sales department (see 1 for a prototype of the report that was created by RLU). It will list regional sales for each company, with a subtotal by region and a grand total. This sample report is meant to be a work-along exercise; you will execute the steps on your own system. If a system is not available to you, there are enough illustrations for you to still learn from the article.

We are going to lay out a report for the sales department (see Figure 1 for a prototype of the report that was created by RLU). It will list regional sales for each company, with a subtotal by region and a grand total. This sample report is meant to be a work-along exercise; you will execute the steps on your own system. If a system is not available to you, there are enough illustrations for you to still learn from the article.

An 80-column display is assumed. A 132-column display would make things easier since our report width is 132, but we will use the most common environment and report width for the benefit of our audience. You will also need a printer capable of printing a page width of 132.

I have created a work file (WRKFILE) description (see 2) to supply the database fields for our report. This physical file does not conform to database normalization standards but, I created it this way to keep the database requirements simple. If you are going to use your workstation to follow along with this article, key the DDS specifications and create the file. There is no need to place any data in it.

I have created a work file (WRKFILE) description (see Figure 2) to supply the database fields for our report. This physical file does not conform to database normalization standards but, I created it this way to keep the database requirements simple. If you are going to use your workstation to follow along with this article, key the DDS specifications and create the file. There is no need to place any data in it.

Line Types Used By RLU

Before we begin laying out our report, it will help you to know the line types used by RLU. There are four: Filler, Report, Field and Sample. All lines start out as type filler and remain that way until you attach them to a record. Once lines become part of a record, they are considered report lines. Field lines are really pseudo lines that display field boundaries above report lines. They are used to allow you to edit fields (add, move, copy, delete and change). They do not become part of the report. After records are defined and fields are added to the records, you can define sample lines which represent the record format. X's are substituted for character fields and 9's are substituted for numeric fields. Sample lines are meant to give you more feel for what the report will look like. Like field lines, sample lines do not become part of the report. 3 on page 45 illustrates an RLU session that is making use of all line types. In our sample report, we will use all line types except for sample.

Before we begin laying out our report, it will help you to know the line types used by RLU. There are four: Filler, Report, Field and Sample. All lines start out as type filler and remain that way until you attach them to a record. Once lines become part of a record, they are considered report lines. Field lines are really pseudo lines that display field boundaries above report lines. They are used to allow you to edit fields (add, move, copy, delete and change). They do not become part of the report. After records are defined and fields are added to the records, you can define sample lines which represent the record format. X's are substituted for character fields and 9's are substituted for numeric fields. Sample lines are meant to give you more feel for what the report will look like. Like field lines, sample lines do not become part of the report. Figure 3 on page 45 illustrates an RLU session that is making use of all line types. In our sample report, we will use all line types except for sample.

Let's Lay Out a Report

Begin by keying the STRRLU, followed by F4 for prompting. Specify the source physical file, library and the member name for the DDS specifications to be created. The source physical file name and member name default to the last file and member on which you worked. Use the name TESTRPT. The OPTION parameter has two possible values: "2" changes a report and "6" prints a prototype of the report. Use Option 2. The next parameter, page width (PAGWIDTH), defaults to 132 for the first time, which is the value we want to use. Valid page width values are 1-378.

You can start RLU from PDM for existing printer files by using Option 19 on DDS source members that have type PRTF. The corresponding object for the DDS printer file does not need to exist.

A "Design Report" screen is presented. This is the main work screen you will be using to lay out your report. It looks a lot like an SEU screen. Initially, it will have 15 blank lines with a column of seven apostrophies on the extreme left of the screen. Like SEU, this left column is where you will be keying line commands.

4 illustrates the basic steps we will follow during this session. These are the same steps you will use any time you lay out a report using RLU, so refer to them often until they become second nature.

Figure 4 illustrates the basic steps we will follow during this session. These are the same steps you will use any time you lay out a report using RLU, so refer to them often until they become second nature.

5 lists all the usable function keys available in RLU. There are so many functions in RLU (more than can be handled by 24 function keys) that IBM has created two groups of function keys: basic and alternative. Any time we refer to a function key in this article we will qualify it as basic (Bas) or alternative (Alt). You can toggle between Bas and Alt at any time from the the work screen using F22. Some of the function keys are the same as their SEU counterparts and some are the same as similar functions in SDA .

Figure 5 lists all the usable function keys available in RLU. There are so many functions in RLU (more than can be handled by 24 function keys) that IBM has created two groups of function keys: basic and alternative. Any time we refer to a function key in this article we will qualify it as basic (Bas) or alternative (Alt). You can toggle between Bas and Alt at any time from the the work screen using F22. Some of the function keys are the same as their SEU counterparts and some are the same as similar functions in SDA .

Like SEU, RLU has a command line at the top of the work screen that allows you to enter any of the RLU commands (FIND, CHANGE, SAVE, CANCEL, FILE, TOP, BOTTOM, and SET).

There are also line commands available in RLU that are used in the same manner as in SEU (keyed in the left margin of the edit screen). Most of the SEU line commands--copy (C), delete (D), move (M), plus special RLU line commands--are available. The RLU line commands are listed in 6.

There are also line commands available in RLU that are used in the same manner as in SEU (keyed in the left margin of the edit screen). Most of the SEU line commands--copy (C), delete (D), move (M), plus special RLU line commands--are available. The RLU line commands are listed in Figure 6.

Don't let the large number of function keys and commands scare you--cut out the page with the function keys and line commands or make a copy of it and use it for reference until you memorize the ones you need.

Define Records

We will begin by defining our record formats. The following records are needed: heading (HDNG), detail (DETAIL), region total (REGTOT) and grand total (GNDTOT).

Start by defining the HDNG record. Key the define record (DR) command in the line command area of the first line. After pressing the Enter key, your screen will appear as in 7 (page 50). The first line contains RCD001 on the left and the rest of the line is reverse image. RCD001 is the default record format name given this record by RLU. Notice the message at the bottom of the screen, "Define at least one field in record format RCD001." Until at least one field for record RCD001 is defined, this message will remain and the record will continue being displayed in reverse image. There is no way around this annoyance. RLU always requires you to create a record before a field can be defined. This is something you will get used to.

Start by defining the HDNG record. Key the define record (DR) command in the line command area of the first line. After pressing the Enter key, your screen will appear as in Figure 7 (page 50). The first line contains RCD001 on the left and the rest of the line is reverse image. RCD001 is the default record format name given this record by RLU. Notice the message at the bottom of the screen, "Define at least one field in record format RCD001." Until at least one field for record RCD001 is defined, this message will remain and the record will continue being displayed in reverse image. There is no way around this annoyance. RLU always requires you to create a record before a field can be defined. This is something you will get used to.

Since this is our heading record, we need to indicate a skip to line 5 and space one after and change the record format name to HDNG. Record keywords are used to define skipping and spacing, so we'll assign them by using the F18(Bas) key (record keywords). This function key is cursor-sensitive; whatever record the cursor is positioned in will be the record whose keywords will be affected. F18(Bas) presents with a Work with Records Keywords screen (8 on page 50). This screen will allow you to specify any of the keywords used with record formats. Specify keyword SKIPB and SPACEA by using the 2 option on both keywords, press Enter and specify 5 as the line number to skip to before printing this record. Press Enter and 1 will already be the default for the number of lines to space after. Press Enter and you should be back at the keyword screen. Notice the rename record function, F10. Use it and change the record name to HDNG. Press Enter twice after changing the name and you will see the new record name on line five (9, page 50). You will also notice four filler lines above record HDNG. The SKIPB value of 5 caused these filler lines to be added. Also notice the line below the HDNG record line with a "+" symbol. This line was added as a result of the SPACEA value of 1.

Since this is our heading record, we need to indicate a skip to line 5 and space one after and change the record format name to HDNG. Record keywords are used to define skipping and spacing, so we'll assign them by using the F18(Bas) key (record keywords). This function key is cursor-sensitive; whatever record the cursor is positioned in will be the record whose keywords will be affected. F18(Bas) presents with a Work with Records Keywords screen (Figure 8 on page 50). This screen will allow you to specify any of the keywords used with record formats. Specify keyword SKIPB and SPACEA by using the 2 option on both keywords, press Enter and specify 5 as the line number to skip to before printing this record. Press Enter and 1 will already be the default for the number of lines to space after. Press Enter and you should be back at the keyword screen. Notice the rename record function, F10. Use it and change the record name to HDNG. Press Enter twice after changing the name and you will see the new record name on line five (Figure 9, page 50). You will also notice four filler lines above record HDNG. The SKIPB value of 5 caused these filler lines to be added. Also notice the line below the HDNG record line with a "+" symbol. This line was added as a result of the SPACEA value of 1.

Now let's define our next record: DETAIL. Go to the last line and key an insert (I) command in the line command area and press Enter. Now move the cursor to the line command area of the line just added and define a record by keying DR, and press Enter. RLU will assign a default record name of RCD002. Change the record name to DETAIL by placing the cursor anywhere in RCD002, pressing F18(Bas), pressing F10, changing the record name to DETAIL and pressing Enter twice.

At this point, you should be back at the Design Report screen. Now create the control break format (REGTOT). Since REGTOT is a control break record, specify a space before value of 2. By now you should be able to easily specify the SPACEB keyword value on your own.

Since the control break record (REGTOT) and the grand total record (GNDTOT) are similar, we can create the GNDTOT record by making a copy of the REGTOT record. Use the copy block command (CC), on the two lines occupied by REGTOT the filler line above the REGTOT record and the REGJOJ record and place a before (B) command on the End of Report line. You will now have another record on your screen, RCD004. The new record has all the same attributes as the record we copied, which in this case means we already have the correct spacing. The only thing left to do is change the record name from RCD004 to GNDTOT. After you create GNDTOT, your screen should look like 10 (page 51).

Since the control break record (REGTOT) and the grand total record (GNDTOT) are similar, we can create the GNDTOT record by making a copy of the REGTOT record. Use the copy block command (CC), on the two lines occupied by REGTOT the filler line above the REGTOT record and the REGJOJ record and place a before (B) command on the End of Report line. You will now have another record on your screen, RCD004. The new record has all the same attributes as the record we copied, which in this case means we already have the correct spacing. The only thing left to do is change the record name from RCD004 to GNDTOT. After you create GNDTOT, your screen should look like Figure 10 (page 51).

Create Field Lines (Pseudo Lines) for All Record Lines

We are now ready to add fields to the records. But first, we'll add field lines to all the records by using the view field lines, block line command, VFF. Think of field lines as templates that help you manipulate fields defined on the workscreen. (Remember, they do not become part of the source member.) Place VFF on the HDNG record and VFF on the GNDTOT record (11 on page 51) and press Enter. Your screen will now look like 12 (page 51). Above each record line, there is a field line denoted by FLD1. Field lines are required to place database fields into a report, as you will see in the next section. They are also used to perform basic editing; i.e., making a field longer or shorter. To delete a field line that was created by the VF or VFF line command, use the D line command. You can create field lines for all fields another way: use F13(Alt)=Change session defaults and place a "Y" in the "Show all field lines" parameter. However, using this method prevents you from deleting individual field lines--you either show all field lines or you show none. With F13(Alt) you can also change other session defaults like "Amount to roll," "Uppercase input only" and "Screen size," to name a few.

We are now ready to add fields to the records. But first, we'll add field lines to all the records by using the view field lines, block line command, VFF. Think of field lines as templates that help you manipulate fields defined on the workscreen. (Remember, they do not become part of the source member.) Place VFF on the HDNG record and VFF on the GNDTOT record (Figure 11 on page 51) and press Enter. Your screen will now look like Figure 12 (page 51). Above each record line, there is a field line denoted by FLD1. Field lines are required to place database fields into a report, as you will see in the next section. They are also used to perform basic editing; i.e., making a field longer or shorter. To delete a field line that was created by the VF or VFF line command, use the D line command. You can create field lines for all fields another way: use F13(Alt)=Change session defaults and place a "Y" in the "Show all field lines" parameter. However, using this method prevents you from deleting individual field lines--you either show all field lines or you show none. With F13(Alt) you can also change other session defaults like "Amount to roll," "Uppercase input only" and "Screen size," to name a few.

Select and Place Database Fields

The first fields to place will be from our database file, WRKFILE. Press F10(Bas)=Database fields (similar to F10 in SDA) and you will be presented with the Work with Database Fields screen (13, page 52). Place a 1 (Add Field) in the first option field and press Enter. Fill in the file name, WRKFILE, library, your library, and record format, RSREC on the Add Database Fields screen, which comes up next. (You can use F4 for any of the parameters to obtain a list of available choices.) Select all fields from the RSREC in WRKFILE by using Option 1. Press Enter three times and you will be back at the Design Report screen. Notice the list of field names at the bottom of the screen. These are all the field names you selected from the database files.

The first fields to place will be from our database file, WRKFILE. Press F10(Bas)=Database fields (similar to F10 in SDA) and you will be presented with the Work with Database Fields screen (Figure 13, page 52). Place a 1 (Add Field) in the first option field and press Enter. Fill in the file name, WRKFILE, library, your library, and record format, RSREC on the Add Database Fields screen, which comes up next. (You can use F4 for any of the parameters to obtain a list of available choices.) Select all fields from the RSREC in WRKFILE by using Option 1. Press Enter three times and you will be back at the Design Report screen. Notice the list of field names at the bottom of the screen. These are all the field names you selected from the database files.

Place the company name field (RSCONA) in the HDNG record by placing the field identification number 1 for RSCONA in the extreme left position of the field line above HDNG (14a, page 52) and pressing Enter. Your screen will look like 14b (page 52). The X's represent sample data for the RSCONA field. (X's denote a character field; 9's represent numeric fields.) You will notice RLU placed the <.....> character string above the X's to indicate the length of the field that you have created. The "<" character represents the left boundary and the ">" character represents the right boundary.

Place the company name field (RSCONA) in the HDNG record by placing the field identification number 1 for RSCONA in the extreme left position of the field line above HDNG (Figure 14a, page 52) and pressing Enter. Your screen will look like Figure 14b (page 52). The X's represent sample data for the RSCONA field. (X's denote a character field; 9's represent numeric fields.) You will notice RLU placed the <.....> character string above the X's to indicate the length of the field that you have created. The "<" character represents the left boundary and the ">" character represents the right boundary.

Center the company name field by using the Center Field (CF) line command in the HDNG record.

Place RSCUNA, RSITDE and RSITAM fields one at a time in the field line above the DETAIL record, starting from the left. RLU requires at least one space between the end of one field and the beginning of another. Before placing RSITAM, window the screen to the right. You can use F20(Bas) (window right) or the window line command (Wxxx) in the line command area of the screen to accomplish this. Since RSITAM is a dollar amount, we will add an edit code of "J" to the field. After you have placed the field, put the cursor anywhere in the field (in the 9's or periods above the 9's) and press F23(Bas)=Field keywords. The Work with Field Keyword screen will appear (15, page 53). Specify 2 next to the EDTCDE keyword, press Enter and assign edit code "J."

Place RSCUNA, RSITDE and RSITAM fields one at a time in the field line above the DETAIL record, starting from the left. RLU requires at least one space between the end of one field and the beginning of another. Before placing RSITAM, window the screen to the right. You can use F20(Bas) (window right) or the window line command (Wxxx) in the line command area of the screen to accomplish this. Since RSITAM is a dollar amount, we will add an edit code of "J" to the field. After you have placed the field, put the cursor anywhere in the field (in the 9's or periods above the 9's) and press F23(Bas)=Field keywords. The Work with Field Keyword screen will appear (Figure 15, page 53). Specify 2 next to the EDTCDE keyword, press Enter and assign edit code "J."

To make the report look more balanced, tell RLU to evenly space the detail fields across the report. Key the SP line command in record DETAIL. The fields will automatically be evenly spaced between the report width (132). Place the region number field RSREG in the REGTOT record on the extreme left.

Define and Place Calculated Fields

There are two ways you can define fields: via the F11(Bas)=Define field function key and via the define field (DF) line command. The F11(Bas) method is a simpler, more direct approach, and will be the method we use.

Define fields by keying data on the workscreen to represent the field. The data should be equal to the length of the field you are creating; however, it can be easily changed after it is created. If the field is numeric, you should key 9's to represent the data. Actually, RLU will define any data that starts with a numeric character as zoned decimal. (If you key commas or any data that corresponds to an edit code or edit word into a numeric field, RLU will create the appropriate edit code or edit word. However, we won't use this feature in this article.) Any group of characters that begins with a non-numeric character will cause RLU to define a character field. When defining a field, you must place your cursor in the first character representing the field to allow RLU to determine the correct length of the field. After you position the cursor, you will use F11(Bas)=Define field to instruct RLU to set up a field.

For our report, define a field to contain the total item amounts of a region: Eleven 9's in the REGTOT record lined up underneath the RSITAM field in the DETAIL record. Now, put your cursor in the first 9 of the group and define the field by pressing F11(Bas). You will be presented with the Define Field Information screen as shown in 16. Change the name of the field to RTOT and change the decimal positions to 2. Press F10=Work with keywords and assign edit code "J." Press Enter until you get back to the workscreen.

For our report, define a field to contain the total item amounts of a region: Eleven 9's in the REGTOT record lined up underneath the RSITAM field in the DETAIL record. Now, put your cursor in the first 9 of the group and define the field by pressing F11(Bas). You will be presented with the Define Field Information screen as shown in Figure 16. Change the name of the field to RTOT and change the decimal positions to 2. Press F10=Work with keywords and assign edit code "J." Press Enter until you get back to the workscreen.

Now, define a calculated field for the GNDTOT record to contain the total of all item amounts sold for all regions. Since this field will be similar to the RTOT field just created, make a copy of the RTOT field and change its name. Do this by placing the cursor in the RTOT field and pressing F13(BAS)=Mark/Unmark data. Place the cursor in the field line above the GNDTOT record or the GNDTOT record line and align it horizontally with the RTOT field. Press F14(Bas)=Copy marked data. Position the cursor in the first postion of copied field, press F23(Bas) followed by F10 to change the field name from RTOT to GTOT. When you get back to the Design Report screen, make the GTOT field two digits larger. Do this by placing the cursor two positions to the left of the <.......> character string in the field line above the GTOT field. Key these three characters "<..". The second period (last character of the three) will overlay the original "<" character. Press Enter and the field length will be expanded. Since the edit code for GTOT calls for commas, the number of characters added will actually be three (one additional comma had to be added). As a result, RLU shifts the GTOT field one position to the right. To line GTOT up with the other fields RITOT and RSITAM, place the cursor anywhere in the field line to the left of <.....> character string above GTOT and press the Delete key. We're done with our database and calculated fields.

Define and Place Constant Fields

Our last step will be to add constants. This includes literal heading information and the constant fields that must be defined for the date time and page number (DATE, TIME and PAGNBR).

Defining constants is done in a rather peculiar manner. It basically goes like this: Key the characters that make up the constant information, define the constant information as a field and then change the field to a constant. Seem a little strange? I think so, too.

The date and time are to be placed at the left, and the page number is to be placed on the right.

Key six 9's to represent the unedited length of date in the left portion of the HDNG record. When setting up constants, you must use a record line (not a field line like we did when placing database fields). Since we want time placed directly under the date, a line needs to be added. Use the insert (I) line command on the HDNG record. Key six 9's on the new line under the 9's used for date. Skip three columns to the right and key four 9's to represent the page number. Don't be concerned that the page number is not positioned where it is supposed to be--we'll move it later.

Now define date, time and page by using F11(Bas). Just as when we defined our calculated fields, the cursor must be in position one of the field before defining the field. After pressing F11(Bas), press F11=Convert to constant field, then press F10=Work with keywords. You'll now be at the Work with Field Keywords screen. Remove the DFT keyword and press Enter. (All constants defined in RLU end up with the keyword DFT assigned, which is not always compatible with certain special keywords like EDTCDE, DATE, TIME and PAGNBR.) Now assign the DATE and EDTCDE keywords and press Enter. Assign edit code "Y" and press Enter three times. You will be back at the Design Report screen with the current edited date displayed.

Define the time field, convert it to a constant, remove keyword DFT and assign keyword TIME. Define the page number field, convert it to a constant, remove keyword DFT and assign it the keyword PAGNBR.

Page number is not where we want it, so we need to move it. Place the cursor in the page number field and press F13(Bas) to mark the field. Window right (W100) and place your cursor in column 128 of the same line and press F15(Bas)=Move marked data. (You may remember that we copied a field the same way except F14(Bas)=Copy marked data was used instead of F15(Bas).) Now, key the literal "Page" beginning in column 123. This should leave one space between "Page" and the PAGNBR field. Place the cursor in the first position of "Page," press F11(Bas) followed by F11 and press Enter. The F11(Bas), F11, press Enter sequence will become very familiar to you as you create field constants.

Place heading constants above detail fields. Since variable fields are only represented by X's or 9's, you may forget what fields are what. As a help, you can position your cursor anywhere in a record and press F4(Bas)=Fields to obtain a list of all field names used in a record. Define heading constants "Customer Name," "Item Description" and "Item Amount" in the line above the DETAIL record line.

Place control break constants in the REGTOT and GNDTOT records. Define "Region Total" to the right of the RSREG field in REGTOT record and "Grand Total" to the extreme left in the GNDTOT record.

Place the report title "Regional Sales Report" two lines below the company name: Insert a line below the line containing TIME and place the report title constant "Regional Sales Report." While you are defining the field, specify keyword HIGHLIGHT and UNDERLINE. Center the title with the center field (CF) line command. Insert one line after the report title.

End Session

To end the session, use F3. You will be presented with a screen like the one in 17 on page 53.

To end the session, use F3. You will be presented with a screen like the one in Figure 17 on page 53.

Use Option 1 to save and exit. Just call member TESTRPT and place it in one of your source physical files and libraries. Create printer file should be Y and Change defaults should be N. At initial file creation time, you would normally specify Change defaults as Y in order to assign attributes like forms type, number of copies, etc. Our test report is generic and can use the system's defaults. The point to remember is that the defaults will remain as you set them. No matter how many times you create the printer file through RLU, it will always retain the attributes you have assigned. I think this feature alone makes RLU worth using.

Specify Y for Prototype report. The system will generate a prototype like the one in 1 on page 45. It is advisable to print a prototype to help eliminate surprises when you actually run the report. You can also change the default prototype values; however, we will leave these alone. All that remains is to submit the create printer file job to batch.

Specify Y for Prototype report. The system will generate a prototype like the one in Figure 1 on page 45. It is advisable to print a prototype to help eliminate surprises when you actually run the report. You can also change the default prototype values; however, we will leave these alone. All that remains is to submit the create printer file job to batch.

You have completed your first report designed and created with RLU. If you have been program-describing your printer files--forget it--you don't need to anymore. And if you have been tediously coding DDS specifications, you can now let your AS/400 do the dirty work.

Reference: RLU User's Guide and Reference (SC09-1416)


Printer File Creation and Management Made Easy

Figure 1 rototype of report (unable to display)


Printer File Creation and Management Made Easy

Figure 10 Heading, detail and control break records

 
  Figure 10:  Heading, Detail and Control Break Records Defined 
 
   Columns . . . :    1  71        Design Report 
  MGTLIB/QPGMSRC 
   RLU==> ____________________________________________________________ 
  TESTRPT 
   FMT **  ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
          ------------------------- Start of Page 001 -------------------------- 
  00001 . 
  00002 . 
  00003 . 
  00004 . 
     HDNG 
  00006 + 
   DETAIL 
  00008 . 
   REGTOT 
  00010 . 
   GNDTOT 
          --------------------------- End of Report ---------------------------- 
 
   F3=Exit   F11=Define field   F16=Delete field 
   F22=Alternative keys         F24=More keys 
  Define at least one field in record format HDNG.                             + 

Printer File Creation and Management Made Easy

Figure 11 View field lines block command

 
  Figure 11:  View Field Lines Block Command 
 
   Columns . . . :    1  71        Design Report 
  MGTLIB/QPGMSRC 
   RLU==> ____________________________________________________________ 
  TESTRPT 
   FMT **  ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
          ------------------------- Start of Page 001 -------------------------- 
  00001 . 
  00002 . 
  00003 . 
  00004 . 
  VFFHDNG 
  00006 + 
   DETAIL 
  00008 . 
   REGTOT 
  00010 . 
  VFFDTOT 
          --------------------------- End of Report ---------------------------- 

Printer File Creation and Management Made Easy

Figure 12 Field lines displayed for all report lines

 
  Figure 12:  Field Lines Displayed for All Report Lines 
 
   Columns . . . :    1  71        Design Report 
  MGTLIB/QPGMSRC 
   RLU==> ____________________________________________________________ 
  TESTRPT 
   FMT **  ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
          ------------------------- Start of Page 001 -------------------------- 
  00001 . 
  00002 . 
  00003 . 
  00004 . 
  FLD1 
     HDNG 
  FLD1 
  00006 + 
  FLD1 
   DETAIL 
  00008 . 
  FLD1 
   REGTOT 
  00010 . 
  FLD1 
   GNDTOT 
 
   F3=Exit   F11=Define field   F16=Delete field 
   F22=Alternative keys         F24=More keys 
  Define at least one field in record format HDNG.                             + 

Printer File Creation and Management Made Easy

Figure 13 Work with Database Fields screen

 
  Figure 13:  Work with Database Fields Screen 
 
                             Work with Database Fields 
 
   Type options, press Enter. 
     1=Add field   4=Remove   8=Display field description 
 
   Option     Field          Library        File           Record 
     _        __________     __________     __________     __________ 
 
     (No database fields selected) 
 
 
 
 
 
 
  Bottom 
   F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F16=Delete all fields 

Printer File Creation and Management Made Easy

Figure 14A Database field placement

 
  Figure 14a:  Database Field Placement 
 
   Columns . . . :    1  71        Design Report 
  MGTLIB/QPGMSRC 
   RLU==> ____________________________________________________________ 
  TESTRPT 
   FMT **  ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
          ------------------------- Start of Page 001 -------------------------- 
  00001 . 
  00002 . 
  00003 . 
  00004 . 
  FLD1    1 
     HDNG 
  FLD1 
  00006 + 
  FLD1 
   DETAIL 
  00008 . 
  FLD1 
   REGTOT 
  00010 . 
  FLD1 
   GNDTOT 
   1:RSCONA   2:RSCUNA   3:RSITAM   4:RSITDE   5:RSREG 
   F17=File keywords    F18=Record keywords 
   F23=Field keywords   F24=More keys 
  Define at least one field in record format HDNG.                             + 

Printer File Creation and Management Made Easy

Figure 14B Database field boundary view

 
  Figure 14b:  Database Field Boundary View 
 
   Columns . . . :    1  71        Design Report 
  MGTLIB/QPGMSRC 
   RLU==> ____________________________________________________________ 
  TESTRPT 
   FMT **  ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
          ------------------------- Start of Page 001 -------------------------- 
  00001 . 
  00002 . 
  00003 . 
  00004 . 
  FLD1    <.................................> 
     HDNG XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
  FLD1 
  00006 + 
  FLD1 
   DETAIL 
  00008 . 
  FLD1 
   REGTOT 
  00010 . 
  FLD1 
   GNDTOT 
   1:RSCUNA   2:RSITAM   3:RSITDE   4:RSREG 
   F17=File keywords    F18=Record keywords 
   F23=Field keywords   F24=More keys 
  Define at least one field in record format HDNG.                             + 

Printer File Creation and Management Made Easy

Figure 15 Work with Field keywords screen

 
  Figure 15:  Work with Field Keywords Screen 
 
                              Work with Field Keywords 
 
   Field  . . . . . . . . :   RSITAM        Record format  . . . . :   DETAIL 
 
   Type options, press Enter. 
     2=Specify   4=Remove 
 
   Opt     Keyword            Opt     Keyword            Opt     Keyword 
    _      ALIAS               _      EDTWRD              _      SPACEA 
    _      BARCODE             _      FLTFIXDEC           _      SPACEB 
    _      BLKFOLD             _      FLTPCN              _      TEXT 
    _      CHRID               _      FONT                _      TIME 
    _      CHRSIZ              _      HIGHLIGHT           _      TRNSPY 
    _      COLOR               _      INDTXT              _      UNDERLINE 
    _      CPI                 _      MSGCON 
    _      CVTDTA              _      PAGNBR 
    _      DATE                _      PRTQLTY 
    _      DFT                 _   >  REFFLD 
    _      DLTEDT              _      SKIPA 
    _      EDTCDE              _      SKIPB 
 
  Bottom 
   F3=Exit   F5=Refresh   F9=Input keyword parameters   F10=Specify information 
   F12=Cancel   F16=Remove all keywords 

Printer File Creation and Management Made Easy

Figure 16 Define Field Information screen

 
  Figure 16:  Define Field Information Screen 
 
                              Define Field Information 
 
   Edited length . . . . . . . . . . . . :   7 
   Record format . . . . . . . . . . . . :   HDNG 
   Number of keywords  . . . . . . . . . :   1 
   Number of indicators  . . . . . . . . :   0 
 
   Type choices, press Enter. 
 
     Field . . . . . . . . . . . . . . . .   FLD018____    Name 
     Option indicators . . . . . . . . . .   ___ ___ ___   01-99, N01-N99 
       More indicators . . . . . . . . . .     N           Y=Yes, N=No 
     Starting line . . . . . . . . . . . .   ___           1-255 
     Starting position . . . . . . . . . .   _+2           1-255, +nn 
     Length of data  . . . . . . . . . . .   __6           1-378, +nn, -nn 
     Data type . . . . . . . . . . . . . .   2             1=Character 
                                                           2=Zoned 
                                                           3=Floating point 
     Decimal positions . . . . . . . . . .   _0            0-31, +n, -n 
 
 
  More... 
 
   F3=Exit   F5=Refresh   F10=Work with keywords   F11=Convert to constant field 
   F12=Cancel 

Printer File Creation and Management Made Easy

Figure 17 Exit RLU screen

 
  Figure 17:  Exit RLU Screen 
 
                                      Exit RLU 
 
   Type choices, press Enter. 
 
     Option  . . . . . . . . . . . . . .   1              1=Save and exit 
                                                          2=Exit without saving 
                                                          3=Resume 
       Member  . . . . . . . . . . . . .     TESTRPT___   Name 
       File  . . . . . . . . . . . . . .     QPGMSRC___   Name 
       Library . . . . . . . . . . . . .     MGTLIB____   Name 
       Text  . . . . . . . . . . . . . . 
  Test_Report__________________________ 
  _____________ 
     Create printer file . . . . . . . .   N              Y=Yes, N=No 
       Change defaults . . . . . . . . .     N            Y=Yes, N=No 
     Prototype report  . . . . . . . . .   N              Y=Yes, N=No 
       Change defaults . . . . . . . . .     N            Y=Yes, N=No 
     Submit to batch . . . . . . . . . .   N              Y=Yes, N=No 
       Job description . . . . . . . . .     *USRPRF___   Name, *USRPRF 
       Library . . . . . . . . . . . . .     __________   Name, *LIBL, *CURLIB 
 
 
 
   F5=Refresh   F12=Cancel 

Printer File Creation and Management Made Easy

Figure 2 DDS for WRKFILE file

 
  Figure 2:  DDS for WRKFILE File 
 
   .. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
  A* Work file:  Contains sales history for region 
  A          R RSREC                     TEXT('Work File') 
  A            RSCONA        35          TEXT('Company Name') 
  A            RSREG          3S 0       TEXT('Region Number') 
  A            RSCUNA        35          TEXT('Customer Name') 
  A            RSITDE        35          TEXT('Item Description') 
  A            RSITAM        11S 2       TEXT('Item Sales Amount') 
  A          K RSCONA 
  A          K RSREG 
  A          K RSITDE 
   .. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 

Printer File Creation and Management Made Easy

Figure 3 Sample RLU layout seesion using all line types

 
  Figure 3:  Sample RLU Layout Session Using All Line Types 
 
   Columns . . . :    1  71        Design Report 
  $SHARIC/QPGMSRC 
   RLU==> ____________________________________________________________ 
  FIG3 
   FMT **  ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
  FLD1     <......>             <.................................>       <..> 
     HDNG  12/03/91             XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX       9999 
  00002 + 
  FLD1               <...........>                                     <.....> 
  00003 +            Customer Name                                   Sales Amt 
  FLD1               <.................................>           <.........> 
   DETAIL            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX           99999999999 
  00005 S            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX           99999999999 
  00006 S            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX           99999999999 
  00007 S            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX           99999999999 
  00008 S            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX           99999999999 
  00009 . 
  00010 . 
  FLD1               <.................>                           <.........> 
    TOTAL            Total Company Sales                           99999999999 
          --------------------------- End of Report ---------------------------- 
 
 
   F17=File keywords    F18=Record keywords 
   F23=Field keywords   F24=More keys 

Printer File Creation and Management Made Easy

Figure 4 Basic steps to layout a report with RLU

 
  Figure 4:  Basic Steps to Layout a Report With RLU 
 
  1. Define records 
 
       Assign record names and keywords (SKIPB, SPACEA, etc.) 
 
  2. Create field lines (pseudo lines) for all record lines 
 
  3. Select and place Database fields 
 
  4. Define and place calculated fields 
 
  5. Define and place constant fields 
 
  6. End session 
 
       Create printer file creation defaults 
 
       Print prototype 

Printer File Creation and Management Made Easy

Figure 5 RLU function keys

 
  Figure 5:  RLU Function Keys 
 
    F1 (Bas)||     Hel 
    F1 (Alt)||       
    F3 (Bas)||     Exi 
    F3 (Alt)||       
  * F4 (Bas)||     Work with fields for this record forma 
  * F4 (Alt)||     Promp 
    F5 (Bas)||     Refres 
    F5 (Alt)||         
    F6 (Bas)||     Condition display: keywords and/or indicator 
  * F6 (Alt)||     Move split line (used with Copy/Browse options 
    F9 (Bas)||     Retrieve last command entered on command lin 
    F9 (Alt)||        "       "      "      "     "    "       
    F10(Bas)||     Work with database field 
    F10(Alt)||     Move cursor to command lin 
    F11(Bas)||     Define field at cursor positio 
    F11(Alt)||     Previous record in prompt when prompt is activ 
    F12(Bas)||     Previous scree 
    F12(Alt)||         "       
  * F13(Bas)||     Mark/Unmark data (cursor sensitive 
    F13(Alt)||     Change session default 
  * F14(Bas)||     Copy marked dat 
    F14(Alt)||     Find/Change option 
  * F15(Bas)||     Move marked dat 
    F15(Alt)||     Browse/Copy option 
    F16(Bas)||     Delete fiel 
    F16(Alt)||     Repeat fin 
  * F17(Bas)||     Work with file keyword 
    F17(Alt)||     Repeat chang 
  * F18(Bas)||     Work with record keyword 
    F18(Alt)||     Double Byte Character Strings (DBCS) string 
    F19(Bas)||     Lef 
    F19(Alt)||       
    F20(Bas)||     Righ 
    F20(Alt)||        
    F21(Bas)||     System command scree 
    F21(Alt)||        "      "        
    F22(Bas)||     Alternative function key 
    F22(Alt)||     Basic function key 
  * F23(Bas)||     Work with field keyword 
    F24(Bas)||     Display more function key 
    F24(Alt)||     Display more function key 
 
  * Cursor sensitive function 

Printer File Creation and Management Made Easy

Figure 6 RLU line commands

 
  Figure 6:  RLU Line Commands 
 
  DR     Define line as a record format 
 
  DF     Define any text followed by two blanks as a field 
 
  VF     View field line 
 
  CLx     Change line type to x: 
 
          R = Record 
 
          C = Continuation report line 
 
          S = Sample line 
 
          F = Filler line 
 
  CF     Center field/s within report width 
 
  All of the above commands can be specified for n lines (XYn) or blocked (XYY). 
  For example: 
 
  DR3 will define the line on which the command is specified and the following 
  two lines as a record format. 
 
  DRR -| 
  .    | 
  .    ||-----> Defines this block of lines as a record format 
  .    | 
  .    | 
  DRR -| 
 
 
 
  SD     Create sample data, also SDx for create x sample lines 
 
  SP     Space fields evenly within report width 
 
  NP     Start a new page 

Printer File Creation and Management Made Easy

Figure 7 Defining a record format in RLU

 
  Figure 7:  Defining a Record Format in RLU 
 
   Columns . . . :    1  71        Design Report 
  MGTLIB/QPGMSRC 
   RLU==> ____________________________________________________________ 
  TESTRPT 
   FMT **  ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
          ------------------------- Start of Page 001 -------------------------- 
   RCD001 
          --------------------------- End of Report ---------------------------- 
 
 
 
 
 
   F3=Exit   F11=Define field   F16=Delete field 
   F22=Alternative keys         F24=More keys 
  Define at least one field in record format RCD001. 

Printer File Creation and Management Made Easy

Figure 8 Work with Record Keywords screen

 
  Figure 8:  Work with Record Keywords Screen 
 
                             Work with Record Keywords 
 
   Record format  . . . . :   RCD001 
 
   Type options, press Enter. 
     2=Specify   4=Remove 
 
   Opt     Keyword            Opt     Keyword            Opt     Keyword 
    _      CHRSIZ              _      SPACEA 
    _      CPI                 _      SPACEB 
    _      DFNCHR              _      TEXT 
    _      DRAWER 
    _      FONT 
    _      HIGHLIGHT 
    _      INDTXT 
    _      LPI 
    _      PAGRTT 
    _      PRTQLTY 
    _      SKIPA 
    _      SKIPB 
 
  Bottom 
   F3=Exit      F5=Refresh   F9=Input keyword parameters   F10=Rename record 
   F12=Cancel   F16=Remove all keywords 

Printer File Creation and Management Made Easy

Figure 9 Renamed record with skipping and spacing

 
  Figure 9:  Renamed Record with Skipping and Spacing 
 
   Columns . . . :    1  71        Design Report 
  MGTLIB/QPGMSRC 
   RLU==> ____________________________________________________________ 
  TESTRPT 
   FMT **  ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
          ------------------------- Start of Page 001 -------------------------- 
  00001 . 
  00002 . 
  00003 . 
  00004 . 
     HDNG 
  00006 + 
          --------------------------- End of Report ---------------------------- 
 
 
 
   F3=Exit   F11=Define field   F16=Delete field 
   F22=Alternative keys         F24=More keys 
  Define at least one field in record format HDNG. 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • 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.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • 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

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • 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: