Input/Output Devices

#### Search Results

Search

# Input/Output Devices

This document provides some additional information on input/output devices supported by Natural.

This section covers the following topics:

- Terminal Support

- Light Pen Support

- Printer Support

## Terminal Support

Natural supports a wide variety of terminal types for the use with mainframe computers. In TP monitor environments in which the terminal type information is not supplied automatically to Natural, you can use the Natural profile parameter `TTYPE` so that Natural can activate the appropriate converter routine to operate a specific type of terminal.

Links to related topics:

- NTDVCE - Terminal-Device Specification Table

- Terminal Communication - Profile Parameters Grouped by Function (Parameter Reference documentation)

- NATCONFG Module (various I/O translation topics)

- Natural Terminal Commands

## Light Pen Support

The support of light pens has been enhanced by the terminal command `%RM`. This command causes all light-pen-sensitive fields on the screen to be made write-protected; that is, the user can select them with a light pen, but cannot overwrite their contents.

For a field to be light-pen sensitive, it must be displayed intensified (session parameter AD`=I`) or blinking (`AD=B`), and the first character of the field must be a light-pen designator character (see below). Selecting a field with a light pen causes the designator character to be changed; therefore, you can make the processing of fields selected with a light pen dependent on the values of the designator characters.

The following designator characters are available:

Character | Meaning
--- | ---
`?` | You can select multiple fields before pressing ENTER.
`>` | It was selected and if it is selected again, it becomes a question mark `?`; the characters `?` and `>` will toggle.
`&` | You can select only one field and it will be as an ENTER for both the field and the MDT (modified data tag).
`' '` (blank) | You can select only one field and you will only see the MDT.

As designator characters, you have to distinguish selection fields (`?`, `>`) and attention fields (`&`, blank or null). Selection fields do not start an immediate data transmission, so you are able to select more than one field. Attention fields result in an immediate action.

The SELECT CURSOR key emulates a light-pen selection. If you move the cursor to the field you want to select and press SELECT CURSOR, this field will be selected.

### Sample Natural Program for Light Pen Usage

    RESET #FIELD-1 (A8)
      #FIELD-2 (A8) #FIELD-3 (A8) #CV-1 (C) #CV-2 (C) #CV-3 (C)
    SET KEY ALL
    /* SET CONTROL 'RM' IS A TOGGLE. AFTER IT IS EXECUTED ONCE MAKE IT A
    /* COMMENT, SO THAT YOU DO NOT TOGGLE IT 'OFF'.
    **SET CONTROL 'RM'
    REPEAT
      IF *PF-KEY NOT = 'ENTR' AND *PF-KEY NOT = 'PEN' ESCAPE BOTTOM
      MOVE (AD=I CD=YE) TO #CV-1
      MOVE (AD=I CD=RE) TO #CV-2
      MOVE (AD=I CD=BL) TO #CV-3
      MOVE ' FIELD-1' TO #FIELD-1
      MOVE '&FIELD-2' TO #FIELD-2
      MOVE '?FIELD-3' TO #FIELD-3
      INPUT (SG=OFF IP=OFF)
        01/01 #FIELD-1 (CV=#CV-1 AD=M)
        03/01 #FIELD-2 (CV=#CV-2 AD=M)
        05/01 #FIELD-3 (CV=#CV-3 AD=M)
      WRITE 'PF-KEY =' *PF-KEY
      IF #CV-1 MODIFIED WRITE '#CV-1 MODIFIED' #FIELD-1
      IF #CV-2 MODIFIED WRITE '#CV-2 MODIFIED' #FIELD-2
      IF #CV-3 MODIFIED WRITE '#CV-3 MODIFIED' #FIELD-3
    LOOP
    END

## Printer Support

The following topics are covered:

- Printer-Advance Control Characters

- Natural Laser-Printer Support

### Printer-Advance Control Characters

Printer-advance control characters can be generated within a Natural program by using the `DEFINE PRINTER` statement as follows:

    ....
    DEFINE PRINTER (n) OUTPUT 'name'
    DEFINE PRINTER (n+1) OUTPUT 'CCONTROL'
    ....

Both `DEFINE PRINTER` statements work together so that all Natural output for the printer (`n`) follows the normal Natural report-output rules and all Natural output for the printer (`n`+1) is also written to the printer (`n`). Natural does not generate a printer-advance control character for this report. Therefore, the first character in the output variable is the control character.

With this method, it is possible to merge control characters for laser-printer systems and channel-advance characters for line printers in a normal Natural output report.

> Sample Natural Program for Printer-Advance Control Character

>       ...
>       DEFINE PRINTER (1) OUTPUT 'CMPRT01'
>       DEFINE PRINTER (2) OUTPUT 'CCONTROL'
>       WRITE (1) 'TEST'
>       WRITE (2) NOTITLE '+TEST'
>       MOVE H'5A' TO A(A1)
>       WRITE (2) A '....'
>       ...

>   The corresponding hexadecimal data in the spool file starting from column 0 are:

>       I..I..I..I..I..I..I..I..I..I..I..I..I..I..I
>       F1 E3 C5 E2 E3
>       1  T  E  S  T
>       4E E3 C5 E2 E3
>       +  T  E  S  T
>       5A ....

>   `CCONTROL` is the name of a special printer control table associated to the printer `n`-1; it must not be modified.

### Natural Laser-Printer Support

Natural supports IBM 3800 laser-printer systems.

The `DEFINE PRINTER` statement is used to control and allocate a report for the 3800 printer system. With this statement, you can specify that the Natural print output for report 1 is routed to a 3800 printer system.

    DEFINE PRINTER (1) OUTPUT 'LAS3800'
     I I => 1-31 for CMPRT01 to CMPRT31
     ....

Depending on the setting of the `INTENS` parameter, Natural repeats each line up to four times and recognizes the Natural attributes `AD=D`, `AD=I`, `AD=C` and `AD=V` (see session parameter `AD`).

The first line contains the ASA control code in the first column and the 3800-font control character (hexadecimal `F0`) for the first font in the second column. The columns 2 to `nnn` contain the print data which are not flagged with the attribute `AD=I`, `AD=C` or `AD=V`.

The second line contains the ASA control code `+` (for printing without line advance) in the first column and the 3800-font control character (hexadecimal `F1`) for the second font in the second column. The columns 2 to `nnn` contain the print data which are flagged with `AD=I`.

The third line contains the ASA control code `+` (for printing without line advance) in the first column and the 3800-font control character (hexadecimal F2) for the third font in the second column. The columns 2 to nnn contain the print data which are flagged with `AD=C`.

The fourth line contains the ASA control code `+` (for printing without line advance) in the first column and the 3800-font control character (hexadecimal `F3`) for the fourth font in the second column. The columns 2 to nnn contain the print data which are flagged with `AD=V`.

If `INTENS` is specified with a value less than 4, all non-supported fonts are printed with hexadecimal `F0`.

> Sample Natural Program for Laser Printer Usage

>       ....
>       DEFINE PRINTER (1) OUTPUT 'LAS3800'
>       WRITE (1) 'FIRST' 'SECOND' (AD=I) 'THIRD' (AD=C) 'FOURTH' (AD=V)
>       ....

>   The corresponding hexadecimal data in the spool file starting from column 0 are:

>       I..I..I..I..I..I..I..I..I..I..I..I..I..I..I..I..I..I..I..I..I..I..I
>       40 F0 C6 C9 D9 E2 E3 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 (hex)
>           0  F I R S T
>       4E F1 40 40 40 40 40 40 E2 C5 C3 E4 D5 C4 C4 40 40 40 40 40 40 40 (hex)
>       + 1                      S E C O N D
>       4E F2 40 40 40 40 40 40 40 40 40 40 40 40 40 E3 C8 C9 D9 D4 40 40 (hex)
>       + 2                                           T H I R D
>       4E F3 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 C5 (hex)
>       + 3                                                             F

> Sample JCL for Laser Printer Usage

>       ....
>       //xxxx JOB xxxxx,....
>       .
>       //xxxxx EXEC PGM= XXXXXX;......
>       .
>       // PARM='INTENS=4,XXXX,.......
>       .
>       .
>       //OUT1 OUTPUT PAGEDEF=XXXX,FORMDEF=XXXX,TRC=ON
>       .                      I             I
>       .                      I             I => 3800 form definition
>       .                      I
>       .                      I => 3800 page definition .
>       //CMPRT01 DD SYSOUT=Y
>       //        DCB=(RECFM=FBA,LRECL=133),OUTPUT=*,OUT1
>       //        CHARS=(WWWW,XXXX,YYYY, ZZZZ)
>                         I
>                         I => IBM font names
>       ...

### On this page

- Terminal Support
- Light Pen Support
- Printer Support