The function Generate FORTRAN Copy Code generates a record buffer for use in FORTRAN programs based on a Predict file object.
In addition, an Adabas format buffer can also be generated if required for files of the following types:
Adabas file (file type A) with parameter Adabas SQL usage = N
Adabas userview (file type U)
This document covers the following topics:
The Generate FORTRAN Copy Code screen is
displayed with function code G and object code FO in a Predict main menu, or
with the command GENERATE FORTRAN
.
10:13:24 ***** P R E D I C T ***** 2007-05-31 Plan 0 - Generate FORTRAN Copy Code - File ID ...................* Save as member ............. Save in library ........ FORLIB Overwrite option ........... Y (Y,N) Op. system member ...... Punch directly ............* N List generated code ........ Y (Y,N) Generate length.field .. N (Y,N) Generate format buffer ....* N Adabas version ........* I7 Nr. of abstract lines ...... 4 (0-16) Field name prefix ...... Generate initial value ....* N Field name suffix ...... Truncation ................* R Validate ............... * Offset name ................ OFF Record buffer name ......... Compiler ..............* I Format buffer name ......... Command ===> Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12--- Help Next Stop Last LnkEl Flip Print Impl AdmFi SelFi Prof Main |
Values for fields which have been locked by your data dictionary administrator cannot be overwritten. These fields are skipped when positioning the cursor with the TAB key. See Generation Defaults.
Presettings | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The parameters below can be changed in the Modify FORTRAN Defaults screen. See Generation Defaults. | |||||||||||||
Library system | Library system for which the generated code is punched. Determines which additional cards need to be punched. An operating system member must be entered for the additional cards to be generated. See Parameters Specifying the Form of Output for more information. | ||||||||||||
Parameters | |||||||||||||
The parameters Save as member, Save in library, Overwrite option, Op. system member, Punch/output, Workfile name and List generated code are described in the section Parameters Specifying the Form of Output. | |||||||||||||
File ID | ID of the Predict file object from which the definitions are to be generated. Enter an asterisk to display a selection screen. Alternatively, use an asterisk as a wildcard. For example, enter A* to display IDs beginning with A only. | ||||||||||||
Generate length field |
|
||||||||||||
Generate format buffer |
|
||||||||||||
Adabas version | The version of Adabas for which the copy code is to be generated. Enter an asterisk for valid values or see table in the section Adabas Version for more information. | ||||||||||||
Nr. of abstract lines | The number of Predict abstract lines per field to be included in the generated code. | ||||||||||||
Field name prefix | The prefix to be used for each field name generated. | ||||||||||||
Generate initial value |
|
||||||||||||
Field name suffix | Suffix appended to each field name generated. | ||||||||||||
Truncation |
|
||||||||||||
Validate |
|
||||||||||||
Offset name | To display the offset of each item in the structure, Predict creates a CHARACTER*1 array with as many elements as there are bytes in the buffer, and generates EQUIVALENCE statements. Valid characters of this parameter are used as the name of the array in the record buffer. Valid characters of this parameter followed by AA are used as the name of the array in the format buffer. | ||||||||||||
Record buffer name | Specifies the name of the record buffer in the generated structure. If omitted, the file ID is used. | ||||||||||||
Format buffer name | Specifies the name of the format buffer in the generated structure. If omitted, the file ID prefixed by F is used. | ||||||||||||
Compiler |
|
Command: GENERATE FORTRAN
.
Enter parameters on next line in positional or keyword form. File ID is obligatory, all other parameters are optional.
Field | Keyword | Position |
---|---|---|
File ID | FILE-ID | 1 |
Save as member | MEM | 2 |
Save in library | LIB | 3 |
Overwrite option | REPLACE | 4 |
Op. system member | OS-MEMBER | 5 |
Nr. of abstract lines | NR | 6 |
Field name prefix | PREFIX | 7 |
Generate format buffer | FORMAT-BUFFER | 8 |
Field name suffix | SUFFIX | 9 |
Generate initial value | INIT | 10 |
Generate length field | LENGTH-FIELD | 11 |
List generated code | LIST | 12 |
Validate | VALIDATION | 13 |
Punch / output | PUNCH | 14 |
Truncation | TRUNCATION | 15 |
Offset name | OFFSET-NAME | 16 |
Record buffer name | RECORD-BUFFER-NAME | 17 |
Format buffer name | FORMAT-BUFFER-NAME | 18 |
Adabas version | ADA-VER | 19 |
Compiler | COMPILER | 20 |
Workfile name (see note below) | WORKFILE-NAME | 21 |
If Entire System Server is used | ||
- DB-ID | NP-DBID | 22 |
- Data set | NP-DSNAME | 23 |
- Volume | NP-VOLSER | 24 |
- Library | NP-LIB | 25 |
- Sublibrary | NP-SUBLIB | 26 |
- Member type | NP-MEMTYPE | 27 |
- VSAM catalog | NP-VSAMCAT | 28 |
If a parameter is not specified, the default value is taken.
Note:
You cannot specify a value other than blank (' ') for
WORKFILE-NAME on mainframes.
Parameters NP-LIB, NP-SUBLIB and NP-MEMTYPE must be specified if the generated code is written to workfile 1 (Punch/output=Y) and Library system=3.
The following rules apply to the generation of names for FORTRAN copy code.
Alphabetic characters (letters) in Predict object IDs, such as file and field IDs, are converted into upper-case.
Field names in FORTRAN copy code are created from Predict fields: either the field name synonym for FORTRAN or, if none exists, the Predict field ID.
Any periodic groups with Gr.structur set to blank are treated as periodic groups with Gr.structur set to N and a warning message is issued.
The parameters Validate and Truncate are applied when generating all field names:
when using compiler option IBM, Siemens, or FORTRAN 77, the names are truncated to 6 characters
with compiler option VMS, the names are truncated to 30 characters.
Parameters Field name prefix and Field name suffix are applied when generating all field names except record buffer and format buffer. See Examples for the Generation of FORTRAN Field Names.
If a resulting field name is not unique within the entire file structure, an error message is given.
Before each field of type MC or PC, a counter field is generated, with a name created from the name of the MC or PC field prefixed by C. For example, a Predict field object DAY with no field name synonym for FORTRAN and with type MC will generate the field names CDAY and DAY.
An additional indicator field prefixed with S is generated in the following cases:
a field is defined with Suppression option set to U (null allowed)
a field of a file of type A, U or B is defined with Suppression option set to R (not null)
Note:
For Adabas fields, the additional indicator field is only
generated for the following Adabas versions:
I3 or above
U1 or above
V4 or above.
Example: with the parameter settings
Field prefix = PR Field suffix = SUF Validate = * Truncation = R
the following field names are generated for a field named "day" of type MC:
PRCDAY, PRDAYS for IBM or Siemens compiler
PRCDAYSUF, PRDAYSUF for VAX/VMS compiler.
Fields in the FORTRAN copy code have a FORTRAN clause determined by the following factors:
length and format of the corresponding Predict field object
file type of the file containing the field
the compiler for which you are generating.
PRD Format | PRD Length | File Type or Compiler | FORTRAN Clause | Byte Length |
---|---|---|---|---|
B/I | 1 | Compiler: Siemens | INTEGER*1 | |
Compiler: VMS | BYTE | |||
Compiler: IBM, FORTRAN 77 | CHARACTER*1 | |||
B | l=3, 5, 6, 7 | CHARACTER*l | ||
B/I | 2 |
File Type: BT, BV or |
INTEGER*2 | |
Compiler: FORTRAN 77 and |
CHARACTER*2 | |||
4 |
File Type: BT, BV or |
INTEGER*4 | ||
Compiler: FORTRAN 77 and |
INTEGER | |||
8 | IBM, VMS, FORTRAN 77 | CHARACTER*8 | ||
Compiler: Siemens | INTEGER*8 | |||
B | l=>9 | CHARACTER*l | ||
F | 4 | Compiler: IBM, Siemens, VMS | REAL*4 | |
Compiler: FORTRAN 77 | REAL | |||
8 | Compiler: IBM, Siemens, VMS | REAL*8 | ||
Compiler: FORTRAN 77 | DOUBLE PRECISION | |||
N/U |
nn.m | CHARACTER*l | l=nn+m | |
P/PS | nn.m | CHARACTER*l | l=(nn+m+2)/2 | |
D | File Type: D, E | CHARACTER*10 | ||
File Type: BT, BV | CHARACTER*8 | |||
other file types | CHARACTER*4 | |||
T | File Type: D, E, BT, BV | CHARACTER*8 | 8 | |
other file types | CHARACTER*7 | 7 | ||
L | Compiler: IBM, Siemens, VMS | LOGICAL*1 | 1 | |
Compiler: FORTRAN 77 | CHARACTER*1 | 1 | ||
BT | File Type: YT, YV | see format B, length 1 | 1 | |
DT | File Type: JT, JV | CHARACTER*25 | 25 | |
File Type: OT, OV | CHARACTER*9 | 9 | ||
File Type: YT, YV | CHARACTER*32 | 32 | ||
DS | File Type: YT, YV | CHARACTER*28 | 28 | |
G | n | File Type: D, E | CHARACTER*m | m=2*n |
GV | n | File Type: D, E | CHARACTER*m | m=2*n |
GL | n | File Type: D, E | CHARACTER*m | m=2*n |
TS | File Type: D, E | CHARACTER*26 | 26 | |
File Type: YT, YV | CHARACTER*8 | 8 | ||
MO | File Type: YT, YV, JT, JV | see format F, length 8 | 8 | |
MS | File Type: YT, YV | see format F, length 4 | 4 | |
OK | File Type: JT, JV | CHARACTER*16 | 16 | |
TK | File Type: JT, JV | CHARACTER*8 | 8 |
If generated for IBM, Siemens or VMS compilers: Any file number field, length fields and automatically generated counter fields have the clause INTEGER*2.
If generated for a FORTRAN 77 compiler: Constants for the file number and length fields have the clause INTEGER. Automatically generated counter fields have the clause CHARACTER*2.
A numeric or binary format field with a length not included in the table above is treated in FORTRAN copy code as an alphanumeric format field and cannot have an initial value generated for it. A warning message is given.
Fields other than redefinitions are always aligned, both in the record buffer and in the format buffer, on the boundary shown in the table above.
The array that is created to show the offset of each item in the file (see the parameter Offset name) is aligned so that its first element, (Offset name(1)), corresponds to offset 0. Similarly, the element number in each EQUIVALENCE statement generated is one more than the offset of the corresponding field. For example, the statement EQUIVALENCE(Offset name(15),elem) in FORTRAN copy code would correspond to a field named elem with offset 14.
In FORTRAN copy code, redefinitions are generated both for elements within a group and for single fields on level 1. Redefinitions are not generated for periodic groups; instead, a warning message is issued.
Note:
If FORTRAN copy code for DB2 tables/views is generated, the
format NS or US is converted to the FORTRAN format CHARACTER. Any redefinitions
that exist for this field are skipped.
A DB2 large object is generated as locator like an I4 field.
File ID .. GENERATION-EXAMPLE C********************************************************************* C THIS RECORD-BUFFER LAYOUT WAS GENERATED BY PREDICT C FOR FILE: GENERATION-EXAMPLE C ON: 2007-05-31 STARTING AT 13:28:09 C FILE-COMMENTS: Example file for the C PREDICT generation subsystem. C .. C********************************************************************* CHARACTER*648 GENERA C >>> RB NAME : C >>> DIC1809 WARNING: FIELDNAME(S) TRUNCATED CHARACTER*1 OFF(648) EQUIVALENCE(OFF(1),GENERA) CHARACTER*99 GROUP1 EQUIVALENCE(OFF(1),GROUP1) CHARACTER*14 ELN9V5 EQUIVALENCE(OFF(1),ELN9V5) C >>> DIC1818 WARNING: FORMAT(S) CHANGED ( ' N ' --> ' A ') CHARACTER*30 GRINGR EQUIVALENCE(OFF(15),GRINGR) C >>> GR-IN-GROUP : C >>> DIC1809 WARNING: FIELDNAME(S) TRUNCATED INTEGER*4 ELEB4 EQUIVALENCE(OFF(17),ELEB4) CHARACTER*4 ELPS52 EQUIVALENCE(OFF(21),ELPS52) C >>> DIC1818 WARNING: FORMAT(S) CHANGED ( ' PS ' --> ' A ') INTEGER*4 MUB4(5) EQUIVALENCE(OFF(25),MUB4) CHARACTER*7 MURB7 EQUIVALENCE(OFF(25),MURB7) C >>> DIC1818 WARNING: FORMAT(S) CHANGED ( ' B ' --> ' A ') CHARACTER*13 MURB13 EQUIVALENCE(OFF(32),MURB13) File ID .. GENERATION-EXAMPLE C >>> DIC1818 WARNING: FORMAT(S) CHANGED ( ' NS ' --> ' A ') CHARACTER*8 MURB8 EQUIVALENCE(OFF(25),MURB8) C >>> DIC1818 WARNING: FORMAT(S) CHANGED ( ' B ' --> ' A ') CHARACTER*42 ELEA42 EQUIVALENCE(OFF(45),ELEA42) REAL*8 ELEF8 EQUIVALENCE(OFF(89),ELEF8) CHARACTER*3 FOB3 EQUIVALENCE(OFF(97),FOB3) C >>> DIC1818 WARNING: FORMAT(S) CHANGED ( ' B ' --> ' A ') INTEGER*2 CPCOCC EQUIVALENCE(OFF(101),CPCOCC) C >>> PC-OCC-7 : C >>> DIC1809 WARNING: FIELDNAME(S) TRUNCATED CHARACTER*534 PCOCC7 EQUIVALENCE(OFF(103),PCOCC7) C >>> DIC1848 MESSAGE: PE-GROUP(S) 'STRUCT' DEFINITION SET TO 'N' CHARACTER*10 PCELED(7) EQUIVALENCE(OFF(103),PCELED) C >>> PC-ELE-DE-NS-7V3 : C >>> DIC1818 WARNING: FORMAT(S) CHANGED ( ' NS ' --> ' A ') C >>> DIC1809 WARNING: FIELDNAME(S) TRUNCATED INTEGER*2 CMCPS(7) EQUIVALENCE(OFF(173),CMCPS) CHARACTER*4 MCPS(11,7) EQUIVALENCE(OFF(187),MCPS) C >>> DIC1818 WARNING: FORMAT(S) CHANGED ( ' PS ' --> ' A ') CHARACTER*112 PCGR EQUIVALENCE(OFF(495),PCGR) INTEGER*2 FOI2(7) EQUIVALENCE(OFF(495),FOI2) CHARACTER*14 PS20V7(7) EQUIVALENCE(OFF(509),PS20V7) C >>> DIC1818 WARNING: FORMAT(S) CHANGED ( ' PS ' --> ' A ') REAL*4 FOF4(7) EQUIVALENCE(OFF(609),FOF4) CHARACTER*4 ELED EQUIVALENCE(OFF(637),ELED) File ID .. GENERATION-EXAMPLE C >>> DIC1818 WARNING: FORMAT(S) CHANGED ( ' D ' --> ' A ') CHARACTER*7 ELET EQUIVALENCE(OFF(641),ELET) C >>> DIC1818 WARNING: FORMAT(S) CHANGED ( ' T ' --> ' A ') LOGICAL*1 ELEL EQUIVALENCE(OFF(648),ELEL) C********************************************************************* C THIS FORMAT-BUFFER WAS GENERATED BY PREDICT C FOR FILE: GENERATION-EXAMPLE C ON: 2007-05-31 STARTING AT 13:28:09 C********************************************************************* CHARACTER*136 FGENER C >>> FORMAT BUFFER NAME : C >>> DIC1809 WARNING: FIELDNAME(S) TRUNCATED CHARACTER*1 OFFAA(136) CHARACTER*60 OFFAB 1 /'AB,2X,AD,AE,AF1-5,AG,2X,AH,AI,1X,ALC,2,AM1-7,AN1C,2,AN2C,2,A'/ CHARACTER*60 OFFAC 1 /'N3C,2,AN4C,2,AN5C,2,AN6C,2,AN7C,2,AN1-7(1-11),AP1-7,AQ1-7,2X,/ CHARACTER*16 OFFAD 1 /',AR1-7,AS,AT,AU.'/ EQUIVALENCE(OFFAA(1),FGENER) EQUIVALENCE(OFFAA(1),OFFAB) EQUIVALENCE(OFFAA(61),OFFAC) EQUIVALENCE(OFFAA(121),OFFAD) C********************************************************************* DIC1800 SUMMARY: 25 FIELD(S) PROCESSED DIC1809 WARNING: 5 FIELDNAME(S) TRUNCATED DIC1818 WARNING: 11 FORMAT(S) CHANGED DIC1819 MESSAGE: 7 SLACK BYTE(S) GENERATED DIC1847 MESSAGE: 3 FIELD(S) SKIPPED FOR RECORDBUFFER STRUCTURE DIC1848 MESSAGE: 1 PE-GROUP(S) 'STRUCT' DEFINITION SET TO 'N'