classAnova - Knowledge Shared

Posted by: Bob Cozzi
IT Researcher
Cozzi Productions, Inc.
North Aurora, IL
System i Workstation Timeout Example
has no ratings.
Published: 08 Feb 2011
Revised: 04 Aug 2011 - 4143 days ago
Last viewed on: 07 Dec 2022 (6613 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

System i Workstation Timeout Example Published by: Bob Cozzi on 08 Feb 2011 view comments

How do I enable a "workstation time-out" feature in RPG?

There are five things required to provide a time-out option on any interactive workstation file. This capability allows an RPG program to receive control before an end-user presses a Function key or Enter. Some of the uses for this kind of function include:

  • Providing a marquee for a schedule via a subfile
  • Update the time displayed on the workstation at regular intervals 
  • Refresh the information, such as a news display, periodically

As mentioned, there are five things required to activate workstation time-out:

  1. Add the INVITE keyword to the Workstation display file DDS. This is a file-level keyword.
  2. Use the WAITRCD parameter of CRTDSPF to set the desired time-out period.
  3. Add the MAXDEV(*FILE) keyword to the File specification for the Workstation device file.
  4. Write the desired display file formats to the display using the normal methods.
  5. Use the READ operation code to read Display File name, not the Record format name.

You must avoid using EXFMT to the display file as this operation code does not support workstation time-out.

     FMarquee   CF   E             WORKSTN MAXDEV(*FILE)                       
     F                                     SFILE(detail:rrn)
     C                   Write     Header
     C                   Write     Footer
     C                   Do        12            rrn
     C                   Write     Detail
     C                   enddo
     C                   Write     SFLCTLFMT
     C                   Read      Marquee

Return to home page.
Sort Ascend | Descend