HP 3000 Manuals

Operation [ COBOL/HP-UX Operating Guide for the Series 700 and 800 ] MPE/iX 5.0 Documentation


COBOL/HP-UX Operating Guide for the Series 700 and 800

Operation 

The Forms-2 package is an extension to the Micro Focus COBOL software
development system that enables you to interactively create and edit data
entry 
screens for applications programs at a terminal.  The package provides
four powerful facilities to aid you in the design and development of
interactive applications written in Micro Focus COBOL:

   *   Translation 
       of user screen layouts into COBOL record descriptions for
       inclusion in Micro Focus COBOL applications programs.

   *    

       Verification of user screen layouts in a check-out program before
       their incorporation in an application program.

   *   Retention of exact screen images 
       of the user screens in disk files for subsequent editing and
       printing.

   *   Generation of an entire Micro Focus COBOL program to allow data
       capture, update and interrogation by means of application screens
       and an indexed sequential file.

Outputs.   

You can choose any valid combination of the above facilities and,
depending on the options you select, Forms-2 will automatically produce
some or all of the following four types of disk output file:

   *   A source file of Micro Focus COBOL Data Description Statements
       defining the screens (forms) that you have designed.  You can
       subsequently include these statements in a Micro Focus COBOL
       application program using the COPY verb.  The file is generated as
       file-name.DDS.

   *   A source file of a checkout program incorporating the Data
       Description Statements 
       defining your screens.  After you have submitted the program to
       your Micro Focus COBOL system, you can verify the data entry form
       before building the actual application.  The file is generated as
       file-name.CHK.

   *   Screen image files 
       of exact copies of the screen that you have designed.  The files
       are generated as file-name.Snn.

   *   A file of the source of an index program based on a screen that
       you have designed.  After you have submitted the program to your
       Micro Focus COBOL system, the generated program can be used for
       the storage, retrieval, updating and deletion of data entered via
       the screen.  The file is generated as file-name.GEN.

Phases.   

Forms-2 processing is divided into a number of logically distinct units,
but two main phases can be identified:  the initialization phase, and the
work phase.

Initialization Phase 

The initialization phase is performed only once and establishes the
characteristics of this particular run of the program.  It is a series of
screens containing self-explanatory prompts to which you reply as
necessary.  See the section "Initialization Phase"  for details of
this phase.

Work Phase 

At least two work phases are performed for each data entry screen that
you design.

The Forms-2 screen is analogous to a paper form, where the printed fixed
text is used as a guide to entering the variable data in the space
provided.  To the human eye it is obvious where the variable data entry
areas occur on the form, but the computer needs to have these areas
defined explicitly.  There are, therefore, two types of work phase:  one
in which you specify fixed text, and one in which you specify variable
data fields.  See the section "Work Phase"  for details of this phase.

Operator Interface.   

Forms-2 is written in COBOL 
and uses the extended ACCEPT and DISPLAY verbs in Micro Focus COBOL.
These two verbs are described in your Language Reference.

Advantages of this terminal interface are:

   *   Corrections can be directly overtyped.

   *   Numeric fields accept only numeric characters.

   *   The full stop or period (.), when keyed in a numeric field,
       automatically zero-fills the field from the left.

Forms-2 does not accept keystrokes defined in Unixkmap 

Cursor Movement Facilities 

You can move the cursor quickly and easily about the screen.  The
functions of the cursor control keys are summarized in the following
table.

Key                  Function 

->                   Position cursor right one data character

<-                   Position cursor left one data character

down arrow           Position cursor on next line below current position

up arrow             Position cursor on previous line above current
                     position

Home                 Move cursor to start of first line

Tab                  Move cursor to start of next line

Backtab              Move cursor to start of line or start of previous
                     line if already at start of line

You can correct text either by overtyping or by switching into command
mode and using the editing commands.

Forms-2 Validation.   

The following sequence takes you through all the parts of Forms-2:

   1.  Enter

       forms2

   2.  The program runs, and displays the first screen, thus:

            FORMS2 INITIALIZATION PHASE SCREEN I01

            FORMS2 PARAMETERS:

                DATA-NAME & FILE-NAME [    ](1-6 alphanumeric characters)

                terminal lines [24] (22 or 23 or 24)

            SPECIAL-NAMES clause:

                CURRENCY SIGN [$] (ANSI currency signs only)

                DECIMAL-POINT [.] ("." or ",")

            Press RETURN when complete

       Forms-2 asks for file-names and data-names.  You must answer the
       question on terminal size 
       if your terminal is a non-standard size.  Otherwise Forms-2
       accepts all the default replies (the values inside [ ] ) and you
       need only key a name, for example, "demo", followed by Enter.

       The currency sign 
       must be a valid sign as defined in the Language Reference.

   3.  Forms-2 then displays screen I02 
       to request the output file option type and directory prefix, thus:

            FORMS2 INITIALIZATION PHASE SCREEN I02

            FILES TO BE CREATED:

            FILE COMBINATIONS [C] (A = DDS)
            (B = DDS & CHK)
            (C = DDS & CHK & Snn)
            (D = DDS & Snn)
            (E = Snn)
            (F = No files output)
            (G = DDS & Snn & GEN)

            DEVICE/DIRECTORY PREFIX (0-40 Chars) [   ]

            Press RETURN when complete

       Key F for the output file selection then press Enter.  If you wish
       the files output by Forms-2 to be stored in a directory other than
       your current directory, enter the pathname in the field marked
       DEVICE/DIRECTORY PREFIX. You must provide the final slash in the
       prefix.

   4.  Forms-2 displays screen W01 
       to request the screen type option, thus:

            FORMS2 WORK PHASE SCREEN W01

            WORK SCREEN SELECTION:
            SCREEN TYPE [A] (A = Fixed text on clear screen)
            (B = Fixed text on last screen)
            (C = Variable data redefines last screen)
            (D = Variable data without redefinition)
            (! = Complete this FORMS run)

            Fixed Text allows: All characters

            Variable Data allows: X or Y to define alphanumeric fields
            9 or 8 to define numeric fields
            edit chars to define numeric edit fields
            Press RETURN when complete

       Note the default, "A", and press Enter.

   5.  Forms-2 displays a blank screen.  You are currently in Edit Mode,
       and should be able to position the cursor at any point on the
       screen.  Use the cursor control keys and the normal character keys
       to set up the following text on the screen:

            Name [-----------------------------------]

       Finally, press Enter.

   6.  Forms-2 puts "- -" in the top left of the screen, indicating that
       you are now in Command Mode. 
       At this point you would usually proceed directly to step 16;
       however, key ?  and then press Enter.

   7.  Forms-2 displays screen H01, 
       thus:

            FORMS2 HELP SCREEN SCREEN H01

            GENERAL COMMAND SUMMARY:
                 SPACE     = Process the work screen
                 -    = Re-enter EDIT mode
                 ?    = Display the next HELP screen
                 ?n   = Display the nth HELP screen
                 G    = Re-enter WORK PHASE screen selection
                 !    = Terminate FORMS run immediately
                 X    = Position commands at EDIT mode cursor
                 *    = Indicate Index Form's data area start

            NOTE:   SPACE is the command to process the EDIT mode Screen

                 HELP option [-] (- Re-enter EDIT mode)
            (? = Display next HELP screen)
            (!= Abandon FORMS2 run immediately)

            Press RETURN when complete

       Key ?  then press Enter.

   8.  Forms-2 displays screen H02, 
       thus:

            FORMS2 HELP SCREEN SCREEN H02

            MANIPULATION COMMAND SUMMARY:
                 F    = Invoke FOREGROUND/BACKGROUND manipulation
                 Fx   = Invoke FOREGROUND/BACKGROUND option "x"
                 0    = Turn on automatic WORK screen preparation
                 01   = Turn off automatic WORK screen preparation
                 Cn   = Insert n spaces at cursor position
                 Dn   = Delete n chars at cursor position
                 In   = Insert n blank lines before cursor line
                 Kn   = Delete n lines including cursor line
                 An   = Overwrite n lines with data of cursor line
                 Un   = Move cursor up n lines
                 Vn   = Move cursor down n lines

                 HELP option [-] (- = Re-enter EDIT mode)
            (?= Display next HELP screen)
            (!= Abandon FORMS2 run immediately)

            Press RETURN when complete

       Key ?  then press Enter.

   9.  Forms-2 displays screen H03, 
       thus:

            FORMS2 HELP SCREEN SCREEN H03

            PROGRAMMING COMMAND SUMMARY:
                 G    = Give datanames screen coordinates suffix
                 G1   = Give datanames sequential number suffix
                 Jn   = Allow up to n consec. spaces in fixed text
                 Mx   = Interpret "x" as "space"
                 S    = Cancel previous Sn command
                 S1   = Inhibit DDS & CHK output at next processing
                 S2   = Inhibit Snn output at next processing
                 S3   = Prompt for Snn file-name at next processing
                 S9   = Line edit DDS output at next processing
                 P    = Display cursor position coordinates

                 HELP option [-] (-= Re-enter EDIT mode)
            (? = Display next HELP screen)
            (! = Abandon FORMS2 run immediately)

            Press RETURN when complete

       Key ?then press Enter.

  10.  Forms-2 displays screen H04, 
       thus:

            FORMS2 HELP SCREEN SCREEN H04

            WINDOW COMMAND SUMMARY:
                 W    = Position cursor to current window start
                 W1   = Start window at cursor line
                 W2   = End window at cursor line
                 W3   = Start window at cursor line, no delim's
                 W4   = End window at cursor line, no delim's
                 W5   = Display start window delimiters
                 W6   = Display end window delimiters
                 W7   = Re-display data overwritten by start delim's
                 W8   = Re-display data overwritten by end delim's
                 W9   = Position cursor to current window end

                 HELP option    [-]  (-   = Re-enter EDIT mode)
            (? = Display next HELP screen)
            (! = Abandon FORMS2 run immediately)

            Press RETURN when complete

       Simply press Enter 

  11.  Forms-2 redisplays the fixed text that you keyed in at step 5.
       Press Enter 

  12.  Forms-2 puts "- -" in the top left of the screen.  Enter F then
       press Enter 

  13.  Forms-2 displays screen W02, thus:

            FORMS2    WORK PHASE     SCREEN W02

            FOREGROUND/BACKGROUND OPERATIONS:

                 OPTION    [ ]  (A = Re-enter EDIT MODE)
            (B = Clear FOREGROUND)
            (C = Clear BACKGROUND)
            (D = Merge BACKGROUND into FOREGROUND)
            (E = Merge FOREGROUND into BACKGROUND)
            (F = Merge screen image into FOREGROUND)
            (G = Merge screen image into BACKGROUND)
            (H = Display FOREGROUND)
            (I = Display BACKGROUND)
            (J = Display screen image)
                      NOTE:
                           (H & I & J display until RETURN pressed)
                 FILE-NAME [    ]
                           (F & G & J only)

            Press RETURN when complete

       Enter A then press Enter.

  14.  Again Forms-2 redisplays the fixed text entered at step 5.  Press
       Enter.

  15.  Forms-2 puts "- -" in the top left of the screen.  Press Space and
       then Enter.

  16.  Forms-2 displays screen W01 again to request the screen type
       option.  Note that the default is now "C", and press Enter.

  17.  Forms-2 displays the fixed text screen.  Use the cursor control
       keys and key in X's alone to set up the screen as follows:

            Name [XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX]

       Press Enter. 

  18.  Forms-2 puts "- -" in the top left of the screen.  Press Space and
       then Enter.

  19.  Forms-2 displays screen W01 again.  This time enter !  and press
       Enter to complete the run.

  20.  Forms-2 terminates with the message:

            END OF FORMS2 RUN

       You have now used all the Forms-2 screens and you can be sure that
       everything is in place and ready to be used.

Initialization Phase 

The initialization phase of the Forms-2 utility program is the first step
in the execution of the program, and is only done once in any one run of
Forms-2.  In this phase you are asked to reply to questions asked on the
two initialization screens I01 and I02.

Initialization Screen I01.   

Screen I01 is displayed as soon as Forms-2 is loaded.

You are asked for four items of information.  Note that if you press the
key during this screen display, you will immediately enter all responses
so far made, and any unanswered requests are defaulted.  Do not press
until you have made all the required entries for the following:

   1.  Data name and the file name base

   2.  Lines available on terminal screen

   3.  Currency sign

   4.  Decimal point representation

Data Name and File Name Base 

The file name base that you key in at this point is used in the following
ways by Forms-2:

   *   It is taken as the first part of all the data names and record
       names produced in this run.  Uniqueness is achieved by adding a
       two-digit sequence number for new records and adding the
       sequential number of the field within the form for data names
       within records.  Optionally, by means of a work phase command,
       uniqueness 
       may be achieved by adding the screen coordinates.

   *   It is taken as the main file name for generated files.  These can
       consist of:

          *   file-name.DDS for Micro Focus COBOL Data Description
              Statements (see the section "Data Descriptions" )

          *   file-name.CHK for checkout program (see the section "The
              Checkout Program" )

          *   file-name.Snn for screen images (nn=00, 01, 02, ..., 99)
              (see the section "Screen Image File" )

          *   file-name.GEN for index program (see the section "Index
              Program" )

Note that only one DDS file 
is output per Forms-2 run, whereas a separate screen image file 
is output for each screen built.

Lines Per terminal Screen 

You can use Forms-2 with screens of 22, 23 or 24 lines.  The default for
this entry is 24 lines.  If your terminal has fewer than 24 lines,
Forms-2 will not function correctly with this value.  With some
terminal's you may have to specify one fewer than the number of lines
actually present on the screen in order to avoid the problem where the
screen is "scrolled up" when an entry is made on the last line.

When selecting G in screen I02 the number of lines per terminal should be
23.  This is to allow for the extra line at the bottom of the screen to
be displayed as well as ADIS messages in order to prevent scrolling.

When selecting C in screen I02 the number of lines per terminal should be
24 if the actual number of lines on the screen is 25.  The extra line is
not displayed with this selection.

Currency Sign 

This entry allows you to override the default currency sign.  Forms-2
will generate an appropriate SPECIAL-NAMES entry in either the checkout
or index program.  You should use the specified currency sign when
specifying numeric edited fields in the work phase, and Forms-2 will use
it in the generated data description statements.

The character that you specify here is validated.  Refer to your Language 
Reference for a list of valid characters.

Decimal Point 

This option allows you to exchange the roles of the period or full-stop
(.)  and the comma (,).  If you specify ",", Forms-2 will produce a
DECIMAL-POINT IS COMMA clause in the checkout or index programs.  The
default is ".".  You should use the specified decimal point character
when specifying numeric edited fields in the work phase, and Forms-2 will
use it in the generated data description statements produced when you
submit your program to the Micro Focus COBOL system.

Initialization Screen I02.   

Screen I02 is displayed immediately after you terminate screen I01
entries by pressing the Enter key.

At this point Forms-2 asks you to specify the following:

   1.  Types of files to be created

   2.  Directory into which files are to be written

When you release screen I02 by pressing Enter you have entered the work
phase, and you can no longer amend information specified during the
initialization phase.

File Combinations 

Forms-2 offers options for all valid combinations of the following types
of files.  Each is identified by a unique file name extension:

   *   DDS 
       - Micro Focus COBOL source Data Description Statements 
       (DDS) corresponding to the screens you have created are output to
       a standard ASCII text file.  You can include the statements in any
       program using the standard COBOL COPY facility.  In particular,
       the checkout and index programs use them (see below).

       If you are unfamiliar with screen handling in Micro Focus COBOL,
       consult your Language Reference (especially the sections on
       ACCEPT/DISPLAY, FILLER, REDEFINES).

   *   CHK 
       - A checkout program 
       consists of the PROCEDURE DIVISION statements (ACCEPT and DISPLAY)
       that correspond to the screens you have created.  These statements
       are contained in file-name.CHK (see record/file name prefix).
       They are combined with the following COPY files:

       file-name.DDS, FORMS2.CH1, FORMS2.CH2

       The checkout program allows you to demonstrate on the screen
       exactly how the system will operate.  It displays successively the
       screens you have just created and allows you to enter data just as
       you would under actual operating conditions.

   *   Snn 
       - You can also output the text of the screen you have just
       designed to a file on disk in the form of a screen image.  You can
       retrieve this file later in this run or in subsequent Forms-2
       runs, for further amendment if required.

       Alternatively, you can print the screen images and use the hard
       copy simply as a means of communicating between different
       individuals (for example, the end user and the programmer) at
       different times.

   *   GEN 
       - Forms-2 can produce an index program 
       .  This includes all the code necessary to set up and maintain an
       indexed sequential file with records corresponding to the
       structure of your form.  The code is output to file-name.GEN and
       is combined with the following copy files:

       file-name.DDS, FORMS2.GN1, FORMS2.GN2

       Producing an executable index program places certain constraints
       on you during the Forms-2 run.  The creation and operation of the
       index program is discussed in the section "Index Program" .

       If you enter the Q command (see the section "Work Phase" ) at
       this point, Forms-2 will quit back to screen I01, allowing you to
       amend the information given there.  This can be useful if you
       inadvertently pressed Enter before completing screen I01.  This
       command is not mentioned on the screen.

Work Phase 

You define the screen layouts (forms) to be used in a Micro Focus COBOL
application by entering text at the keyboard to produce model forms on
the screen.  You can define as many forms as you wish in a single Forms-2
run.  To define one form requires at least two distinct work phases:  one
to define the fixed text of the form, and another to define the variable
data entry fields.

Usually you will use the first work phase to specify the fixed text 
form and the second work phase to specify the variable data fields 
within the form.  However, this need not always be the case, and Forms-2
needs to know which type of text you are going to input in a particular
phase.  Therefore the work phase is introduced by a screen presenting the
various options (W01).

Screen W01.   

This screen offers you four different fixed text selections.

Screen Type Selection 

Fixed text selections offered at this screen are as follows:

A                     The terminal screen is cleared to spaces in
                      preparation for you to enter the fixed text for a
                      new form.

B                     The previous screen is redisplayed to assist you in
                      defining additional fixed text.  Text from the
                      previous screen is used only as a background in
                      this case, and is not included in the record
                      definition for the fixed text you are about to key
                      in.  You must therefore ensure that if any part of
                      the previous screen is inadvertently overkeyed, the
                      original characters must not be replaced but
                      cleared to spaces.  Variable data selections
                      offered are as follows:

C                     The previous screen is redisplayed to assist you in
                      the redefinition of the form to incorporate
                      variable data field specifications.  In the
                      application the data is keyed into the fixed text
                      form itself.

D                     The previous screen is redisplayed to assist you in
                      the definition of variable data area in the
                      application program.  This may sometimes be of
                      assistance, even though it results in larger
                      application programs.

You must use screen type D when using windowing commands if the start of
the window is not going to be the first line on the screen.

Terminating the Run 

Screen W01 is redisplayed after completion of each work phase, and is the
screen used to terminate the program.  You do this by keying the
exclamation point (!)  and pressing Enter.


WARNING Use of the ! command at any other time causes immediate abandonment of the run.
On termination, Forms-2 closes the DDS file and displays an identification message. If you requested the checkout facility during initialization then Forms-2 completes output of the checkout program to disk, closes the CHK file, and displays an identification message. Forms-2 terminates automatically after the second work phase if an index program is being produced (see the section "Index Program" ). Work Screen. After you have selected the screen type, you are presented with the appropriate work screen for that text to be entered; for example, if you selected option A (fixed text on clear screen), a blank screen is displayed. For the other options, the previous screen is redisplayed to allow correct alignment of the current input. Background/Foreground In order to process only the data entered in this phase, Forms-2 must keep this data separate from previously entered data, which is displayed purely for alignment purposes. Forms-2 does this by constructing the displayed work screen from two separate data areas, termed background and foreground. The foreground holds the data entered during the current work phase. The background holds previously entered data that has been retained for alignment of the data entered in the current work phase. At the end of each work phase Forms-2 processes the foreground data only. If you select option B, C or D, then when screen W01 is next displayed, the foreground is overlaid on the current background contents and then the foreground is cleared to spaces. If you select option A, both background and foreground are cleared to spaces. In this way the new work screen is prepared automatically. You can override this automatic work screen preparation for the next phase by means of a work screen command, described later, and leave both areas unchanged. Generally, you enter text into the foreground from the keyboard, and it is moved into the background only from the foreground. The F work screen command (see below) provides facilities for further manipulation of these areas. In particular, you can input a screen image file from a previous run into the foreground, thus enabling you to amend existing forms. While entering data into the work screen (that is, foreground), you can work in either of two modes: * Edit mode, which is the mode in which you enter data to create the model form. The initial mode is always edit mode. * Command mode, in which commands are available to assist you in creating and processing the edited work screen. Edit Mode Edit mode is the mode in which you are free to move the cursor to any part of the screen by use of the cursor control keys. You may also make entries into any part of the screen, in accordance with the screen type that you selected at the start of this work phase. * Fixed Text In the design of the fixed text of a form (that is, the fixed fields analogous to the pre-printed text on a paper form), you can enter any legible characters anywhere on the screen. This text will be displayed as "prompt" text during a data entry run of the application. * Variable Data In the design of the variable data fields of a form (that is, the fields analogous to the entry spaces on a pre-printed form), you can enter the characters X, Y and 8, 9. When keying in variable data, X denotes an alphanumeric character and 9 denotes a numeric character. If you need to have two alphanumeric fields contiguous with each other, place Y's in the character positions of the second field. Similarly, for contiguous numeric fields use 8's in the character positions of the second field. Example Suppose in an application the operator must key in an invoice number. The fixed text in this example could be "INVOICE NO ....." One example value of an invoice number could be "CA3021". You must define the size and type of this variable data explicitly. Hence if the invoice number always had two alphanumerics followed by four numerics, you would key in XX9999 at the point on the screen (the dots in this example) where you wish the operator to key the actual invoice number when the application itself is running. Note that Micro Focus COBOL provides automatic validation of numeric fields. Additionally, you can input special editing characters to specify numeric edited fields. Note that these fields should be separated by spaces. Numeric edited fields are described in your Language Reference. The valid characters are: Z, *, +, -, CR, DB, .(period), ,(comma), B, /, 0(zero), $ The $ sign is the currency sign, which may be replaced by another sign as specified in the SPECIAL-NAMES clause of the Micro Focus COBOL program, either directly or as specified during the initialization phase of the Forms-2 run (see the section "Initialization Phase" ). Note that the picture characters S, V and P are not allowed. Forms-2 checks variable data fields for validity, but only when a DDS file is being created. You should consult your Language Reference (ACCEPT/DISPLAY verbs) for details of how screen handling works. Command Mode To switch to command mode from edit mode, simply press Enter. Command mode is the mode in which two underline characters initially bound the cursor, and the cursor is constrained to stay within these two characters. You invoke a command by keying the command and pressing Enter. When execution of a command is complete, all commands (except SPACE, ! and Q) return you to edit mode. The default command is the underline character (_), and this causes immediate reentry to edit mode. * Commands The commands available to you during the work phase fall into three main groups, and you enter a command by typing the command character(s) and pressing Enter. 1. General Work Screen Commands General commands perform such functions as releasing the work screen for processing. 2. Work Screen Manipulation Commands Work screen manipulation commands help you to prepare and edit the work screen. You are advised to become very familiar with these commands. 3. Programming Commands Programming commands have been introduced mainly for the convenience of the COBOL programmer, and some of them will not be meaningful without an understanding of COBOL. They include commands to assist in producing efficient code, and to give you more control over the output files. Commands in group 1 and 2 are summarized within help screens 1 and 2 (H01 and H02). Commands in group 3 are summarized on help screens 3 and 4 (H03 and H04). General Work Screen Commands A description of each general command is given below. * Display Help Screens If you enter the question mark then press Enter, the first help screen will be displayed, which includes a summary of the general commands. This screen remains displayed until the next input command. Pressing Enter alone at this stage returns you to edit mode. Keying? then pressing Enter again displays the next help screen, which is a summary of the work screen manipulation commands. If you repeat the sequence, each help screen will be displayed in sequence until the end of the series, when the first screen is displayed again. The ? command is also available from the first (Select Text Type) screen W01. * Display Help Screen n If you key ? followed by a numeric digit then press Enter, the nth help screen in the series will be displayed. * Terminate the Work Phase If you enter the space character, you will terminate the current work phase and initiate processing of the data you have just entered in that work screen. * Return to Edit Mode If you enter the underline character, you will exit from command mode back to edit mode. All commands except SPACE, ! and Q return you to edit mode. The default command was introduced for convenience in case you enter command mode accidentally. * Quit If you enter Q, you will return to screen W01 (Select Type of Text). Whatever text type you then select, the current foreground/background components of the work screen will be unchanged when you re-enter edit mode. The most likely use for this command is where you select the default option C (variable data fields) at screen W01 and then you use the work screen incorrectly to set up a fixed text form. Validation errors then occur, and you will automatically be returned to edit mode. To return to screen W01 and correct the selection without loss of the text you have just entered, press Enter to enter command mode and enter the Q command. You can now correct the screen type, and the work screen has been preserved for reprocessing (as fixed text). The Q command is also available to you at screen I02, though it is not mentioned there, and again its function is to return you a step within the phase (in this case back to screen I01). * Terminate Forms-2 Run If you enter the ! character, you will terminate the program. This command is available to you throughout the Forms-2 program, but you will normally use it on automatic return to screen W01 when you have completed a work phase. When used elsewhere it abandons the run. * Reposition Command Area (X) The standard command area is in columns 1 and 2 of line 1, as indicated by the two underline characters displayed on entry to command mode. Forms-2 always attempts to restore any data in these positions upon return to edit mode. However, to enable these positions to be preserved intact at all times, the facility to reposition the command area is provided. To do this, place the cursor at the desired location before entering command mode. Enter the character X to cause the required change. The next time you enter command mode, the prompting underline characters will appear at the new specified location. * Define Key/Data Split for Index Program (Asterisk) This command is used only in connection with generation of the index program and is described in the section "Index Program" . Note, however, that if you select the index program option G at Screen I02, at some stage before termination of the second work phase you should position the cursor at the first non-key variable data position and enter the * command. If you do this incorrectly, Forms-2 will continually return you to edit mode until you either do it correctly or enter the "!" command to terminate the session and abandon the work in progress. Work Screen Manipulation Commands The commands F and O are preparation commands. * F: Invoke Foreground/Background Menu Screen (W02) Screen W02 contains options to assist you in setting up the foreground component of the work screen. The concept of foreground and background is described earlier in this chapter. The options offered to you by screen W02 are: A Return to edit mode B Clear foreground to spaces C Clear background to spaces D Overlay background data on to foreground E Overlay foreground data on to background F Overlay a screen image file onto foreground. This option allows you to amend forms defined in previous runs (and also earlier in this run). You will be prompted for the name of the required file G Overlay a screen image file on to background H Show foreground. This displays just the foreground component of the work screen for examination. The full work screen will be restored on return to edit mode I Show background. This displays just the background component of the work screen for examination J Show a screen image file. You will be prompted for the file name and the specified file is displayed, but without corrupting the current contents of either foreground or background. This enables you to make a check prior to using option D The options H, I and J produce a display that remains until you press Enter. * Fx : Specifies Required Foreground/Background Option. x is the option code as contained in screen W02 above. The specified option is executed and control returned to edit mode without display of screen W02. * O1 : Switch Off Automatic Background/Foreground Preparation. The background/foreground preparation sequence is described earlier in this chapter. Use this command to prevent the current foreground being merged into the background or either area being cleared for the next phase. The O1 command remains effective until you enter the command O or O0 (described below). * O or O0: Reset Background/Foreground Preparation. The background/foreground preparation sequence is reset to automatic (starting at the beginning of the next work phase). The G command has a similar effect (beginning at the next phase). The commands C, D, I, K and A are editing commands and are controlled by the position of the cursor at the time command mode is entered (that is, the current cursor position) and operate only on the foreground data. Background data remains in the same position. * Cn: Insert n Spaces Insert n (1-9) spaces before the character at the current cursor position. Only the current line is affected. * Dn: Delete n Characters Delete n (1-9) characters including the character at the current cursor position. Only the current line is affected. * In: Insert n Blank Lines Insert n (1-9) blank lines before the line containing the current cursor position, irrespective of the column. You can only insert whole lines. * Kn: Delete (Kill) n Lines Delete n (1-9) lines including the line containing the current cursor position. You can only delete whole lines using this command. * An: Repeat Current Line n times Repeat the line containing the current cursor position n (1 - 9) times. This does not act as an insert. Any foreground data in the next n lines will be overwritten. Commands U and V are cursor positioning commands. You can position the cursor horizontally by using the <- and -> keys. You can position the cursor vertically by using the up arrow and down arrow keys after you have moved the cursor to the first position of the current line. Vertical tabulation within the same column may be required when setting up a form. Two tabulation commands are provided. * Un: Move Cursor Up n lines Moves the cursor up n (1-9) lines from the current cursor position. Cursor position within the line is maintained. * Vn: Move Cursor Down n lines Moves the cursor down n (1-9) lines from the current cursor position. Cursor position within the line is maintained. Programming Commands * G : The Data Name Structuring Command The default record name format generated by Forms-2 for inclusion in your Micro Focus COBOL source program for screen formatting is as follows: bbbbbb-rr (01 level) where: bbbbbb is the 1-6 character base that you specified at screen I01 rr is the record number, starting at 00 in the first work phase and increasing by one for each subsequent work phase. If you use the window commands to define a window starting in a line other than line 1, the default record name generated will be: bbbbbb-rr-ll where: ll is the line number. The default elementary data name structure generated by Forms-2 for inclusion in the Micro Focus COBOL source program for screen formatting is as follows: bbbbbb-rr-nnnn where: nnnn is the sequence of this field within the screen, starting at 0001. Alternatively: * The G (or GO) command causes nnnn within the data name to be the screen coordinates of the start of the field. This can sometimes be of use as a reference guide when using Micro Focus COBOL facilities to set cursor position. * The G1 command restores the default data name generation to using sequential field numbers. The commands J and M are multiple spaces and FILLER commands. The Micro Focus COBOL interactive ACCEPT and DISPLAY verbs operate only on named fields; FILLER areas are left alone. The time taken to display a screen depends both on the size and also the number of constituent fields. When processing fixed text screens, Forms-2 by default generates FILLER wherever multiple spaces appear. On some forms this can result in many small fields separated by small FILLER fields. The problem may be alleviated by: * Jn : Reset Multiple Spaces The Jn command resets the number of contiguous spaces Forms-2 will allow within the VALUE clause of a named field. This is initially set to 1 (n may be 0 - 9). J or J0 will force FILLERs even for single spaces. An alternative method of forcing spaces within named fields is by use of the underline, which is designed for this purpose. Use of the underline character in a field results in an actual space in the corresponding position in the generated VALUE clause. If you need to change the designated character from underline to something else (presumably because you need to generate VALUE "_"), use the M command as follows: * Mx : Change Default FILLER The Mx command changes the default underline character (_) to that specified by Mx. If the space character ( ) itself is specified, this will force generation of named fields for the entire screen without any FILLERs. * Sn : File Output Control Command S (or S0) Cancels any other Sn commands in effect at the time. S1 Suppresses DDS (& CHK) text generation for this work screen. Generation of this text resumes for the next work screen unless the same command is repeated in the next phase. S2 Suppresses screen image (Snn) text generation for this work screen. This is commonly used to suppress screen images of just variable data fields. Again, the effect only lasts for the current phase. S3 Gives you the opportunity to override the default screen image file identifier for the current work screen. Normally, if a file already exists with the default identifier, you are given the option of overriding it. If you reject this option, you are prompted for an alternative file identifier. This command forces the alternative file identifier to be requested even when no file exists with the default identifier. S9 Causes Forms-2 to halt after display of each line of code during DDS generation. Forms-2 re-ACCEPTs the line before outputting it to the .DDS file. This provides you with a limited editing capability, which may prove useful under special circumstances. This option is not available if you select option B, C, E, F or G at screen I02. * P : Cursor Control Command Causes the coordinates of the current cursor position to be displayed at the command area position. This display lasts a few seconds, after which the work screen contents at the command area are restored and control is returned automatically to edit mode. Where sequential field numbers are used within data names, this command provides you with an easy alternative method of ascertaining the coordinates of any field. * Wn : Window Commands The "window" defines the area (full lines) to be processed by Forms-2 when generating DDS text. By default the window is the full screen. Where window start or end is other than start or end of screen, a delimiting line of hyphens may optionally be displayed on the line just outside the window. For example, if a window starts in line 4, delimiters appear along the length of line 3. The principal use of the window is to allow you to create a form that begins below the top of the screen, but saves memory by avoiding the description of blank lines at the top of the screen. Where window is used in this way the generated record name incorporates the start line number of the window, which can then act as a guide to the programmer, using the Micro Focus COBOL ACCEPT/DISPLAY AT coordinates facility. The detailed commands give you very comprehensive window formatting capability as follows: W (or W0) Positions the cursor at current window start. This is the equivalent of the Home key when the window facility is in use. W1 Sets start of window to current line with delimiters on previous line. W2 Sets end of window to end of current line with delimiters on next line. W3 Sets start of window to current line without delimiters. W4 Sets end of window at end of current line without delimiters. W5 Displays delimiters preceding current window start. W6 Displays delimiters following current window end. W7 Erases start delimiters and restores any work screen data to display. W8 Erases end delimiters and restores any work screen data to display. W9 Positions the cursor at current window end. Delimiters do not corrupt background/foreground contents. The current screen image will include the full foreground part of the work screen without delimiters, irrespective of whether a window has been defined. You could use this to include annotation on the screen image that does not affect DDS generation. One use of the window facility would be to display a form in two stages: the first 10 lines, then the second 10 lines. You could create this as a single screen image including both sections of the form, and you could "window in" on the relevant portions as required when the DDS text is generated. Work Phase Completion. To complete the work phase of Forms-2, select command mode, press Space and then Enter. Space is the command to release the work screen for processing. Forms-2 completes the work phase (depending on the file selection at screen I02) as follows: 1. If this is a variable data field definition work phase (option C or D at screen W01), validation then occurs with the message: WORK SCREEN VALIDATION in progress - DO NOT press RETURN. 2. If you selected DDS file production at screen I02, the source code produced is echoed to the screen as it is written to disk. If you used the S9 command, processing stops after each line of code to enable you to make changes as required. This is recommended only if special requirements dictate its use. 3. If you requested a screen image file at screen I02, the screen image is echoed to the screen as it is written to the disk file. The name of the created file is displayed and you must press Enter to continue. 4. Screen W01 is redisplayed so that the run can be terminated or continued. During validation of variable data only those characters listed in the description of text types are permitted (plus space). If any other character is encountered, an error is signalled by the validation routine by alternately displaying "?" and the offending character to give a flashing effect. This error indication then ceases and Forms-2 returns to edit mode with the cursor positioned under the erroneous character. You must repeat the Space command after making any corrections. Forms-2 will allow editing characters but will not verify that the combinations of these are valid; Micro Focus COBOL editing rules must therefore be obeyed to ensure error free code. Note that these fields should be separated by spaces. Only foreground data is output to the screen image file.


MPE/iX 5.0 Documentation