Selecting COBOL for conversion
This form controls the downloading of COBOL record definitions and their conversion to Jazz. It appears when you’ve clicked [New] and selected Data/Import from COBOL.
It looks like this: -
When opened with Test Environment = IDE (Jazz Configuration, Lang tab) the options to download from z/OS and to delete the downloaded COBOL after conversion are not offered, as the COBOL is already available within your IDE or local environment.
Here you
choose whether to process COBOL from your z/OS system or a COBOL record
definition that is already in your Windows folders. This checkbox does not appear if your test
environment = IDE (Jazz Configuration, Language tab).
·
If
you check zOS COBOL then Library will be set to your
z/OS copy library. See the library “Copy” on the z/OS tab of
Configuration.
·
If
you check DCLGEN then Library will be set to that defined as DCLGEN on the z/OS
tab of Configuration
·
Else
Local will convert COBOL that is already in a folder on your PC.
You can
edit the library textbox to choose another folder/PDS.
When this
form is opened a complete list of members is displayed: -
·
Either
zOS COBOL or DCLGEN checked: all the members of the relevant z/OS library
·
Local
checked: all the members of the local
COBOL library that have extension .CBL, .CPY, or .TXT
You can use
a filter to show a partial list. Filters function as in Windows Explorer, so
you can use “*” as a wildcard.
Click on
the member that you want to convert. If
Download from zOS is checked it will be copied to
your local COBOL library. The [Convert]
button becomes active. Click [Convert]
and the COBOL will be converted to Jazz unless there is already an item in your
Jazz Copy Library with this name. For
example, if since there is an item CBANKDAT.jzc in my
Jazz Copy Library, on attempting to convert it again I get this msgbox: -
[Yes]:
conversion proceeds and the Jazz workbench will open on the newly-converted CBANKDAT.jzc. The
previous copy is now overwritten.
[No]: An InputBox appears
asking you for a new name: -
This name
will be checked, if it exists in your Jazz Copy Book folder, then you will
again be asked whether to overwrite it.
[Cancel]:
the Cobol Conversion will close having done nothing, leaving a blank workbench.
If you
don’t want the defaults, select the conversion options: -
·
All
Comments (Default). Any comments in the
original COBOL are retained, plus Jazz includes the original COBOL as comments
·
COBOL. Comments from the original COBOL are dropped,
but Jazz includes the original COBOL statements as comments.
·
No
comments. Neither of these: the only
comment generated by Jazz is the identifying timestamp at the top.
·
Auto (default). Jazz looks for comments showing that this
record layout has been generated by the Web Services Assistant program DFHWS2LS,
or a SQL DCLGEN. If it finds this, the
conversion type becomes DFHWS2LS or DCLGEN.
If not, the type becomes Varchar.
·
Basic. Jazz doesn’t look for Varchar structures, nor
for DFHWS2LS nil indicators.
·
VarChar. Jazz
looks for structures consisting of a SMALLINT followed by a CHAR, followed by
the end of the group. When this is
found, instead of generating the group, two fields, and the end of the group,
Jazz generates a VARCHAR field.
·
DHFWS2LS. With this option, Jazz applies VarChar rules, and in addition any CHAR(1) field whose name
starts with “attr-nil-” becomes an OPTIONAL property
added to the preceding field (or group).
These fields are handled implicitly in Jazz, and you shouldn’t need to
explicitly refer to them.
·
DCLGEN. A DCLGEN creates a layout starting with EXEC
SQL DECLARE xxx TABLE … END-EXEC., and then a COBOL record layout. Only the EXEC SQL statement is processed,
the COBOL in the DCLGEN is ignored. See DCLGEN to Jazz Conversion for more information.
By
default: checked when Download from zOS is checked, unchecked when it’s not.
If checked,
the downloaded COBOL object will be deleted from the local COBOL library after
its conversion to Jazz.
Click
[Convert] to convert the COBOL definition to Jazz.
Click
[Exit] to exit from the New dialog
Click
[Cancel] to close the Download COBOL form, and choose another New option.
A DCLGEN
creates a layout starting with EXEC SQL DECLARE xxx TABLE … END-EXEC., and then
a COBOL record layout. When DCLGEN
rules are applied then Jazz uses only the DECLARE Table, creating a Jazz definition
that includes this as a comment and then a Jazz-format definition based on
it.
A Jazz
DEFINE statement has a similar format to a SQL table definition, and Jazz does
not have to recognize groups as VARCHAR fields because VARCHAR is a supported
format in both SQL and Jazz. The COBOL
definition is ignored, and Jazz will use the column names as field names. These may be COBOL reserved words, as in any
Jazz definition.
This section
does not apply to DCLGEN conversion.
Jazz will
attempt to convert your COBOL to Jazz.
It will apply these rules: -
·
Only
data definition lines – starting with a level number and ending with a period –
are processed. Comments are passed
through to the generated Jazz if Comment Level = All. Other COBOL lines (from Environment,
Procedure divisions etc) become temporary comments: they are displayed as
comments in the converted Jazz, but will not be saved.
·
If
the first record layout does not start with level 01 then Jazz assumes a level
01 using the member name.
·
01
to 49 are handled as field or group definitions. A definition lacking a picture clause, like
05
Name.
becomes a group name, and must be followed by at least one field with a higher
level number. END GROUP is recognized when
the next element with the same or lower level number is encountered.
·
In
COBOL field names often include a prefix so that programmers do not have to
write qualified references like “ACCOUNT OF MFILE”, instead referring to
“MFL-ACCOUNT”. However Jazz always used
qualified names and so the prefixes would be superfluous and
counter-productive, so if the record name has been defined with a prefix (e.g.
“01 MFL-Record.”) then this prefix is
recognized and removed from all contained fields and groups, unless so doing
would make the field name invalid because it would start with a number.
·
Level
88 definitions become CONDITION or CODES clauses added to the preceding field
definition.
·
Pseudo
text. When a line containing pseudo text
delimited with colons is encountered, e.g.
000500 01 :ABCF:-RECORD.
Jazz asks you to give a value for this: -
The value you enter is then substituted on all
following lines: -
000600 03
:ABCF:-FILE PIC X(02).
000700 88
:ABCF:-FILE-IS-HEADER
VALUE LOW-VALUES.
000800 88
:ABCF:-FILE-IS-TRAILER
VALUE HIGH-VALUES.
etc
Ironically this COBOL feature is usually used
as a name prefix, which the COBOL to Jazz conversion will then remove.
Once you
have converted a record layout to Jazz you should edit it. COBOL definitions lack a lot of information:
you should add TYPE and DSNAME clauses for PSAM and VSAM records (not for SQL). For all types, add field or group properties KEY, UKEY, and DKEY to denote key fields, and add field properties
like display formats, headings, validation criteria (RANGE,
CHECKR, EXISTS,
etc), CODES tables, and so on.
All these
changes make the data definition more powerful, reducing the amount of
procedural code that you’ll have to write later and enforcing consistency,
while forming excellent documentation, all for zero cost because these only
influence the code that MANASYS Jazz generates when they are relevant. For example, validation properties are only
used when data is validated by an ACCEPT
statement, they do no have any effect on normal reading, writing, and printing.
IBMUSER.MANAJAZZ.CPYLIB(IN1A)
was currently open in a TSO (ISPF) edit session. This problem was fixed by closing the TSO
edit session.