Stuff
OS/400 Edition
Volume 1, Number 19 -- October 24, 2002

Easy Display File Printing


by Shannon O'Donnell

[The code for this article is available for download.]

display

Here's a nifty technique for printing the contents of a display file every time a user does anything on the screen. There are hundreds of business uses for such a technique. How about using it to keep a printed, running total of a user's data entry? Or for printing the "tape" of a series of calculations in a calculator-like application? Whatever you use it for, you'll find that printing the contents of a display file is really quite simple!

The Sample Application

This is one of those concepts that is difficult to understand or appreciate until you see it actually working. With that in mind, download the source code and compile it on your AS/400. In the sample program, the user is prompted to enter an item number on a 5250 display screen. As each item is entered and the Enter key is pressed, the contents of the item number field are added to the printed report. In this case, the printed report is an external printer file defined using Report Layout Utility (RLU). However, you could just as easily use an internally defined output file.

The Source Code

The source code for our sample application is really pretty simple. The display file consists of a single data entry field and an indicator to allow the program to be cancelled.

Notice in the external printer file that the field name on the DTL record format is the same as the field name in the DDS display. By keeping the fields you want to print the same as the display file, you can avoid having to handle all of the individual moves in the RPG program. And this helps to keep the printing in RPG simple.

In the RPG program, a simple loop is set up to keep showing the display file until the user presses the F3 function key, which terminates the program. Every time the user enters something into the ITEM field on the display file, the program checks to see if Indicator *IN05 is on. If it is, the printer file is advanced to the next page; otherwise, the contents of the ITEM field are printed on the report.

Keeping It Simple

There are thousands of complex applications out there that you can study on (or "cipher on," as Jethro Bodine would say) and use to challenge your mind. The sample application shown here isn't one of them, but the technique can be quite useful! Use the sample code any time you need a way to quickly capture activity on a display file.


Sponsored By
WORKSRIGHT SOFTWARE

CASS Certification
What is it? Why do you need it?

CASS stands for "Coding Accuracy Support System." This is a test developed by the U.S. Postal Service to determine whether ZIP Code software can accurately assign ZIP Codes to mailing addresses. CASS-certified software is intended to improve the accuracy of carrier route, 5-digit ZIP, ZIP+4, and delivery point codes.

CASS certified means the software has passed the test. When you use CASS software to update and maintain your mailing file, then your mailing file becomes CASS certified. What does this mean to you?

CASS certification is the first step in qualifying for postage discounts. Look at the mail you receive at home and at work; you will see that a lot of it was mailed for less than the regular 37 cent rate.

Despite all the glitz and glamour of the Internet, email, and such, the wheels of America's economy are lubricated by the ordinary envelope and the U.S. Postal Service.

If your company sends out a lot of mail, there is a good chance CASS certification can cut your postage expense. There are other steps you must perform to get these discounts, but CASS is the first step.

Your mail must be printed, sorted, and then packaged according to postal regulations. It takes some effort, but the potential savings make it worthwhile.

Exactly what happens when you process your mailing files with CASS software? The software breaks the address down into its individual elements: state, city, street name, and so forth. Then the information is compared to the national ZIP+4 database. If a match is found, the ZIP Code, ZIP+4, delivery point, and carrier route are assigned. Also the delivery line is standardized to comply with Postal Service preferences.

If an address can't be matched, no action is taken. This has the positive effect of allowing you to identify addresses in your mailing files which possibly can't be delivered, will be delayed in delivery, or at the very minimum need some minor correction to one of the address elements.

Using CASS certified software has many side benefits. You will be able to identify addresses that are potentially undeliverable. It has been estimated that as much as 30% of all advertising mail is never delivered.

That means the costs of postage, printing, paper, and overhead for undelivered mail are wasted. That means if you spend $100,000 on a direct mail campaign, as much as $30,000 could be completely wasted.

CASS software provides a number of intangible benefits. With CASS certification and bar coding there is a good likelihood that that your mail will be delivered sooner. If your invoices are delivered one day sooner, you may receive payment one day sooner.

If you CASS certify your mailing file, you can move on to the next step which is postal automation. This means applying a POSTNET bar code.

POSTNET is that little row of tall and short bars you see on your mail. POSTNET is a special bar code used by the Postal Service to allow automatic sorting machines to work.

It has been reported that bar code standard class (the old third class) mail gets delivered about as soon as first class, instead of the usual 2 or 3 weeks.

The bottom line is that using CASS software will help you keep your customers' address information in much better shape than they would be otherwise. Your mail may be delivered sooner at less cost and that means more bottom-line dollars for your company.

If you would like more information about CASS and CASS software,
contact your local post office or
call WorksRight Software, Inc. at 601-856-8337.

Are FedEx, United Parcel, and Airborne charges
for incorrect addresses eating into your budget?

Every bad address can result in a $5 to $10 charge. Even seemingly small addressing errors such as misspelled street names, or missing suite numbers can result in the same penalty as if the address were totally wrong.

Our PER/ZIP4 addressing matching software will match your addresses to the national ZIP+4 postal database. Based on the match PER/ZIP4, will update your addresses to postal standards. Our sophisticated address logic can add missing directionals, correct minor misspellings, and standardize the address format. If PER/ZIP4 can't match the address, then you know that there is likely a serious error in the address that needs to be corrected.

PER/ZIP4 can be used in a batch mode to update an entire file or interactively to update individual address one at a time. We provide a search function so that you can search the national ZIP+4 database to verify a specific address.

Visit our Web site www.worksright.com for more information and to order a free, no-hassle, 30-day trial. Or call WorksRight Software, Inc. at 601-856-8337.


THIS ISSUE
SPONSORED BY:

Jacada
Magic Software
ASNA
Original Software
Profound Logic Software
WorksRight Software


BACK ISSUES

TABLE OF CONTENTS
Add a Safety Net with Journalized Data Queues

Creating Editable Web Pages

Using Data Queues in VARPG

Sprinkle GUI on your Green Screen Salad

Back To Basics: Windowed Subfiles

Easy Display File Printing


Editors
Shannon O'Donnell
Kevin Vandever

Managing Editor
Shannon Pastore

Contributing Editors:
Howard Arner
Joe Hertvik
Ted Holt
David Morris
Richard Shaler

Publisher and
Advertising Director:

Jenny Thomas

Advertising Sales Representative
Kim Reed

Contact the Editors
Do you have a gripe, inside dope or an opinion?
Email the editors:
editors@itjungle.com



Last Updated: 10/24/02
Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.