fhg
Volume 7, Number 9 -- March 7, 2007

Multiple Display Files in One Program

Published: March 7, 2007

G'Day, Ted:

I have a client that has many old apps running in the S/36 Execution Environment. I had converted one of the inquiry programs into an ILE RPG program, keeping the program-described workstation definition, so that I could easily call this program from other programs. After some time, it was decided that we needed to display some information in a subfile-like format from this program. Not wanting to go through all the hassle of defining all the input and output specifications, I tried something, and to my surprise, it worked.

I created a second workstation file containing just the subfile record and subfile control formats and added the second workstation file to the program without any problems! In fact, what happens is that the top section of the screen is output through the original workstation file and then the subfile overlays this screen. Using this technique has saved my client the expense of paying me to convert all the screens in the original program to external definitions and yet allows me to give them subfiles.

--Steve


Steve is one of Four Hundred Guru's Australian readers. I'm always glad to hear from him, as his comments and perspective are interesting.

Until Steve brought this experience to my attention, I had no idea that one module could have more than one workstation file. I created a short test program and was amazed to see it work. Truly, I learn something new every day.

Here's the first display file, QAD1282D1.

A                                      DSPSIZ(24 80 *DS3) 
A          R SCREEN1                                      
A                                  5  8'This is screen 1.'
A                                  7  8'Enter your name:' 
A            NAME          10   I  7 26

And here's the second display file, QAD1282D2.

A                                      DSPSIZ(24 80 *DS3)  
A          R SCREEN2                                       
A                                      OVERLAY             
A                                 10  8'This is screen 2.' 
A                                 12  8'Enter your age:'   
A            AGE            3  0I 12 26                    
A          R DUMMY                                         
A                                      KEEP ASSUME         
A                                  1  2' '

And here's RPG program QAD1282R, which drives them.

FQAD1282D1 CF   F   80        WORKSTN                    
FQAD1282D2 CF   E             WORKSTN                    
                                                         
IQAD1282D1 NS                                            
I                                  1   10  SNAME         
                                                         
C                   CLEAR                   SNAME        
C                   CLEAR                   AGE          
C                   MOVE      *ON           *INLR        
C                   EXCEPT    S1                         
C                   READ      QAD1282D1                  
C                   EXFMT     SCREEN2                    
C                   RETURN                               
                                                         
OQAD1282D1 E            S1                               
O                                        K8    'SCREEN1 '

When I call the RPG program, I am prompted for my name. After pressing Enter, I am prompted for my age. Both screens are visible at the same time.

Let me point out a few items of note.

  • Even though the two display files are visible at once, the operator can only key into the second one.
  • I had to add the DUMMY format to the second display file in order to keep it from wiping out SCREEN1.
  • I did not try to duplicate Steve's situation exactly. That is, I did not put a subfile in the second display file. But I did at least use a program-described first display file.

Many thanks to Steve for bringing this technique to my attention.

--Ted



                     Post this story to del.icio.us
               Post this story to Digg
    Post this story to Slashdot


Sponsored By
HELP/SYSTEMS

SEQUEL can be used for
virtually ALL business intelligence functions
on the System i, including:

                                                    · Executive Dashboards
                                                    · Graphical Query & Reporting
                                                    · Drill-Down Data Analysis
                                                    · Multi-Platform Database Support
                                                    · E-Mail Report and File Distribution
                                                    · Secure Web Access

SEQUEL is the single solution for all
your business intelligence needs.

www.helpsystems.com


Senior Technical Editor: Ted Holt
Technical Editors: Howard Arner, Joe Hertvik, Shannon O'Donnell, Kevin Vandever
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Brian Kelly, Marc Logemann, David Morris
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

Sponsored Links

Bytware:  StandGuard Network Security 3.0, the next generation of System i security
COMMON:  Join us at the 2007 conference, April 29 – May 3, in Anaheim, California
Profound Logic Software:  Experience RPGsp - the #1 iSeries Web development tool


IT Jungle Store Top Book Picks

The System i Pocket RPG & RPG IV Guide: List Price, $69.95
The iSeries Pocket Database Guide: List Price, $59.00
The iSeries Pocket Developers' Guide: List Price, $59.00
The iSeries Pocket SQL Guide: List Price, $59.00
The iSeries Pocket Query Guide: List Price, $49.00
The iSeries Pocket WebFacing Primer: List Price, $39.00
Migrating to WebSphere Express for iSeries: List Price, $49.00
iSeries Express Web Implementer's Guide: List Price, $59.00
Getting Started with WebSphere Development Studio for iSeries: List Price, $79.95
Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
Getting Started with WebSphere Express for iSeries: List Price, $49.00
WebFacing Application Design and Development Guide: List Price, $55.00
Can the AS/400 Survive IBM?: List Price, $49.00
The All-Everything Machine: List Price, $29.95
Chip Wars: List Price, $29.95

 

The Four Hundred
What's IBM Cooking Up for RPG and the Web?

System i Marketeer Chats with iSociety Members

Midrange Boxes, Big Iron Drive Server Growth in Q4 2006

The X Factor: How Many Servers, How Much Juice, How Much Money?

The Linux Beacon
Red Hat Readies RHEL 5 for March 14 Launch

Novell Gets Pinched By Rising Costs, Falling Sales

Midrange Boxes, Big Iron Drive Server Growth in Q4 2006

The X Factor: How Many Servers, How Much Juice, How Much Money?

Four Hundred Stuff
VAI Says 'No Thanks' to the Quick Buck

nCipher Brings Key Management Software to i5/OS

Vision Taps SteelEye for Windows, Linux HA on iSeries

Business Objects Unveils Two BI Offerings for J.D. Edwards

Big Iron
DB2 for Mainframes Gets Native XML with V9.1 Release

Top Mainframe Stories From Around the Web

Chats, Webinars, Seminars, Shows, and Other Happenings

System i PTF Guide
March 3, 2007: Volume 9, Number 9

February 24, 2007: Volume 9, Number 8

February 17, 2007: Volume 9, Number 7

February 10, 2007: Volume 9, Number 6

February 3, 2007: Volume 9, Number 5

January 27, 2007: Volume 9, Number 4

The Windows Observer
Microsoft Competing Unfairly on Virtualization, VMware Says

Server Sales Up a Bit in 2006, But Q4 Looks a Bit Weak

Google Launches Business Applications

HP Buys Clustering Software Maker, Launches D2D Backup Solution

The Unix Guardian
Server Sales Up a Bit in 2006, But Q4 Looks a Bit Weak

HP's Unix Biz Is Flat in Fiscal Q1, Hurd Disappointed

Many Top Open Source Projects Still Lack Enterprise Support

The X Factor: How Many Servers, How Much Juice, How Much Money?

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

THIS ISSUE SPONSORED BY:

Help/Systems
IBS
The RPG & DB2 Summit



TABLE OF CONTENTS
Multiple Display Files in One Program

Three Little Words That Simplify Debugging

Admin Alert: Better Subsystem Throughput Via Multiple Job Queues, Part Two

Four Hundred Guru

BACK ISSUES

From the IT Jungle Forums
How to collect the object authorities in a PF

Printer override in CLP using QCMDEXC

How to install a network printer in the iSeries?

Referencing the key of current record

MCH5003 creating objects in library





 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement