• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Multiple Display Files in One Program

    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

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    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

    Transoft Brings German RPG-to-.NET Conversion Tool to U.S. VAI Says ‘No Thanks’ to the Quick Buck

    Leave a Reply Cancel reply

Volume 7, Number 9 -- March 7, 2007
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

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Liam Allan Shares What’s Coming Next With Code For IBM i
  • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
  • VS Code Will Be The Heart Of The Modern IBM i Platform
  • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
  • IBM i PTF Guide, Volume 27, Number 25
  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle