Chapter 3 : The DB123 Program Generator


3.01 Overview

The DB123 program generator may be used to support you in the following tasks:

 3.2 DB123 parameter syntax & examples.

DB123 is invoked from the command line in the format

cmd>DB123 dictionary [actions [ file-classes]] [ ( options ) ]

When you want to select multiple actions or file-classes, please separate them by a plus-sign(+).

 

For instance:

cmd>DB123 SQLACC PEBSY AGENTUR

cmd>DB123 SQLACC PEBSY  LIEFSOFO+LIEFTERM

cmd>DB123 DOWNLOAD PEBSY  GUTBEL+REMISS (DEBUG)

cmd>DB123 DOWNLOAD MASTER ALL

cmd>DB123 UPLOAD TEST GUTBEL+REMISS

 

3.3  The GLOBALS file (db123.global)

You may want to distribute your various COBOL-Programs, COPY-books, generated ACCESS routines, etc to various directories (Windows) or mini-disks (CMS).
A central file
db123.global  is used fo this pupose, for example:

db123.global      2004-02-23 16:53:10

/* DBDICT: SET GLOBAL PP VARIABLES FOR DB123 database-converter */
/* 21.11.2002: new version for PC NetRExx usage */
/* : variables are now case-sensitive (for Java) */
/* : ============================= */
/***************************************************************/
decimal_point=','

pp_customer='Donauland'
pp_project='DB123'
pp_task='DL/I to DB2 conversion'
pp_mark='>'

pp_Y2K='§'
dateform_table='DATEFORM.TABLE' /* use Donauland dateform table */
datename_table='DATENAME.TABLE'
pp_EURO='$'

/* SUFFIX for decimal fields (Groschen) in Donauland screens */
decimal_suffix ='DEZ KOMMA NK KOM'
/* Dezimalstellen als eigenes Feld in screen*/
attrbyte_suffix = 'A' /* suffix used for attrbyte in screens */
lengthbyte_suffix ='L' /* suffix used for length byte in sceens */
/* PREFIX for generated money constants */
money_const='KONST-BETRAG'

/* MONEY NAME RULES FOR EURO ANALYSIS ***********************/
classdef_file='EUROPA.CLASSDEF'

trace_money=0 /* 1 = display money tests */
debug_money =0 /* 1 = debug money algorithms */

ft_copy='cpy' /* file type of copy books in Micro-Focus */
ft_cobol='cbl' /* file-type 'cbl' for Micrfocus COBOL*/

/* FILE-Pathes for generated programs/copies */
fp_sqlmaps='' /* SQL maps in current directory */
fp_newdict='D:\DB123\samples\new_pebsy' /* for generated NEW Dictionaries */
fp_compdir='D:\DB123\samples\new_pebsy\Compdir' /* for generated DIR-files (MFC) */
fp_hostcopy='D:\DB123\samples\new_pebsy\includes' /* for generated SQL HOST Var copies */
fp_soft='D:\cob2mfc' /* file path of software (Development version) */

fp_DataDict='' /* OLD DL/I dictionary always in current directory */
fp_access='D:\DB123\samples\new_pebsy\access' /* for generated access routines */
fp_idecl='' /* always in current direcotory */
fp_icode=''
fp_error=''
fp_decl=''
fp_doit1999=''
fp_logfile=''
fp_codefile=''
fp_new_copy='D:\DB123\samples\new_pebsy\includes' /* File path for generated NEW copies (SQL compatible) */
fp_sqltables= 'D:\DB123\samples\new_pebsy\SQLTables' /* new SQL Table definitions */
fp_new_idecl=''
fp_new_icode=''
fp_new_source=''
fp_copy=''
fp_work=''
/* note use Microfocus copy pathes */
copy_path='. .\includes' /* current diretory has always precedence*/
copy_libs='cpy prodcopy koopcopy' /* do still support old file types */
/**********************************************************/
/* ... general GLOBAL PP parameters (special characters) */

/* ... define margins and position of Y2K_marker */
lmargin=1 /* left margin of source */
rmargin=72 /* right margin of source */
lsequence=73 /* start of seq-number, if present*/
rsequence=80 /* end of seq-number, if present */
card_size=80 /* end of card, if present */
/* note: on IBM computers, columns rseq... thru card_size contain seq*/
Y2K_column=2 /* starting column of Y2K marker */

/* ... define special characters */
underline='_'
hyphen='-'
semicolon=';'
colon=':'
dot='.'
question_mark='?'
exclamation_point='!'
hash_sign='#'
vertical_bar='|'
paragraph='§'

/*... define markers used */
mark_subroutine='>>'
mark_generated='++'
mark_historic='--'
mark_ignore='##'
mark_human='??'
mark_reserved='@@'
mark_master='$$'

/* ... define special user options (PP vs 4.8) */
cobol_quote="'"
log_by_module=0
doit_by_module=0
dates_by_module=0

/* preprocessor modes */
prep_mode='B' /* Batch/Online flag fin column 1 for Donauland */
prep_col_1=1

/* CLASS definitions */
class_count='Count'
class_money='Money'
class_date='Date'

/*************************************************************/

 

Feel free to adapt this control file to your personal need.

3.5  DB123 Program generator ACTIONS

When you are invoking DB123 without any parameters, the possible ACTIONS are displayed and you are prompted to ENTER the actions, the dictionary-name, the optional file-classes (within this dictionary), and the desired options in turn.

The DIALOG will look as follows:

D:\db123\samples\new_pebsy>DB123

DB123 vs 14.05:
================

the syntax of DB123 is:


cmd>DB123 actions dictionary [file-classes] [(options]]

DB123 supports the following actions:
=====================================

CREATE -- CREATE SQL/DB2 Tables (FileType SQLTAB)
DOWNLOAD -- generate DOWNLOAD program (for file-transfer)
for each VSAM record type, each DLI/Segment and DB2 table
a DOWNLOAD file in the CSV-file format is created

JCL -- generate JCL for DOWNLOAD-Program (IBM VSE)
UPLOAD -- generate correspondig UPLOAD program for loading CSV-File
This program reads the CSV-File-Format generated by the
DOWNLOAD programs and pushes the data in the
respective files (VSM ESDS/KSDS) again.

BUILD -- generate BUILD program (build the new DB2 database on same machine)
UNLOAD -- generate UNLOAD-program (BINARY UNLOAD)
SQLMAP -- generate SQLMAP files (SQL <==> COBOL map)
SQLACC -- generate DB2 ACCESS inline-code access procedures
SUBROUT -- generate standard Access SUBROUTINES (GET, NEXT, NWP,
INSERT, REPLACE, DELETE

HOSTVAR -- generate DB2 HOST variable definitions
NEWCOPY -- generate NEW DB2 compatible COPY books

note that this step will include all "logical parent keys"
in the COBOL copy books (with the correct prefix, of course
and also add the UPDATE-DATE and UPDATE-ID items to the
COPY book!

NEWDICT -- generate NEW DB2 Data Dictionary referencing the DB2-Tables
DOCUMENT -- Generate HTML Data Dictionary Documentation

Enter Actions:
Enter Data Dictionary:
Enter File-Classes (or Enter):
Enter Options:

Please remember that you will have to separate multiple actions or multiple file-classes by a plus sign (+) when they are entered in the command line.