BEA Logo BEA eLink Java Adapter for Mainframe WLS Edition

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   BEA eLink JAM Doc Home   |   BEA eLink Java Adapter for Mainframe WLS Edition User Guide   |   Previous Topic   |   Next Topic   |   Contents   |   Index

Code Generator Reference Pages

 

This appendix contains reference pages for the eLink Java Adapter for Mainframe WLS Edition COBOL code generator (EgenCobol). It describes the rules for writing the script file that controls the code generator.

 


EgenCobol

The EgenCobol tool maps a COBOL copybook into a Java class.

Synopsis

Invoke the tool with the following command:

java bea.jam.egen.EgenCobol scriptfile

where:

java

is the name of the Java virtual machine executable in the Java Development Kit (JDK).

bea.jam.egen.EgenCobol

is the full class name of the EgenCobol tool.

scriptfile

is the script file that controls the EgenCobol tool. You must write this script file on an application-by-application basis. (See Listing A-1 for an example).

Listing A-1 Example of scriptfile.egen


### example script
#

view demo.CustomDataView from emprec.cpy

service demoService accepts CustomDataView returns CustomDataView

page demoPage "Demo Page"
{
view demo.CustomDataView

buttons
{
"Try It" service(demoService) shows demoPage
}
}

servlet demo.DemoServlet shows demoPage


Script Syntax Reserved Words

The reserved words shown in Table A-1 must be used as specified in the Grammar section.

Note: A reserved word can be used as an identifier if it is enclosed in either single or double quotation marks (refer to General rules).

Table A-1 Reserved Words

accepts

buttons

client

ejb

from

group

is

method

class

page

reset

returns

server

service

servlet

shows

view

General rules

Grammar

The following grammar is described using a modified Backus-Naur Form (BNF) syntax, such as in many industry-standard software reference guides. It specifies a context-free grammar. Reserved words are shown in bold. Comments are in italics preceded by a dash (-).

script:

definition | script definition

definition:

viewdef | servicedef | servletdef | ejbdef | classdef | pagedef

viewdef:

view viewname from copybook

servicedef:

service servicename accepts fullViewname returns fullViewname

servletdef:

servlet classname shows pagename

ejbdef:

clientejb | serverejb

clientejb:

client ejb classname ejbregistration { clientmethods }

serverejb:

server ejb classname ejbregistration { servermethods }

classdef:

client class classname { clientmethods }

pagedef:

page pagename title { view viewname buttons { buttonlist } }

buttonlist:

buttondef | buttonlist buttondef

buttondef:

servicebutton | ejbbutton

clientmethodslist:

clientmethoddef | clientmethodlist clientmethoddef

clientmethoddef:

method methodname is servicename

servicebutton:

buttonname service ( servicename ) shows pagename

ejbbutton:

buttonname ejbmethod ( fullViewname ) returns fullViewname

viewname:

classname

fullViewname:

viewname | viewname [ codepage ]

copybook:

identifier

-An identifier that names a file containing a COBOL data definition.

servicename:

identifier

-An identifier that matches a resource definition in your jcrmgw.cfg file

pagename:

identifier

-An identifier that names a page definition.

codepage:

identifier

-The name of a codepage to be used for character translation to/from mainframe data formats. This must be a codepage supported by the JDK being used.

methodname:

identifier

-The name to be given to a generated Java method.

classname:

identifier

-An identifier that names a Java class, including any package name.

ejbregistration:

identifier

-The name that will be used to register the home interface for an EJB.

title:

identifier

-The title to be placed into the HTML generated for a page.

buttonname:

identifier

-A button name that will be used in the HTML generated for a page.

ejbmethod:

identifier

-An EJB classname and method specification that should look like this:

package.ejbclass.method

or

ejbclass.method

Results of Running the Code Generator