GENERATE [ HPTOOLSET XL Reference Manual ] MPE/iX 5.0 Documentation
HPTOOLSET XL Reference Manual
GENERATE
Generates COBOL and Pascal data declarations from information in the data
dictionary.
Syntax
[F[ILE] [namelist]] [ V[AR] [line #] ]
GENERATE [E[LEMENT][namelist]] [ T[YPE] [line #] ]
[I[MAGE] ] [ [ENV [line #]][DATA [line #]]]
[C[OMAREA] ] [ line # ]
[BY Increment] [Q[UIET]]
Parameters
FILE Designates that a file declaration should be generated.
Declarations for any type of file supported by the
dictionary (KSAM files, MPE XL files, IMAGE data bases,
IMAGE data sets, VFORM files, or VPLUS forms) can be
generated.
ELEMENT Specifies that a declaration for a single data item
should be generated.
IMAGE Generates standard elements used in IMAGE programs.
These include the status words, modes, and standard name
lists (";" , "*;" , and "@" ) for COBOL. A namelist
should not be specified.
VPLUS Generates a comarea and other standard VPLUS parameters.
If this parameter is omitted, you will be asked:
-->Generate FILE, ELEMENT, IMAGE, or VPLUS declarations?
Namelist Specifies the file or element name or names for which
declarations will be generated. If you have more than
one file or element name, separate them by commas. If
the namelist is not included, TOOLSET/XL will continue
to ask for names until the question is answered with a
single carriage return.
-->Filename?
-->Element name?
VAR TYPE Determine whether var or type declarations will be done
for Pascal.
ENV DATA Determine whether environment and/or data division
declarations will be done for COBOL. If only a line
number is given, the user will be asked which should be
generated.
Line # Is the source line # at which the generated code is to
be placed. If a source line already exists, the code
will be placed after the existing line. If you do not
specify the line numbers, you will be asked for them as
follows:
-->Line for ENVIRONMENT DIVISION entry?
-->Line for DATA entry?
-->Line for TYPE entry?
-->Line for VAR entry?
One or more of these question will be asked if no line #
is given in the command.
A carriage return at these prompts will cause the code
to be placed at the end of the file.
BY Increment Allows you to override the default line numbering.
QUIET Suppresses output to $STDLIST.
Example
Pascal
No.1
(a) >>GEN FILE
-->Generate TYPE declaration or VAR declaration? T
-->Line number for TYPE declaration? 20
-->Dictionary Password?
-->File name? ENGINEER <<Image data set>>
20 type
21 engineer =
22 record
23 lab_engineer : packed array[1..8] of ' '..'Z'
24 end
25
26
27 const
28 engineer_const = 'engineer ';
29 lab-engineer_const = 'lab_engineer ';
(b) -->Filename? MPEFILE <<MPE XL file>>
30 type
31 mpefile =
32 record
33 data : packed array [1..72] of char;
34 line_no : packed array [1..8] of '+'..'9'
35 end;
36
37 const
38 mpefile_const = 'mpefile ';
(c) -->Filename? KSAMFILE <<KSAM file>>
40 type
41 ksamfile =
42 record
43 line_numb :packed array [1..6] of '+'..'9';
44 source_line :packed array [1..66] of char;
45 module_name :packed array [1..8] of char
46 end;
47
48 const
49 ksamfile_const = 'ksamfile ';
50
-->Filename? <cr>
>>
No. 2
>>GEN FILE FORMFILE
-->Generate TYPE declaration or VAR declaration? TYPE
-->Line number for TYPE entry? 50
50 formfile_const = 'formfile ';
51
52 type
52 form =
52 record
53 part_numb : packed array[1..7] of char;
54 desc_field : packed array[1..12] of char;
55 qty : packed array[1..4] of '+'..'9';
56 price : packed array[1..6] of '+'..'9';
57 total_price: packed array[1..8] of '+'..'9';
58 end;
59
60
61
62 const
63 form_const = 'form ';
64
No. 3
>>GENERATE TYPE 100
-->Generate FILE, ELEMENT, IMAGE, or VPLUS declarations? ELEMENT
-->Element name? FIX-BY
100 type
101 fix_by = packed array[1..8] of ' '..'Z';
102
-->Element name? DATE-RECEIVED
103 type
104 date_received = packed array[1..6] of char;
105
-->Element name? SR
106 type
107 sr = integer;
108
-->Element name? <cr>
>>
COBOL
No. 1
This example shows the generation of two files, an MPE XL USASCII file
and a KSAM file.
When generating COBOL declarations, you will be prompted for a prefix to
be attached to data element names.
>>EDIT ZCOBOL;
>>GENERATE
-->Generate FILE, ELEMENT, IMAGE, or VPLUS declarations? F
-->Generate ENVIRONMENT entry, DATA entry or BOTH? B
-->Line number for ENVIRONMENT entry? 50
-->Line number for DATA entry? 150
-->Filename? MPEFILE
Prefix for data-items in MPEFILE > MPE-
50 SELECT MPEFILE
51 ASSIGN "MPEFILE "
52 ORGANIZATION IS SEQUENTIAL.
150 FD MPEFILE
151 RECORDING MODE IS F
152
153
154 01 MPEFILE-DATA
155 05 MPE-DATA PIC X(72).
156 05 MPE-LINE-NO PIC 9(5)V9(3).
157
-->File name? KSAMFILE
Prefix for data-items in KSAMFILE > KS-
53 SELECT KSAMFILE
54 ASSIGN "KSAMFILE"
55 ORGANIZATION IS INDEXED
56 ALTERNATE RECORD KEY KS-LINE-NUMB
57 ALTERNATE RECORD KEY KS-MODULE-NAME
58 RECORD KEY IS KS-KEY-VALUE WITH DUPLICATES
158 FD KSAMFILE
159 RECORDING MODE IS F
160
161
162 01 KSAMFILE-DATA
163 05 KS-LINE-NUMB PIC 9(6).
164 05 KS-SOURCE-LINE PIC X(66).
165 05 KS-MODULE-NAME PIC X(8).
166 05 KS-KEY-VALUE PIC 9(6).
167
-->Filename? <cr>
No. 2
This example shows the generation of an Image detail file.
>>GEN FILE SRPROC DATA 210
Prefix for data-items in SRPROC > SR-
210.1
210.2 01 SRPROC-DATA.
210.3 05 SR-SR PIC S9(9) COMP.
210.4 05 SR-PROCEDURE-NAME PIC X(30).
210.5
210.6 01 DS-SRPROC PIC X(7) VALUE "SRPROC "
210.7 01 DI-SR-SR PIC X(3) VALUE "SR "
210.8 01 DI-SR-PROCEDURE-NAME PIC X(15) VALUE "PROCEDURE-NAME "
210.9
>>
MPE/iX 5.0 Documentation