Home > AS/400 Tips > iSeries administrator tips > How to save, restore the screen -- the quick and easy way
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES ADMINISTRATOR TIPS

How to save, restore the screen -- the quick and easy way


Ron Turull
11.24.2004
Rating: -3.80- (out of 5)


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



[TABLE]

In the last installment, I introduced you to Dynamic Screen Manager (DSM). This time we turn our attention to a couple of DSM APIs. These two APIs can be used to take a "snapshot" of the screen, save it and restore it later using the saved data. One of the ways this can be used is in the following situation, drawn from personal experience.

An RPG program calls a CL program, which in turn executes the STRPCCMD command. The STRPCCMD runs a command on the PC and leaves the screen completely blank. After returning, the RPG program does considerable processing before doing another write to the screen (e.g., EXFMT). During this time the screen remains blank, and the user may get the impression that the PC is hung.

Objective: Have the RPG program restore its screen after receiving control back from the CL program.

We do not want to use RSTDSP(*YES) on the CRTDSPF command because it can cause performance problems. Nor do we want to execute an RPG WRITE operation to the screen because it


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


RELATED CONTENT
iSeries system performance and monitoring
Translating Linux for IBM i admins: Working with jobs and networking
Database performance comparisons on IBM i
How to: Monitoring job activity on the AS/400
Performance tuning for IBM i: The basics and beyond
How to: Reduce the percentage of ASP used on the AS/400
Detecting system changes made by outside IP address
AS/400 system values quiz
Checking on System i disk space requires creating a new command: XRTVSYSSTS
Drive space management commands
Viewing netstat information

iSeries CL programming
Checking in on your IBM i authorization lists
Running PHP open source applications: NOBODY needs authority
Simplify the process of converting a spool file from iSeries into an Excel spreadsheet
CL program for daily backups
An automated CL method of moving a query from AS/400 to Excel
Changing user password expiration
Eight steps for creating program documentation using AS/400 utilities
DAYSPAST CLLE program for AS/400: Compares object creation date with today's date
Advanced Job Scheduler help
How do I retrieve the source for an output queue description to put in to a CL program?

iSeries ILE programming
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
How to use the binder language to manage service programs -- Part 1: Service program signatures
Display attributes made simple

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
CIW  (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


requires the use DFRWRT(*NO) on the CRTDSPF command, which can greatly complicate matters.

Solution: Use the Save Screen API (QsnSavScr) to take the snapshot and save the screen before calling the program that alters the screen. After the program returns, use the Put Buffer API (QsnPutBuf) to restore the screen. The following partial RPG code listing shows the ease of using this technique.

The Save Screen API stores a buffer handle (i.e., buffer identifier) in the Buffer parameter. The buffer it identifies (which is managed internally by DSM) will contain the data necessary to restore the screen -- the snapshot. The Put Buffer API writes the data saved in the buffer to the screen. Note: If you compile and run this program, you will see the screen flash.

Here are six points to remember:

-----------------------------------
About the author: Ron Turull is editor of Inside Version 5. He has more than 20 years' experience programming for and managing AS/400-iSeries systems.


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
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