At 03:59 PM 10/18/97 -0400, you wrote:
>david.gibbs@silvon.com <devdmg on 17/10/97 17:41:58
>To: midrange-l <midrange-l@midrange.com> @ INTERNET
>cc:
>Subject: Redirecting workstation IO
>
>------- Forwarded Message Follows -------
>From: "Brad Sommerfeld" <Brad.Sommerfeld@Silvon.com>
>Date: Fri, 17 Oct 1997 14:47:24 +0000
>Subject: Help: need information on AS/400 functions
>Priority: normal
>
>Is anyone aware of a technique to override a workstation file in an
>RPG program to another type of file?
>
>By default, the read/write operations to a WORKSTN file are handled by
>the system. I would like to 're-direct' those read/writes to another
>program and talk to an RPG program as if my other program was the
>system display handler.
>
>One thought is to try and override the WORKSTN file with another file
>that another program is reading/writing to. There may also be API's
>to do this directly.
>
>I don't want to work with the 5250 data stream sent to the screen, but
>with the data in the WORKSTN file formats that is used to generate the
>5250 datastream.
>
>Any ideas? I have not searched IBM manuals yet. If you know where
>to look, that would be helpful also.
Here's the whole kielbasa, straight from the
OS/400 Application Display Programming manual, chapter 7:
2.6.8.2 Overriding Files with Different File Types
If you change to a different type of file, the device-dependent characteristics are ignored and records are read or written sequentially. Some device parameters must be specified in the new device file or the override. Defaults are taken for others. The effect of specific redirection combinations is described later in this section.
Any attributes specified on overrides of a different file type than the final file type are ignored. The parameters SPOOL, SHARE, and SECURE are exceptions to this rule. They will be accepted from any override applied to the file, regardless of device type.
Some redirection combinations present special problems due to the specific characteristics of the device. In particular:
File redirection is not recommended for save files.
Display files and ICF files that use multiple devices (MAXDEV or MAXPGMDEV > 1) can be redirected only to a display file or ICF file.
Redirecting a display file to any other file type, or another file type to a display file, requires that the program be recompiled with the override active if there are any input-only or output-only fields. This is necessary because the display file omits these fields from the record buffer in which they are not used, but other file types do not.
Table 7-1 summarizes valid file redirections:
___________________________________________________________________________
| Table 7-1. File Redirections |
|_____________ _____________________________________________________________|
| | From-File |
| |_________ __________ _________ __________ _________ _________|
| To-File | Printer | ICF | Diskette| Display | Database| Tape |
|_____________|_________|__________|_________|__________|_________|_________|
| Printer | O* | O | O | O | O | O |
|_____________|_________|__________|_________|__________|_________|_________|
| ICF | | I/O | | I/O | | |
| | O | O | O | O | O | O |
| | | I | I | I | I | I |
|_____________|_________|__________|_________|__________|_________|_________|
| Diskette | O | O | O | O | O | O |
| | | I | I | I | I | I |
|_____________|_________|__________|_________|__________|_________|_________|
| Display | | I/O | | I/O | | |
| | O | O | O | O | O | O |
| | | I | I | I | I | I |
|_____________|_________|__________|_________|__________|_________|_________|
| Database | O | O | O | O | O | O |
| | | I | I | I | I | I |
|_____________|_________|__________|_________|__________|_________|_________|
| Tape | O | O | O | O | O | O |
| | | I | I | I | I | I |
|_____________|_________|__________|_________|__________|_________|_________|
| Legend: |
| |
| I=input file |
| O=output file |
| I/O=input/output file |
| *=redirection to a different type of printer |
|___________________________________________________________________________|
To use this chart, identify the file type to be overridden in the FROM-FILE columns and the file type overriding in the TO-FILE column. The intersection specifies an I or O or both, meaning that the substitution is valid for these two file types when used as input files or as output files.
For instance, you can override a diskette output file with a tape output file, and a diskette input file with a tape input file. The chart refers to file type substitutions only. That is, you cannot change the program function by overriding an input file with an output file.
The following chart describes the specific defaults taken and what is ignored for each redirection combination involving display files:
________________________________________________________________________
| Table 7-2. File Redirection Combinations |
|______________ _____________ ___________________________________________|
| | | Specific Defaults Taken and What Is |
| From | To | Ignored |
|______________|_____________|___________________________________________|
| | | Records are written to the display with |
| | | each record overlaying the previous |
| | | record. For program-described files, you |
| | | can request each record using the Enter |
| | | key. Printer control information is |
| Printer | Display | ignored. |
|______________|_____________|___________________________________________|
| | | Records are retrieved from the display |
| | | one at a time. Type in the data for each |
| | | record and press the Enter key when the |
| ICF input | Display | record is complete. |
|______________|_____________|___________________________________________|
| | | Records are written to the display with |
| | | each record overlaying the previous |
| ICF output | Display | record. |
|______________|_____________|___________________________________________|
| | | Input records are retrieved from the |
| | | display one at a time. Type in the data |
| | | for each record and press the Enter key |
| | | when the record is complete. Output |
| | | records are written to the display with |
| | | each record overlaying the previous input |
| | | or output record. Input and output |
| | | records are essentially independent of |
| ICF | | each other and may be combined in any |
| input/output | Display | manner. |
|______________|_____________|___________________________________________|
| | | Records are retrieved from the display |
| | | one at a time. Type in the data for each |
| | | record and press the Enter key when the |
| | | record is complete. A non-field-level |
| Diskette | | display file must be specified. Diskette |
| input | Display | label information is ignored. |
|______________|_____________|___________________________________________|
| | | Records are written to the display with |
| | | each record overlaying the previous |
| Diskette | | record. You can request each output |
| output | Display | record using the Enter key. |
|______________|_____________|___________________________________________|
| Display | | Records are retrieved from the ICF file |
| input | ICF | one at a time. |
| |_____________|___________________________________________|
| | | Records are retrieved in sequential |
| | | order. Diskette label information must |
| | | be provided in the diskette file or on an |
| | Diskette | override command. |
| |_____________|___________________________________________|
| | Database | Input records are retrieved. |
| |_____________|___________________________________________|
| | | Records are retrieved in sequential |
| | | order. Tape label information must be |
| | | specified in the tape file or on an |
| | Tape | override command. |
|______________|_____________|___________________________________________|
| Display | | Records are written to the ICF file one |
| output | ICF | at a time. |
|______________|_____________|___________________________________________|
| | | Records are written to the database in |
| | Database | sequential order. |
|______________|_____________|___________________________________________|
| | | The amount of data written on diskette is |
| | | dependent on the exchange type of the |
| | | diskette. Diskette label information |
| | | must be provided in the diskette file or |
| | Diskette | on an override command. |
|______________|_____________|___________________________________________|
| | | Records are written on tape in sequential |
| | | order. Tape label information must be |
| | | specified in the tape file or on an |
| | Tape | override command. |
|______________|_____________|___________________________________________|
| | | Records are printed and folding or |
| | | truncating is performed as specified in |
| | Printer | the printer file. |
|______________|_____________|___________________________________________|
| Display | | |
| input/output | ICF | Input records are retrieved from the |
|______________|_____________|___________________________________________|
| | | Records are retrieved from the display |
| Database | | one at a time. Type in the data for each |
| input | | record and press the Enter key when the |
| (sequentially| | record is complete. A non-field-level |
| processed) | Display | display file must be specified. |
|______________|_____________|___________________________________________|
| Database | | Records are written to the display with |
| output | | each record overlaying the previous |
| (sequentially| | record. You can request each output |
| processed) | Display | record using the Enter key. |
|______________|_____________|___________________________________________|
| | | Records are retrieved from the display |
| | | one at a time. Type in the data for each |
| | | record and press the Enter key when the |
| | | record is complete. A non-field-level |
| | | display file must be specified. Tape |
| Tape input | Display | label information is ignored. |
|______________|_____________|___________________________________________|
| | | Records are written to the display with |
| | | each record overlaying the previous |
| | | record. You can request each output |
| Tape output | Display | record using the Enter key. |
|______________|_____________|___________________________________________|
Vernon Hamberg
Systems Software Programmer
Old Republic National Title Insurance Company
400 Second Avenue South
Minneapolis, MN 55401-2499
(612) 371-1111 x480
+--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to "MIDRANGE-L@midrange.com". | To unsubscribe from this list send email to MAJORDOMO@midrange.com | and specify 'unsubscribe MIDRANGE-L' in the body of your message. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.