Skip to main content

Problem:

This example illustrates how character mode screen data can be scrolled using call-by-number routine X"A7", functions 4 and 5.

Resolution:

INTRODUCTION

==========

This example illustrates how character mode screen data can be scrolled using call-by-number routine X"A7", functions 4 and 5. It also illustrates how to use the FileType Compiler directive to create and traverse a truly temporary file (FileType"14"). Neither of these facilities are currently documented in NetExpress documentation. In addition "mode is block" is used to display a record definition that contains "filler" or "unnamed" item definitions. And the User Attribute is used to control the screen colors when the program is executed.

SOURCE FILES:

=========

Program Files         Description

-------------------     -----------------------------------------------------------

Scroll.cbl                 Example program that illustrates Character mode scrolling capability

                               provided by call-by-number routine X"A7", functions 4 and 5.

Doc Files:                Description

-------------------     -----------------------------------------------------------

A7Docs.txt            The missing documentation on X"A7", functions 4 and 5?

OPERATION:

========

Run the program from within the IDE. The example program starts by requesting the name of an input file. Use the scroll.cbl source program file. What the program does is read the text file, displaying a portion of each record on the last line of the scroll window and scrolling the screen upwards one line at a time. In addition, a copy of each input record is written to a relative file with a record number as a key value. When the scroll window is filled, the program pauses to let you examine the appearance of the scroll window. Continuing to press the Enter key will cause the program to proceed towards the end of the file.

When the end of the input file is reached, the program reports this fact and pauses. You can continue to press the Enter key and the program will position at the end of the relative file and read previous, pausing for each file segment, through the file until the top of the file is reached. Each record read is written to the third line of the scroll window, and the screen is scrolled downwards one line at a time. When the top of the file is reached, this fact is reported and you can quit the program by pressing the Enter key one final time.

REFERENCES:

========

Call-by-number routine x'A7', functions 4 and 5

-----------------------------------------------

Refer to the A7Docs.txt file for the details regarding these functions. These particular functions of the x'A7' routine have not been documented in recent years, but they continue to work.

Compiler directive FileType"14" (Heap file)

-------------------------------------------

FileType option "14" is not currently documented in Net Express. It is, however, functional. I've copied the following from the sources noted.

From Workbench 3.4.23, dun3-2.txt

- - - - - - - - - - - - - - - - -

You specify FILETYPE"14" to use this file type, which is compatible with all file organizations.

Access to heap files is quicker than other file types since heap files are not paged to disk. Heap files are temporary; that is, once a heap file is closed, all data is lost. Therefore, you are recommended to use them for temporary storage of data only. Your program must explicitly move data to the heap file to be used.

From Workbench 4.0.38 COBOL On-line Reference, OLR.HLP

- - - - - - - - - - - - - - - - - - - - - - - - - - -

FILETYPE

Specifies the file format to use when creating files.

[/]FILETYPE"integer"

Parameters:

integer

        An integer representing the type to use.

Properties:

Default:        FILETYPE"0"

Phase:

        Syntax check

Environment:    All

$SET:           Any

Dependencies:

FILETYPE"<integer>" sets IDXFORMAT"<integer>" immediately.

Comments:

The possible values of <integer> are:

0       System-specific default (for this COBOL system,

        same as 3).

1       C-ISAM format.

2       Micro Focus Level II format.

3       The format used by this COBOL system.

4       An optimized form of the format used by this COBOL

        system, for fast duplicate key handling.

5       Btrieve format (with ANSI conformance emulation).

        (DOS, Windows and OS/2 only.)

6       Btrieve format (without ANSI conformance emulation). (DOS, Windows and OS/2 only.)

7       RLIO format indexed files

8-10    Reserved.

11      Mainframe print file format.

12-13   Reserved.

14      Heap file

15-255  Reserved.

Type 1 is available only in the 16-bit and the UNIX COBOL

systems.

Types 5 and 6 are available only in the 16-bit COBOL system

and the 32-bit COBOL system for OS/2 V2.

Type 7 is available only in 32-bit COBOL system for OS/2

V2.

Type 14 is available for all file organizations only in the

16-bit COBOL system, and for indexed files in the 32-bit

COBOL system for OS/2 V2.

This directive only works on files processed by the

Callable File Handler. Use the CALLFH directive if you are

processing files other than indexed files.

To produce print files in the style of an IBM mainframe

using FILETYPE"11", you must also:

o  

Set the directives OSVS or VCS2

o  

Use WRITE AFTER ADVANCING syntax

o  

Set the CALLFH directive (so your program uses the

        Callable File Handler)

o  

Use a SELECT statement in the form:

    select printfile assign "print"

                     organization is sequential.

(Print files in the style of an IBM mainframe have print

control character in the first column.)

See also:

ADV Compiler directive

CALLFH Compiler directive

Related Topics:

Format of Your Data Files

Mode Is Block

-------------

NetExpress Bookshelf: Open NetExpress Bookshelf, Open

                      Language Reference, click " "

                      adjacent to Chapter 12 Procedure

                      Division - ACCEPT - DIVIDE, click

                      12.13 The DISPLAY Statement, scroll

                      down to General Rules, Format 3 and

                      read rules 18 and 19.

User Attribute

--------------

The User attribute is actually a display attribute.

"Display Attributes" documentation is another item of

documentation missing from the NetExpress documentation.

The table below identifies the hexadecimal value for each

of the eight background colors and sixteen foreground

colors.

    _____________________________________________________

   |Background Colors|         Foreground Colors         |

   |                 |     Normal           Intense      |

   |. . . . . . . . .|. . . . . . . . . . . . . . . . . .|

   |  0  black       |  0  black       8  dark grey      |

   |  1  blue        |  1  blue        9  light blue     |

   |  2  green       |  2  green       A  light green    |

   |  3  cyan        |  3  cyan        B  light cyan     |

   |  4  red         |  4  red         C  light red      |

   |  5  magenta     |  5  magenta     D  light magenta  |

   |  6  brown       |  6  brown       E  yellow         |

   |  7  light grey  |  7  light grey  F  white          |

    -----------------------------------------------------

A black background (0) with white foreground (F) characters

would be the hexadecimal value "0F" (h'0F'). A blue

background (1) with yellow foreground (E) characters would

be hexadecimal "1E" (h'1E').

The brown color, under 32bit Windows, has changed to a

color resembling a dark chartreuse or pale ochre, depending

on how you see these colors.

Blinking foreground characters, which could be specified by

using the Intense Foreground color hexadecimal values as

the background color, is not supported under 32bit Windows.

==========================================================

Keywords: demonstration, sample, example, demo, scroll.zip

demo.ex

demo.ne

Attachments:

scroll.zip

Old KB# 4023