local proprocessor support in rdz 7 · 2.3 create a local property group for compile the concept of...

15
Local Proprocessor Support in RDz 7.5 http://www.soforte.de [email protected] Version 1.1 As of: 09 June 2009

Upload: others

Post on 10-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Local Proprocessor Support in RDz 7 · 2.3 Create a Local Property Group for Compile The concept of a Property Group was newly introduced with RDz 7.5. The definitions for “local”

Local Proprocessor Support

in

RDz 7.5

http://www.soforte.de

[email protected]

Version 1.1

As of: 09 June 2009

Page 2: Local Proprocessor Support in RDz 7 · 2.3 Create a Local Property Group for Compile The concept of a Property Group was newly introduced with RDz 7.5. The definitions for “local”

RDz local Preprocessor Support Page 2

Contents

1 General ............................................................................................................................................ 3

2 Local Preprocessor in RDz ............................................................................................................. 4

2.1 Compile the Preprocessor in RDz and as an EXE Link .......................................................... 4

2.2 Copy the EXE File into the Bin Directory of the RDz Installation ......................................... 4

2.3 Create a Local Property Group for Compile ......................................................................... 4

2.4 Create a Local Property Group for a Compile with the Preprocessor ................................. 5

2.5 Error Feedback ........................................................................................................................ 8

2.6 Example of a Local Preprocessor .......................................................................................... 11

List of Illustrations

Figure 2-1: Create the new Property Group ............................................................................................ 5

Figure 2-2: Designate the new Property Group ...................................................................................... 5

Figure 2-3: Select Properties ................................................................................................................... 6

Figure 2-4: Edit Properties ....................................................................................................................... 7

Figure 2-5: Local Preprocessor Parameter ............................................................................................ 12

Figure 2-6: Assign the Property Group to the Sample Project (1) ......................................................... 13

Figure 2-7: Assign the Property Group to the Sample Project (2) ......................................................... 13

Figure 2-8: Testing the Sample Program ............................................................................................... 14

Figure 2-9: Local Syntax Check .............................................................................................................. 14

Figure 2-10: Remote Error List View ..................................................................................................... 15

Figure 2-11: Failure Indication in the Test Program .............................................................................. 15

Page 3: Local Proprocessor Support in RDz 7 · 2.3 Create a Local Property Group for Compile The concept of a Property Group was newly introduced with RDz 7.5. The definitions for “local”

RDz local Preprocessor Support Page 3

1 General

For the first time ever, with the IBM Rational Developer for System z (RDz), it is possible to inte-

grate your own preprocessor into the “local Compile/Link process” (considering that “remote Com-

pile” already provided this support). Supposedly, any need to integrate more than one preprocessor

before doing a local Compile will be supported in future RDz versions.

If other preprocessors in operations under z/OS, IMS or DB2 are installed in addition to the standard

precompiler or rather the coprocessor for CICS, it is also desirable (where applicable) to be able to

merge these in the local environment in order, for example, to receive support for a local syntax

check with error feedback.

A prerequisite for support of error feedback is that the preprocessor be available as the source, so

that any customization during the creation of an XML file can be carried out in the preprocessor.

The procedure during the integration of your own preprocessor is as follows:

• adapt the Preprocessor (e.g. as COBOL Source) for the support of error feedback, then lo-

cally compile and link as EXE

• copy the EXE file in the bin directory of the RDz installation

• create the Property Group for local Compile

• record the call-up for the preprocessor (with parameters) in the Property Group under “Lo-

cal Preprocessor”

Page 4: Local Proprocessor Support in RDz 7 · 2.3 Create a Local Property Group for Compile The concept of a Property Group was newly introduced with RDz 7.5. The definitions for “local”

RDz local Preprocessor Support Page 4

2 Local Preprocessor in RDz

2.1 Compile the Preprocessor in RDz and as an EXE Link

A preprocessor, which until now has been used under z/OS, can essentially be taken over on a 1:1

basis provided no z/OS specific services are used and an EXE file executable under Windows can be

created.

Adjustments have to be made to the I/O file definitions, given that now the file inputs and outputs no

longer come from the mainframe.

If error feedback is desired (see below), adjustments have to be made in the source of the prepro-

cessor in order to create the Error Feedback XML file. The creation of this file is incumbent on the

preprocessor. An essential component of the Error Feedback XML file is the so-called Statement

Table, which shows how the lines in the output file created by the preprocessor result from the

lines of the input files read into the preprocessor.

2.2 Copy the EXE File into the Bin Directory of the RDz Installation

The preprocessor being integrated has to be available as an EXE file. This EXE file can be created,

for example, by RDz itself, while the source is customized and compiled in a local project. For im-

plementation, the created EXE file has to be copied into the bin folder of the RDz installation direc-

tory, because from there the DDLs will be linked at run-time (as of RDz 7.5, this restriction may be

not applicable to newer releases).

2.3 Create a Local Property Group for Compile

The concept of a Property Group was newly introduced with RDz 7.5. The definitions for “local”

and, respectively, “remote” Compile can be deposited in a Property Group. Subsequently, local

projects and, respectively, remote sub-projects will be linked (associated) as necessary with the ap-

propriate Property Group.

The path to the EXE file will be registered in the Property Group under the rider “Local Processor”

in the field “Processor Name”. In addition, the preprocessor parameter can be given in the field

“Arguments”. Finally, it can be specified whether the preprocessor supports error feedback.

Page 5: Local Proprocessor Support in RDz 7 · 2.3 Create a Local Property Group for Compile The concept of a Property Group was newly introduced with RDz 7.5. The definitions for “local”

RDz local Preprocessor Support Page 5

2.4 Create a Local Property Group for a Compile with the Preprocessor

Figure 2-1: Create the new Property Group

Figure 2-2: Designate the new Property Group

Page 6: Local Proprocessor Support in RDz 7 · 2.3 Create a Local Property Group for Compile The concept of a Property Group was newly introduced with RDz 7.5. The definitions for “local”

RDz local Preprocessor Support Page 6

Figure 2-3: Select Properties

Page 7: Local Proprocessor Support in RDz 7 · 2.3 Create a Local Property Group for Compile The concept of a Property Group was newly introduced with RDz 7.5. The definitions for “local”

RDz local Preprocessor Support Page 7

Figure 2-4: Edit Properties

Page 8: Local Proprocessor Support in RDz 7 · 2.3 Create a Local Property Group for Compile The concept of a Property Group was newly introduced with RDz 7.5. The definitions for “local”

RDz local Preprocessor Support Page 8

The following variables can be used with the definition of the Preprocessor:

${project_loc}

Path to the current project in the file system

${resource_fn}

Name of current resource without file extension

${resource_loc}

Path to current resource in the file system

2.5 Error Feedback

Error feedback means that errors, which arise during the Compile/Link process, will be indicated in

the “Remote Error List View”.

By double-clicking on a message in the “Remote Error List View”, the relevant file will be edited and

then positioned on the appropriate source line in which the error arose.

Additionally, the line will be marked with an appropriate flag.

The support of error feedback will be implemented via an XML file which the preprocessor has to

create.

The preprocessor is indicated by the Error Feedback XML file:

Which source files were “read in”

Which target files were created

Which error messages are to be produced

Allocation of the lines from the source files to the lines in the target files

In support, the Error Feedback file allots the following XML tags:

<FILEREFERENCETABLE>

List of source files

<MESSAGE>

to the generated error message

<OUTFILEREFERENCETABLE>

List of target files

Page 9: Local Proprocessor Support in RDz 7 · 2.3 Create a Local Property Group for Compile The concept of a Property Group was newly introduced with RDz 7.5. The definitions for “local”

RDz local Preprocessor Support Page 9

<STATEMENTTABLE>

Allocation: Line in target file to line from source file

Example of an Error Feedback XML File:

<?xml version="1.0" standalone="yes"?>

<BUILD>

<PACKAGE>

<FILEREFERENCETABLE>

<FILECOUNT>3</FILECOUNT>

<FILE>

<FILENUMBER>1</FILENUMBER>

<FILENAME>C:\RDz\WSe\COBSamp2\cobol\cbldbgex.cbl</FILENAME>

</FILE>

<FILE>

<FILENUMBER>2</FILENUMBER>

<FILENAME>C:\RDz\WSe\COBSamp2\CopyLib\copy01.cbl</FILENAME>

</FILE>

<FILE>

<FILENUMBER>3</FILENUMBER>

<FILENAME>C:\RDz\WSe\COBSamp2\CopyLib\copy02.cbl</FILENAME>

</FILE>

</FILEREFERENCETABLE>

<MESSAGE>

<MSGNUMBER>CPY00099-S</MSGNUMBER>

<MSGLINE>13</MSGLINE>NE>

<MSGFILE>1</MSGFILE>

<MSGTEXT>THE COPY copy03. WAS NOT FOUND</MSGTEXT>

</MESSAGE>

<OUTFILEREFERENCETABLE>

<OUTFILECOUNT>1</OUTFILECOUNT>

<OUTFILE>

<OUTFILENUMBER>1</OUTFILENUMBER>

<OUTFILENAME>cbldbgex_PP.dek</OUTFILENAME>

</OUTFILE>

</OUTFILEREFERENCETABLE>

<STATEMENTTABLE>

(1,1,1,1);

(2,1,2,1);

(3,1,3,1);

(4,1,4,1);

(5,1,5,1);

(6,1,6,1);

(7,1,1,2);

(8,1,2,2);

(9,1,3,2);

(10,1,4,2);

(11,1,8,1);

(12,1,9,1);

(13,1,10,1);

(14,1,11,1);

(15,1,1,3);

(16,1,14,1);

(17,1,15,1);

</STATEMENTTABLE>

</PACKAGE>

</BUILD>

Page 10: Local Proprocessor Support in RDz 7 · 2.3 Create a Local Property Group for Compile The concept of a Property Group was newly introduced with RDz 7.5. The definitions for “local”

RDz local Preprocessor Support Page 10

Explanation of the XML Tags:

<FILEREFERENCETABLE>

<FILECOUNT> Number of input files

<FILENUMBER> Sequential number of the input file

<FILENAME> Name of the input file including file path

Note: the closing tag has to appear directly at the end of

the file name

<MESSAGE>

<MSGNUMBER> Internal message number. In order to support different

message levels, it is necessary to give each number a suffix

that corresponds to the appropriate IBM convention (-I, -W,

-E, -S).

<MSGLINE> Source line, in which the error arose

<MSGFILE> Source file number, for the file in which the error arose

<MSGTEXT> Internal error message

<OUTFILEREFERENCETABLE>

<OUTFILECOUNT> Number of output files

<OUTFILENUMBER> Sequential number of the output file

<OUTFILENAME> Name of the output file without description of path

Note: the closing tag has to appear directly at the end of

the file name

<STATEMENTTABLE>

(zl,zf,ql,qf) An entry in the Statement Table is to be read as follows:

Line zl in the target file number zf corresponds to the line ql

in the source file number qf.

Page 11: Local Proprocessor Support in RDz 7 · 2.3 Create a Local Property Group for Compile The concept of a Property Group was newly introduced with RDz 7.5. The definitions for “local”

RDz local Preprocessor Support Page 11

Consequently, the principal task is to amplify the Preprocessor in such a way that additionally an

XML file will be produced with the format described above.

Note: It is definitely recommended that the XML file be accurately created in the format described

above. Small and apparently insignificant deviations from XML conformity can lead to the fact that the

created file will not continue to be processed in its entirety. For example, the following output for-

mats are not permitted (as of RDz 7.5.0):

Blank spaces within the Statement Table

Left-hand zeros within the Statement Table

Blank spaces before and after values; i.e. after an XML tag, the value should be immediately

provided and immediately after the value should be the end tag. Also, the skipping of lines is

not permitted here

<MESSAGE></MESSAGE> without further contents

2.6 Example of a Local Preprocessor

The preprocessor “resolvinc” recognizes “INC lines” in a COBOL source and cancels the indicated

“Include” if it is found in the COPYLIB directory that comes as a parameter with the preprocessor.

Page 12: Local Proprocessor Support in RDz 7 · 2.3 Create a Local Property Group for Compile The concept of a Property Group was newly introduced with RDz 7.5. The definitions for “local”

RDz local Preprocessor Support Page 12

The definition page for the local preprocessor appears as follows:

Figure 2-5: Local Preprocessor Parameter

Page 13: Local Proprocessor Support in RDz 7 · 2.3 Create a Local Property Group for Compile The concept of a Property Group was newly introduced with RDz 7.5. The definitions for “local”

RDz local Preprocessor Support Page 13

The associated property group “ResolveInc” is assigned to the sample project COBSamp2:

Figure 2-6: Assign the Property Group to the Sample Project (1)

Figure 2-7: Assign the Property Group to the Sample Project (2)

Page 14: Local Proprocessor Support in RDz 7 · 2.3 Create a Local Property Group for Compile The concept of a Property Group was newly introduced with RDz 7.5. The definitions for “local”

RDz local Preprocessor Support Page 14

The COBOL source in the local project COBSamp2 appears as follows:

Figure 2-8: Testing the Sample Program

Now a local syntax check is performed on this source:

Figure 2-9: Local Syntax Check

Page 15: Local Proprocessor Support in RDz 7 · 2.3 Create a Local Property Group for Compile The concept of a Property Group was newly introduced with RDz 7.5. The definitions for “local”

RDz local Preprocessor Support Page 15

Two error messages appear in the Remote Error List View:

Figure 2-10: Remote Error List View

Double-clicking on the error messages leads to the incorrect source lines in the LPEX Editor:

Figure 2-11: Failure Indication in the Test Program

The second error appears in the copy “copy02”. A field is referenced that is not defined in the

Working-Storage Section. Hence, in this case, the copy “copy02” is opened and positioned on the

error line.