Home > Ask the AS/400 Experts > iSeries Application Development Questions & Answers > RPG IV program for cover letters
Ask The iSeries 400 Expert: Questions & Answers
EMAIL THIS

RPG IV program for cover letters

John Blenkinsop EXPERT RESPONSE FROM: John Blenkinsop

Pose a Question
Other iSeries 400 Categories
Meet all iSeries 400 Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 23 November 2004
I need to write a RPG IV program that will generate not only a cover letter for specific customers but also list their orders that will not be filled due to lack of product based on specific tables in the system. Should I create the cover letter in QTXTSRC, or Output spec's in QRPGLESRC? What are some of the newest things? We are on iSeries V5R2.

>
What you do depends on how often the text will change, and whether you want your users to be able to change the text easily. The most flexible method would be to allow the users who need to be able to change this text to maintain a text file in a folder in QDLS in the IFS -- you can then use CPYFRMPCD to refresh a PF that your program will use as the source text for the letter.

A member or members in QTXTSRC (or create a source file called QLETTERS, maybe?) is also fine, and is easy to maintain. Just override to the right member and open it in your program like a normal database file.

And a normal database file is also OK, if you create a maintenance program to go with it. This has the advantage that it would just be another table for authorized users to maintain, and they do not need to know how to use SEU. Plus, you can add fields to each text line (record) to provide header records, group data, boilerplate flags and authority control -- whatever your imagination and the user's requirements will support.

O-specs would be my last choice. I assume you mean that the text is stored as constants in the program. This means that changes require programmer intervention.

Now to the printing. Your new program must do two things -- print a letter, and print a list from a database. You can create two programs, one for each task -- that's a better methodology. You can use the same printfile between the two program by overriding the file (OVRPRTF) with SHARE(*YES), then using USROPN in the two programs. Call one program from the other. The called program must close the printer file before returning, but the calling program will still have the printer file open. When the calling program ends, it must close the printer file, and then the printout becomes ready to print.

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Visit the ITKnowledge Exchange and get answers to your developing questions fast.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
RPG iSeries programming
Enhancing RPG with external SQL stored procedures
Introduction to SQLRPGLE on IBM i: Making a report
Making the most of RPG data handling on IBM i
IBM i shop boosts online sales with RPG-based Web platform
Migrating from RPG to EGL on IBM i
Allow access to data from a stored procedure result set using COBOL or RPG
EGL Rich UI on IBM i: Do you Dojo?
Programming for the Web on the IBM i, what is possible
A taste of COMMON: ILE, IBM releases, Web applications and new products
Documenting nested program structures on the AS/400

iSeries ILE programming
Tracking data changes on IBM i with triggers
Introduction to SQLRPGLE on IBM i: Making a report
How to use an embedded SQL statement and display the result in a subfile
Eight steps for creating program documentation using AS/400 utilities
Searching fields for values
Searching part of a name or address in AS/400
Top 10 programmer tips YTD
How to use the binder language to manage service programs -- Part 3: Examples and pitfalls
Top 10 programmer tips of 2005
How to use the binder language to manage service programs -- Part 2: Understanding the binder language

iSeries COBOL programming
Implementing a browser interface in COBOL: Displaying database fields
Implementing a browser interface in COBOL: Creating your graphic Web page
Implementing a browser interface in COBOL: Getting started
Allow access to data from a stored procedure result set using COBOL or RPG
Eight steps for creating program documentation using AS/400 utilities
Coloring source lines with COBOL and using a shortcut from within PDM
Top 10 programmer tips YTD
Slow system performance
Changing the font size
New option within the WRKSYSACT command
iSeries COBOL programming Research

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Report Program Generator  (Search400.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



iSeries Networking - Printing, Remote Access, TCP/IP
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts