Sidebar

Turbocharge Remote Applications

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

Brief: Remote access to the AS/400 can be painfully slow. This article describes a simple programming technique that can significantly improve response time.

Applications running on remote workstations generally have much slower response times than those running on locally attached workstations. If you've ever worked on a remotely attached workstation, you know what I'm talking about. You can actually watch the screen "paint," several lines at a time, from the top of the screen to the bottom. Even with today's faster modem speeds and data- compression algorithms, running an application on a remote workstation can be a frustrating experience.

Fortunately, there are a few DDS keywords which can help improve the response time of applications running under these conditions. I'll show you how you can code your display files to reduce the amount of data being sent to a workstation. The application screens will look the same to the end user, but they will refresh much more quickly. To prove this, I ran a test by dialing in to MC's AS/400 at 9600bps. I ran a typical application program twice. The first time, the display file did not contain any of the keywords discussed in this article. My response time was around 3 seconds per transaction. By adding these keywords to the display file, my response time improved to almost 1 second per transaction!

Even if you currently do not have any remote users accessing your applications, you may still want to use this technique. Response time for local users would improve slightly, though probably not noticeably. However, you would be better prepared to meet the growing demand for remote access to AS/400 applications in the future.

The Problem

Most applications are not written with the remote user in mind. It's not too difficult to understand why this happens. Programmers usually have an office located near the computer room. They develop applications on locally attached workstations; when they test the applications, they find that the response time is very good. When a remote user runs this same application, the response time is unacceptably slow. If the user complains, the programmer usually blames the communications hardware for the poor response time. After all, everyone knows that remote connections through modems are slower than local connections. A simple display file programming technique can improve re-sponse time for applications run by remote users. I've developed a sample application that shows how to accomplish this.

A Typical Example

A typical application screen consists of a number of fields and constants. Often, the same screen needs to be presented to a user more than once. For example, consider the customer inquiry screen shown in 1. When the user selects a customer number, he is presented with the customer name and address. He selects another customer number and obtains a different name and address in the same screen format. Each time the user makes a selection, he sees the same screen with different names and addresses.

A typical application screen consists of a number of fields and constants. Often, the same screen needs to be presented to a user more than once. For example, consider the customer inquiry screen shown in Figure 1. When the user selects a customer number, he is presented with the customer name and address. He selects another customer number and obtains a different name and address in the same screen format. Each time the user makes a selection, he sees the same screen with different names and addresses.

Now think about what happens internally when this application is run. Every time the user selects a new customer number, OS/400 sends all of the fields and constants to the user's workstation. The fields containing customer information need to be sent each time, since they're changing for each customer. But what about the constants? They don't change from one customer to the next. Even though the constants are already on the screen, OS/400 sends them anyway. This causes more data to be sent than necessary. With a remote workstation, this unnecessary transmission of data can degrade response time noticeably.

To make matters worse, an attribute byte precedes every field and constant on the screen. These bytes control screen attributes such as normal, high intensity and reverse image. These bytes are also sent to the workstation, adding to the traffic on the line.

DDS to the Rescue

DDS gives you an effective way to deal with this situation. By adding a few keywords to your display file, you can control which fields, constants and attributes OS/400 sends to the workstation. Instead of sending the whole screen, you can send only the portions of the screen which have changed since the last time the screen was sent.

To make this technique work, place the Put with Explicit Override (PUTOVR) keyword at the record level of your display file. This prevents the transmission of constants, fields and attributes after the first write of the display file record. On all subsequent writes of this record, OS/400 will send the fields or attributes only if they are explicitly overridden.

To override a field, specify the Override Data (OVRDTA) keyword on the field you want to override. This keyword causes OS/400 to send both the field and its attribute to the workstation. Specify the Override Attribute (OVRATR) keyword on a field or constant to override an attribute. This causes only the attribute byte to be sent. 2 provides an overview of the data sent to the workstation when these keywords are applied.

To override a field, specify the Override Data (OVRDTA) keyword on the field you want to override. This keyword causes OS/400 to send both the field and its attribute to the workstation. Specify the Override Attribute (OVRATR) keyword on a field or constant to override an attribute. This causes only the attribute byte to be sent. Figure 2 provides an overview of the data sent to the workstation when these keywords are applied.

As with most DDS keywords, there are a few restrictions. First, you can't use the PUTOVR keyword in a subfile record, or in a record format which contains the PUTRETAIN keyword (a similar but less effective keyword than PUTOVR). One final restriction: you can't specify OVRDTA on a constant. Now that you know when not to use these keywords, let's look at an example which shows how you can use them.

3 shows the DDS for the display file used in the customer inquiry application discussed earlier. To keep this example simple, I've used only the PUTOVR and OVRDTA keywords. (OVRATR appears in a later example.)

Figure 3 shows the DDS for the display file used in the customer inquiry application discussed earlier. To keep this example simple, I've used only the PUTOVR and OVRDTA keywords. (OVRATR appears in a later example.)

The PUTOVR keyword is only in effect if the record is already on the display. The first time the RMTDSP record is written, the system automatically ignores the PUTOVR keyword-all fields and constants are sent to the workstation. When the user enters a customer number, the program loads the screen fields with customer information and resends the RMTDSP record. This time, the record is already displayed on the screen, so the PUTOVR keyword is active. PUTOVR keeps OS/400 from sending constants, such as the heading and field prompts. Instead, the screen simply retains the constants from the first write of the record format. OS/400 resends to the workstation only those fields which have the OVRDTA keyword specified (in this example, the customer address information). Sending only those fields decreases the amount of data transmitted which substantially improves response time.

Sending Attributes

The sample display file in 1 contains no special attributes, but most display files are more complex than this. For example, you may need to change a display attribute to high intensity or reverse image to alert the user to an error condition. You can use the OVRATR keyword to accomplish this.

The sample display file in Figure 1 contains no special attributes, but most display files are more complex than this. For example, you may need to change a display attribute to high intensity or reverse image to alert the user to an error condition. You can use the OVRATR keyword to accomplish this.

4 shows some partial DDS for another display file. This example contains one constant and one field. The constant, 'Status code', is displayed as either normal or high intensity, depending on the condition of indicator 30. The STSCDE field is displayed as normal or reverse image, depending on the condition of indicator 40. I've coded the OVRATR keyword in both cases, to point out the effect it has on display file efficiency.

Figure 4 shows some partial DDS for another display file. This example contains one constant and one field. The constant, 'Status code', is displayed as either normal or high intensity, depending on the condition of indicator 30. The STSCDE field is displayed as normal or reverse image, depending on the condition of indicator 40. I've coded the OVRATR keyword in both cases, to point out the effect it has on display file efficiency.

Assume that both indicators are off when the program is called. The program ignores the PUTOVR keyword the first time the record format is written to the screen. The constants, fields, and attributes are all sent to the workstation. Since OVRATR is specified on the 'Status code' constant, OS/400 resends the constant's attribute byte to the workstation for every subsequent write of the record format. When indicator 30 is off, the normal attribute is sent. When indicator 30 is on, the high-intensity attribute is sent. In either case, the constant itself is not resent to the workstation.

The STSCDE field behaves in a similar fashion. Since the OVRATR keyword is specified, the attribute byte for the field is always sent to the workstation. In this case, when indicator 40 is off, the normal attribute is sent. When indicator 40 is on, the reverse-image attribute is sent. STSCDE is an input- capable field, making it unnecessary to resend the contents of the field to the workstation. (Since the user supplies the value for this field, the program can simply leave the value on the screen unmodified.) Therefore, I used the OVRATR keyword instead of the OVRDTA keyword.

Changing screen attributes with this technique can be extremely efficient. A screen containing 24 rows and 80 columns could contain as many as 1920 bytes of data. If you need to change one attribute on a crowded screen, the difference in response times with and without this technique can be substantial.

Remember Your Remote Users

The technique described in this article can give remote users much better response time with very little effort on your part. DDS gives you the ability to decide how much data to send to a workstation. It's up to you to take advantage of this capability. If you keep these techniques in mind when you code your applications, you will reduce not only the amount of traffic on the communication line but also the frustration level of your remote users.

Robin Klima is a senior technical editor at Midrange Computing.

REFERENCES DDS Reference (SC41-9620, CD-ROM QBKA7402). Guide to Programming Displays (SC41-0011, CD-ROM QBKA7902).


Turbocharge Remote Applications

Figure 1 Customer Inquiry Screen

 Customer Inquiry Customer number . . . 53157 Customer name . . . . GEORGE HENDERSON Address . . . . . . . 938 PALM DR City . . . . . . . . LOS ANGELES State . . . . . . . . CA Zip code . . . . . . 90846 F3=Exit 
Turbocharge Remote Applications

Figure 2 Data Sent on Subsequent Writes

 UNABLE TO REPRODUCE GRAPHICS 
Turbocharge Remote Applications

Figure 3 Example Using OVRDTA Keyword

 *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 A R RMTDSP A PUTOVR A 1 33'Customer Inquiry' A DSPATR(HI) A 5 2'Customer number . . .' A CSNUM 5 B 5 25 A 7 2'Customer name . . . .' A CSNAME 25 O 7 25 A OVRDTA A 9 2'Address . . . . . . .' A CSADDR 25 O 9 25 A OVRDTA A 11 2'City . . . . . . . .' A CSCITY 15 O 11 25 A OVRDTA A 13 2'State . . . . . . . .' A CSSTAT 2 O 13 25 A OVRDTA A 15 2'Zip code . . . . . .' A CSZIP 5 O 15 25 A OVRDTA A 23 2'F3=Exit' A COLOR(BLU) *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
Turbocharge Remote Applications

Figure 4 Example Using OVRATR Keyword

 *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 A R RMTDSP A PUTOVR A 5 2'Status code' A OVRATR A 30 DSPATR(HI) A STSCDE 1 B 5 15 A OVRATR A 40 DSPATR(RI) *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

RESOURCE CENTER

  • WHITE PAPERS

  • WEBCAST

  • TRIAL SOFTWARE

  • White Paper: Node.js for Enterprise IBM i Modernization

    SB Profound WP 5539

    If your business is thinking about modernizing your legacy IBM i (also known as AS/400 or iSeries) applications, you will want to read this white paper first!

    Download this paper and learn how Node.js can ensure that you:
    - Modernize on-time and budget - no more lengthy, costly, disruptive app rewrites!
    - Retain your IBM i systems of record
    - Find and hire new development talent
    - Integrate new Node.js applications with your existing RPG, Java, .Net, and PHP apps
    - Extend your IBM i capabilties to include Watson API, Cloud, and Internet of Things


    Read Node.js for Enterprise IBM i Modernization Now!

     

  • Profound Logic Solution Guide

    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 companyare not aligned with the current IT environment.

    Get your copy of this important guide today!

     

  • 2022 IBM i Marketplace Survey Results

    Fortra2022 marks the eighth edition of the IBM i Marketplace Survey Results. Each year, Fortra captures data on how businesses use the IBM i platform and the IT and cybersecurity initiatives it supports.

    Over the years, this survey has become a true industry benchmark, revealing to readers the trends that are shaping and driving the market and providing insight into what the future may bring for this technology.

  • Brunswick bowls a perfect 300 with LANSA!

    FortraBrunswick is the leader in bowling products, services, and industry expertise for the development and renovation of new and existing bowling centers and mixed-use recreation facilities across the entertainment industry. However, the lifeblood of Brunswick’s capital equipment business was running on a 15-year-old software application written in Visual Basic 6 (VB6) with a SQL Server back-end. The application was at the end of its life and needed to be replaced.
    With the help of Visual LANSA, they found an easy-to-use, long-term platform that enabled their team to collaborate, innovate, and integrate with existing systems and databases within a single platform.
    Read the case study to learn how they achieved success and increased the speed of development by 30% with Visual LANSA.

     

  • The Power of Coding in a Low-Code Solution

    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:

    • Discover the benefits of Low-code's quick application creation
    • Understand the differences in model-based and language-based Low-Code platforms
    • Explore the strengths of LANSA's Low-Code Solution to Low-Code’s biggest drawbacks

     

     

  • Why Migrate When You Can Modernize?

    LANSABusiness 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.
    In this white paper, you’ll learn how to think of these issues as opportunities rather than problems. We’ll explore motivations to migrate or modernize, their risks and considerations you should be aware of before embarking on a (migration or modernization) project.
    Lastly, we’ll discuss how modernizing IBM i applications with optimized business workflows, integration with other technologies and new mobile and web user interfaces will enable IT – and the business – to experience time-added value and much more.

     

  • UPDATED: Developer Kit: Making a Business Case for Modernization and Beyond

    Profound Logic Software, Inc.Having trouble getting management approval for modernization projects? The problem may be you're not speaking enough "business" to them.

    This Developer Kit provides you study-backed data and a ready-to-use business case template to help get your very next development project approved!

  • What to Do When Your AS/400 Talent Retires

    FortraIT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators is small.

    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:

    • Why IBM i skills depletion is a top concern
    • How leading organizations are coping
    • Where automation will make the biggest impact

     

  • Node.js on IBM i Webinar Series Pt. 2: Setting Up Your Development Tools

    Profound Logic Software, Inc.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. In Part 2, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Attend this webinar to learn:

    • Different tools to develop Node.js applications on IBM i
    • Debugging Node.js
    • The basics of Git and tools to help those new to it
    • Using NodeRun.com as a pre-built development environment

     

     

  • Expert Tips for IBM i Security: Beyond the Basics

    SB PowerTech WC GenericIn this session, IBM i security expert Robin Tatam provides a quick recap of IBM i security basics and guides you through some advanced cybersecurity techniques that can help you take data protection to the next level. Robin will cover:

    • Reducing the risk posed by special authorities
    • Establishing object-level security
    • Overseeing user actions and data access

    Don't miss this chance to take your knowledge of IBM i security beyond the basics.

     

     

  • 5 IBM i Security Quick Wins

    SB PowerTech WC GenericIn today’s threat landscape, upper management is laser-focused on cybersecurity. You need to make progress in securing your systems—and make it fast.
    There’s no shortage of actions you could take, but what tactics will actually deliver the results you need? And how can you find a security strategy that fits your budget and time constraints?
    Join top IBM i security expert Robin Tatam as he outlines the five fastest and most impactful changes you can make to strengthen IBM i security this year.
    Your system didn’t become unsecure overnight and you won’t be able to turn it around overnight either. But quick wins are possible with IBM i security, and Robin Tatam will show you how to achieve them.

  • Security Bulletin: Malware Infection Discovered on IBM i Server!

    SB PowerTech WC GenericMalicious programs can bring entire businesses to their knees—and IBM i shops are not immune. It’s critical to grasp the true impact malware can have on IBM i and the network that connects to it. Attend this webinar to gain a thorough understanding of the relationships between:

    • Viruses, native objects, and the integrated file system (IFS)
    • Power Systems and Windows-based viruses and malware
    • PC-based anti-virus scanning versus native IBM i scanning

    There are a number of ways you can minimize your exposure to viruses. IBM i security expert Sandi Moore explains the facts, including how to ensure you're fully protected and compliant with regulations such as PCI.

     

     

  • Encryption on IBM i Simplified

    SB PowerTech WC GenericDB2 Field Procedures (FieldProcs) were introduced in IBM i 7.1 and have greatly simplified encryption, often without requiring any application changes. Now you can quickly encrypt sensitive data on the IBM i including PII, PCI, PHI data in your physical files and tables.
    Watch this webinar to learn how you can quickly implement encryption on the IBM i. During the webinar, security expert Robin Tatam will show you how to:

    • Use Field Procedures to automate encryption and decryption
    • Restrict and mask field level access by user or group
    • Meet compliance requirements with effective key management and audit trails

     

  • Lessons Learned from IBM i Cyber Attacks

    SB PowerTech WC GenericDespite the many options IBM has provided to protect your systems and data, many organizations still struggle to apply appropriate security controls.
    In this webinar, you'll get insight into how the criminals accessed these systems, the fallout from these attacks, and how the incidents could have been avoided by following security best practices.

    • Learn which security gaps cyber criminals love most
    • Find out how other IBM i organizations have fallen victim
    • Get the details on policies and processes you can implement to protect your organization, even when staff works from home

    You will learn the steps you can take to avoid the mistakes made in these examples, as well as other inadequate and misconfigured settings that put businesses at risk.

     

     

  • The Power of Coding in a Low-Code Solution

    SB PowerTech WC GenericWhen 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:

    • Discover the benefits of Low-code's quick application creation
    • Understand the differences in model-based and language-based Low-Code platforms
    • Explore the strengths of LANSA's Low-Code Solution to Low-Code’s biggest drawbacks

     

     

  • The Biggest Mistakes in IBM i Security

    SB Profound WC Generic The Biggest Mistakes in IBM i Security
    Here’s the harsh reality: cybersecurity pros have to get their jobs right every single day, while an attacker only has to succeed once to do incredible damage.
    Whether that’s thousands of exposed records, millions of dollars in fines and legal fees, or diminished share value, it’s easy to judge organizations that fall victim. IBM i enjoys an enviable reputation for security, but no system is impervious to mistakes.
    Join this webinar to learn about the biggest errors made when securing a Power Systems server.
    This knowledge is critical for ensuring integrity of your application data and preventing you from becoming the next Equifax. It’s also essential for complying with all formal regulations, including SOX, PCI, GDPR, and HIPAA
    Watch Now.

  • Comply in 5! Well, actually UNDER 5 minutes!!

    SB CYBRA PPL 5382

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

    Request your trial now!

  • Backup and Recovery on IBM i: Your Strategy for the Unexpected

    FortraRobot automates the routine 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:
    - Simplified backup procedures
    - Easy data encryption
    - Save media management
    - Guided restoration
    - Seamless product integration
    Make sure your data survives when catastrophe hits. Try the Robot Backup and Recovery Solution FREE for 30 days.

  • Manage IBM i Messages by Exception with Robot

    SB HelpSystems SC 5413Managing messages on your IBM i can be more than a full-time job if you have to do it manually. 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:
    - Automated message management
    - Tailored notifications and automatic escalation
    - System-wide control of your IBM i partitions
    - Two-way system notifications from your mobile device
    - Seamless product integration
    Try the Robot Message Management Solution FREE for 30 days.

  • Easiest Way to Save Money? Stop Printing IBM i Reports

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

    - Automated report distribution
    - View online without delay
    - Browser interface to make notes
    - Custom retention capabilities
    - Seamless product integration
    Rerun another report? Never again. Try the Robot Report Management Solution FREE for 30 days.

  • Hassle-Free IBM i Operations around the Clock

    SB HelpSystems SC 5413For over 30 years, Robot has been a leader in systems management for IBM i.
    Manage your job schedule with the Robot Job Scheduling Solution. Key features include:
    - Automated batch, interactive, and cross-platform scheduling
    - Event-driven dependency processing
    - Centralized monitoring and reporting
    - Audit log and ready-to-use reports
    - Seamless product integration
    Scale your software, not your staff. Try the Robot Job Scheduling Solution FREE for 30 days.