Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COBOL source generator?

Status
Not open for further replies.

RonaldB

Programmer
Nov 28, 2000
196
US
I was wondering if anyone knew of a sort of source generator for COBOL programs.
I envision a tool, preferably visual, which makes it possible to enter a program structure using any of the known structuring methods or a derivative, and offer the possibility to enter specific code for each sequence in the structure, and to set parameters for iterations, optionals, etc. After this it should be possible to generate the desired COBOL source code based on the information entered.
Anyone?

Regards,
Ronald.
 
Isn't there a CA product that does this? Cool:gen or the like?
 
Sounds like it would be easier to just write the program. I have developed a technique to clone useful code and embed replaceable parameters. Here is an example to create a callable vsam file handler. I have a routine that converts the 'useful program' to a BAT file.

VSAMIO.BAT
**********
@ECHO OFF
IF "%1"=="" GOTO ERROR
IF "%2"=="" GOTO ERROR
IF "%3"=="" GOTO ERROR
ECHO ****************************************************************** > %1.CPY
ECHO 01 %1-PARAMETERS. >> %1.CPY
ECHO ****************************************************************** >> %1.CPY
ECHO * >> %1.CPY
ECHO 05 %1-CALL-FUNCTION PIC X(02). >> %1.CPY
ECHO 78 %1-READ-KEY VALUE "RK". >> %1.CPY
ECHO 78 %1-READ-NEXT VALUE "RN". >> %1.CPY
ECHO 78 %1-READ-PREVIOUS VALUE "RP". >> %1.CPY
ECHO 78 %1-READ-FIRST VALUE "RF". >> %1.CPY
ECHO 78 %1-READ-LAST VALUE "RL". >> %1.CPY
ECHO 78 %1-WRITE-RECORD VALUE "WR". >> %1.CPY
ECHO 78 %1-REWRITE-RECORD VALUE "RR". >> %1.CPY
ECHO 78 %1-DELETE-RECORD VALUE "DR". >> %1.CPY
ECHO 78 %1-START-EQUAL VALUE "SE". >> %1.CPY
ECHO 78 %1-START-LT VALUE "SL". >> %1.CPY
ECHO 78 %1-START-GT VALUE "SG". >> %1.CPY
ECHO 78 %1-OPEN-FILE VALUE "OF". >> %1.CPY
ECHO 78 %1-CLOSE-FILE VALUE "CF". >> %1.CPY
ECHO 05 %1-RETURN-CODE PIC X(02). >> %1.CPY
ECHO 05 %1-FILE-ID PIC X(256). >> %1.CPY
ECHO 05 %1-RECORD-WORK. >> %1.CPY
ECHO 10 %1-KEY PIC X(%2). >> %1.CPY
ECHO 10 %1-DATA PIC X(%3). >> %1.CPY
ECHO * >> %1.CPY
ECHO **** %1-SAMPLES-LINES. >> %1.CPY
ECHO * >> %1.CPY
ECHO * MOVE %1-READ-KEY TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-READ-NEXT TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-READ-PREVIOUS TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-READ-FIRST TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-READ-LAST TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-WRITE-RECORD TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-REWRITE-RECORD TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-DELETE-RECORD TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-START-EQUAL TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-START-LT TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-START-GT TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-OPEN-FILE TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-CLOSE-FILE TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE ZERO TO %1-RETURN-CODE. >> %1.CPY
ECHO * MOVE "XXXXXXXXXXXXXXX" TO %1-FILE-ID. >> %1.CPY
ECHO * MOVE "XXXXXXXXXXXXXXX" TO %1-RECORD-WORK. >> %1.CPY
ECHO * PERFORM 9000-CALL-%1. >> %1.CPY
ECHO *9000-CALL-%1. >> %1.CPY
ECHO * CALL "%1" USING %1-PARAMETERS. >> %1.CPY
ECHO ****************************************************************** >> %1.CPY
ECHO * >> %1.CPY
ECHO ****************************************************************** > %1.CBL
ECHO * >> %1.CBL
ECHO IDENTIFICATION DIVISION. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO PROGRAM-ID. %1. >> %1.CBL
ECHO AUTHOR. CLIVE CUMMINS. >> %1.CBL
ECHO INSTALLATION. TUBULARITY. >> %1.CBL
ECHO DATE-WRITTEN. JAN 1, 1996. >> %1.CBL
ECHO * >> %1.CBL
ECHO *-**************************************************************** >> %1.CBL
ECHO *- %1 >> %1.CBL
ECHO *- >> %1.CBL
ECHO *- VSAM FILE IO MODULE * >> %1.CBL
ECHO *-**************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * MODIFICATION LOG >> %1.CBL
ECHO * CCYYMMDD MODIFICATION >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO ENVIRONMENT DIVISION. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO INPUT-OUTPUT SECTION. >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO FILE-CONTROL. >> %1.CBL
ECHO SELECT %1-FILE ASSIGN %1-FILE-ID >> %1.CBL
ECHO FILE STATUS IS %1-RETURN-CODE >> %1.CBL
ECHO ACCESS IS DYNAMIC >> %1.CBL
ECHO ORGANIZATION IS INDEXED >> %1.CBL
ECHO RECORD KEY IS %1-REC-KEY. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO DATA DIVISION. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO FILE SECTION. >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO ******************************** >> %1.CBL
ECHO FD %1-FILE. >> %1.CBL
ECHO ******************************** >> %1.CBL
ECHO 01 %1-RECORD. >> %1.CBL
ECHO 02 %1-REC-KEY PIC X(%2). >> %1.CBL
ECHO 02 %1-REC-DATA PIC X(%3). >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO WORKING-STORAGE SECTION. >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO 01 PROGRAM-DETAILS. >> %1.CBL
ECHO 05 PROGRAM-RELEASE. >> %1.CBL
ECHO 10 PROGRAM-NAME PIC X(08) VALUE '%1'. >> %1.CBL
ECHO 10 PROGRAM-REL PIC X(08) VALUE ' 1.0.00'. >> %1.CBL
ECHO 05 PROGRAM-COPYRIGHT. >> %1.CBL
ECHO 10 PROGRAM-COPY PIC X(16) VALUE 'COPYRIGHT: 1996'. >> %1.CBL
ECHO 10 PROGRAM-AUTH PIC X(16) VALUE ' Clive Cummins.'. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO LINKAGE SECTION. >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO COPY %1.CPY. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO PROCEDURE DIVISION USING %1-PARAMETERS. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO 1000-CONTROL. >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO MOVE %1-KEY TO %1-REC-KEY. >> %1.CBL
ECHO MOVE %1-DATA TO %1-REC-DATA. >> %1.CBL
ECHO * >> %1.CBL
ECHO EVALUATE %1-CALL-FUNCTION >> %1.CBL
ECHO WHEN EQUAL %1-READ-KEY PERFORM READ-KEY >> %1.CBL
ECHO WHEN EQUAL %1-READ-NEXT PERFORM READ-NEXT >> %1.CBL
ECHO WHEN EQUAL %1-READ-PREVIOUS PERFORM READ-PREVIOUS >> %1.CBL
ECHO WHEN EQUAL %1-READ-FIRST PERFORM READ-FIRST >> %1.CBL
ECHO WHEN EQUAL %1-READ-LAST PERFORM READ-LAST >> %1.CBL
ECHO WHEN EQUAL %1-WRITE-RECORD PERFORM WRITE-RECORD >> %1.CBL
ECHO WHEN EQUAL %1-REWRITE-RECORD PERFORM REWRITE-RECORD >> %1.CBL
ECHO WHEN EQUAL %1-DELETE-RECORD PERFORM DELETE-RECORD >> %1.CBL
ECHO WHEN EQUAL %1-START-EQUAL PERFORM START-EQUAL >> %1.CBL
ECHO WHEN EQUAL %1-START-LT PERFORM START-LT >> %1.CBL
ECHO WHEN EQUAL %1-START-GT PERFORM START-GT >> %1.CBL
ECHO WHEN EQUAL %1-OPEN-FILE PERFORM OPEN-FILE >> %1.CBL
ECHO WHEN EQUAL %1-CLOSE-FILE PERFORM CLOSE-FILE >> %1.CBL
ECHO END-EVALUATE. >> %1.CBL
ECHO * >> %1.CBL
ECHO MOVE %1-REC-KEY TO %1-KEY. >> %1.CBL
ECHO MOVE %1-REC-DATA TO %1-DATA. >> %1.CBL
ECHO * >> %1.CBL
ECHO GOBACK. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO OPEN-FILE. >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO OPEN I-O %1-FILE. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO READ-FIRST. >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO MOVE LOW-VALUES TO %1-RECORD. >> %1.CBL
ECHO PERFORM START-GT. >> %1.CBL
ECHO PERFORM READ-NEXT. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO READ-LAST. >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO MOVE HIGH-VALUES TO %1-RECORD. >> %1.CBL
ECHO PERFORM START-LT. >> %1.CBL
ECHO PERFORM READ-NEXT. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO READ-PREVIOUS. >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO PERFORM START-LT. >> %1.CBL
ECHO PERFORM READ-NEXT. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO READ-NEXT. >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO READ %1-FILE NEXT. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO READ-KEY. >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO READ %1-FILE KEY IS %1-REC-KEY. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO START-EQUAL. >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO START %1-FILE KEY IS EQUAL %1-REC-KEY. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO START-LT. >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO START %1-FILE KEY IS LESS THAN %1-REC-KEY. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO START-GT. >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO START %1-FILE KEY IS GREATER THAN %1-REC-KEY. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO REWRITE-RECORD. >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO REWRITE %1-RECORD. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO WRITE-RECORD. >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO WRITE %1-RECORD. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO DELETE-RECORD. >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO DELETE %1-FILE RECORD. >> %1.CBL
ECHO * >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO CLOSE-FILE. >> %1.CBL
ECHO ****************************************************************** >> %1.CBL
ECHO * >> %1.CBL
ECHO CLOSE %1-FILE. >> %1.CBL
ECHO * >> %1.CBL
TYPE %1.CBL
GOTO END
:ERROR
ECHO ****************************************
ECHO Builds a callable COBOL file handler
ECHO for a VSAM file.
ECHO ****************************************
ECHO Parameter(s)...
ECHO 1 = ProgID
ECHO 2 = VSAM Key length
ECHO 3 = VSAM Data length
:END

 
Oops it got truncated. Here is a simpler version.

VSAMIO.BAT
**********
@ECHO OFF
IF "%1"=="" GOTO ERROR
IF "%2"=="" GOTO ERROR
IF "%3"=="" GOTO ERROR
ECHO 01 %1-PARAMETERS. >> %1.CPY
ECHO 05 %1-CALL-FUNCTION PIC X(02). >> %1.CPY
ECHO 78 %1-READ-KEY VALUE "RK". >> %1.CPY
ECHO 78 %1-READ-NEXT VALUE "RN". >> %1.CPY
ECHO 78 %1-READ-PREVIOUS VALUE "RP". >> %1.CPY
ECHO 78 %1-READ-FIRST VALUE "RF". >> %1.CPY
ECHO 78 %1-READ-LAST VALUE "RL". >> %1.CPY
ECHO 78 %1-WRITE-RECORD VALUE "WR". >> %1.CPY
ECHO 78 %1-REWRITE-RECORD VALUE "RR". >> %1.CPY
ECHO 78 %1-DELETE-RECORD VALUE "DR". >> %1.CPY
ECHO 78 %1-START-EQUAL VALUE "SE". >> %1.CPY
ECHO 78 %1-START-LT VALUE "SL". >> %1.CPY
ECHO 78 %1-START-GT VALUE "SG". >> %1.CPY
ECHO 78 %1-OPEN-FILE VALUE "OF". >> %1.CPY
ECHO 78 %1-CLOSE-FILE VALUE "CF". >> %1.CPY
ECHO 05 %1-RETURN-CODE PIC X(02). >> %1.CPY
ECHO 05 %1-FILE-ID PIC X(256). >> %1.CPY
ECHO 05 %1-RECORD-WORK. >> %1.CPY
ECHO 10 %1-KEY PIC X(%2). >> %1.CPY
ECHO 10 %1-DATA PIC X(%3). >> %1.CPY
ECHO * >> %1.CPY
ECHO **** %1-SAMPLES-LINES. >> %1.CPY
ECHO * >> %1.CPY
ECHO * MOVE %1-READ-KEY TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-READ-NEXT TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-READ-PREVIOUS TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-READ-FIRST TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-READ-LAST TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-WRITE-RECORD TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-REWRITE-RECORD TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-DELETE-RECORD TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-START-EQUAL TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-START-LT TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-START-GT TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-OPEN-FILE TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE %1-CLOSE-FILE TO %1-CALL-FUNCTION. >> %1.CPY
ECHO * MOVE ZERO TO %1-RETURN-CODE. >> %1.CPY
ECHO * MOVE "XXXXXXXXXXXXXXX" TO %1-FILE-ID. >> %1.CPY
ECHO * MOVE "XXXXXXXXXXXXXXX" TO %1-RECORD-WORK. >> %1.CPY
ECHO * PERFORM 9000-CALL-%1. >> %1.CPY
ECHO *9000-CALL-%1. >> %1.CPY
ECHO * CALL "%1" USING %1-PARAMETERS. >> %1.CPY
ECHO ****************************************************************** >> %1.CPY
ECHO IDENTIFICATION DIVISION. >> %1.CBL
ECHO PROGRAM-ID. %1. >> %1.CBL
ECHO AUTHOR. CLIVE CUMMINS. >> %1.CBL
ECHO INSTALLATION. TUBULARITY. >> %1.CBL
ECHO DATE-WRITTEN. JAN 1, 1996. >> %1.CBL
ECHO *-**************************************************************** >> %1.CBL
ECHO *- %1 >> %1.CBL
ECHO *- >> %1.CBL
ECHO *- VSAM FILE IO MODULE * >> %1.CBL
ECHO *-**************************************************************** >> %1.CBL
ECHO ENVIRONMENT DIVISION. >> %1.CBL
ECHO INPUT-OUTPUT SECTION. >> %1.CBL
ECHO FILE-CONTROL. >> %1.CBL
ECHO SELECT %1-FILE ASSIGN %1-FILE-ID >> %1.CBL
ECHO FILE STATUS IS %1-RETURN-CODE >> %1.CBL
ECHO ACCESS IS DYNAMIC >> %1.CBL
ECHO ORGANIZATION IS INDEXED >> %1.CBL
ECHO RECORD KEY IS %1-REC-KEY. >> %1.CBL
ECHO DATA DIVISION. >> %1.CBL
ECHO FILE SECTION. >> %1.CBL
ECHO FD %1-FILE. >> %1.CBL
ECHO 01 %1-RECORD. >> %1.CBL
ECHO 02 %1-REC-KEY PIC X(%2). >> %1.CBL
ECHO 02 %1-REC-DATA PIC X(%3). >> %1.CBL
ECHO WORKING-STORAGE SECTION. >> %1.CBL
ECHO 01 PROGRAM-DETAILS. >> %1.CBL
ECHO 05 PROGRAM-RELEASE. >> %1.CBL
ECHO 10 PROGRAM-NAME PIC X(08) VALUE '%1'. >> %1.CBL
ECHO 10 PROGRAM-REL PIC X(08) VALUE ' 1.0.00'. >> %1.CBL
ECHO LINKAGE SECTION. >> %1.CBL
ECHO COPY %1.CPY. >> %1.CBL
ECHO PROCEDURE DIVISION USING %1-PARAMETERS. >> %1.CBL
ECHO 1000-CONTROL. >> %1.CBL
ECHO MOVE %1-KEY TO %1-REC-KEY. >> %1.CBL
ECHO MOVE %1-DATA TO %1-REC-DATA. >> %1.CBL
ECHO EVALUATE %1-CALL-FUNCTION >> %1.CBL
ECHO WHEN EQUAL %1-READ-KEY PERFORM READ-KEY >> %1.CBL
ECHO WHEN EQUAL %1-READ-NEXT PERFORM READ-NEXT >> %1.CBL
ECHO WHEN EQUAL %1-READ-PREVIOUS PERFORM READ-PREVIOUS >> %1.CBL
ECHO WHEN EQUAL %1-READ-FIRST PERFORM READ-FIRST >> %1.CBL
ECHO WHEN EQUAL %1-READ-LAST PERFORM READ-LAST >> %1.CBL
ECHO WHEN EQUAL %1-WRITE-RECORD PERFORM WRITE-RECORD >> %1.CBL
ECHO WHEN EQUAL %1-REWRITE-RECORD PERFORM REWRITE-RECORD >> %1.CBL
ECHO WHEN EQUAL %1-DELETE-RECORD PERFORM DELETE-RECORD >> %1.CBL
ECHO WHEN EQUAL %1-START-EQUAL PERFORM START-EQUAL >> %1.CBL
ECHO WHEN EQUAL %1-START-LT PERFORM START-LT >> %1.CBL
ECHO WHEN EQUAL %1-START-GT PERFORM START-GT >> %1.CBL
ECHO WHEN EQUAL %1-OPEN-FILE PERFORM OPEN-FILE >> %1.CBL
ECHO WHEN EQUAL %1-CLOSE-FILE PERFORM CLOSE-FILE >> %1.CBL
ECHO END-EVALUATE. >> %1.CBL
ECHO MOVE %1-REC-KEY TO %1-KEY. >> %1.CBL
ECHO MOVE %1-REC-DATA TO %1-DATA. >> %1.CBL
ECHO GOBACK. >> %1.CBL
ECHO OPEN-FILE. >> %1.CBL
ECHO OPEN I-O %1-FILE. >> %1.CBL
ECHO READ-FIRST. >> %1.CBL
ECHO MOVE LOW-VALUES TO %1-RECORD. >> %1.CBL
ECHO PERFORM START-GT. >> %1.CBL
ECHO PERFORM READ-NEXT. >> %1.CBL
ECHO READ-LAST. >> %1.CBL
ECHO MOVE HIGH-VALUES TO %1-RECORD. >> %1.CBL
ECHO PERFORM START-LT. >> %1.CBL
ECHO PERFORM READ-NEXT. >> %1.CBL
ECHO READ-PREVIOUS. >> %1.CBL
ECHO PERFORM START-LT. >> %1.CBL
ECHO PERFORM READ-NEXT. >> %1.CBL
ECHO READ-NEXT. >> %1.CBL
ECHO READ %1-FILE NEXT. >> %1.CBL
ECHO READ-KEY. >> %1.CBL
ECHO READ %1-FILE KEY IS %1-REC-KEY. >> %1.CBL
ECHO START-EQUAL. >> %1.CBL
ECHO START %1-FILE KEY IS EQUAL %1-REC-KEY. >> %1.CBL
ECHO START-LT. >> %1.CBL
ECHO START %1-FILE KEY IS LESS THAN %1-REC-KEY. >> %1.CBL
ECHO START-GT. >> %1.CBL
ECHO START %1-FILE KEY IS GREATER THAN %1-REC-KEY. >> %1.CBL
ECHO REWRITE-RECORD. >> %1.CBL
ECHO REWRITE %1-RECORD. >> %1.CBL
ECHO WRITE-RECORD. >> %1.CBL
ECHO WRITE %1-RECORD. >> %1.CBL
ECHO DELETE-RECORD. >> %1.CBL
ECHO DELETE %1-FILE RECORD. >> %1.CBL
ECHO CLOSE-FILE. >> %1.CBL
ECHO CLOSE %1-FILE. >> %1.CBL
TYPE %1.CBL
GOTO END
:ERROR
ECHO ****************************************
ECHO Builds a callable COBOL file handler
ECHO for a VSAM file.
ECHO ****************************************
ECHO Parameter(s)...
ECHO 1 = ProgID
ECHO 2 = VSAM Key length
ECHO 3 = VSAM Data length
:END
 
Didn't we have a proliferation of these types of tools back in the early 90's. I have a recollection of the Cobol death knell being sounded over Cobol generating case tools where the business models and structures were defined, and Cobol was magically produced out of the back end. The idea was that if the program fell over during the 2am run, the business analyst was going to be called to sort out the business model!

I think that there was a tool called IEF or something similar that was along these lines, and believe that it in some way or form has led into Cool:Gen as pipk states.

I personally believe that Clive is right in saying that it's probably easier to write it from scratch. Complete the analysis up front and pass the technical development over to a good technician who can use methods like those detailed by Clive to automate generation where possible.

Marc
 
Hi RonaldB,

I made a source generator. It uses a screen-layout as input. The screen, a line and a field activates a part of the internal skeleton that it uses. It generates one program and can take up to 99 screens as input. It is character based and - if I find a technical solution - I want to let it work with a HTML browser in the future.

Of course the whole thing is build on some assumptions. It also uses some standard routines I made for screen and keyboard handling.

It is smart to first write a skeleton of source with definable parts that correspond with the issues you want to recognize. You can structure that skeleton by creating smart prefixes on the source lines to use in a sort. If you find something in the input, you just generate the corresponding lines of source at once. The prefix + sort helps you to get it on the right place in the generated program.

Perhaps if you can define the input you want to correspond to the output - if I like that definition also - I give you a working example in a FAQ list if you like and if you want to share your ideas about your generator and most important the smart and short and easy to use input!

Regards,

Crox


 
The answer to the original question is "CA-Telon". IEF produced code that was impossible to maintain out side of the generator. Telon allows you to export the code and so that you can eliminate the generator. In other words, if you used IEF to create a set of programs and then decided you did not want to keep paying the licensing fees for IEF you would have to re-code all of the programs yourself. With Telon, you just export the programs and you are done.

Also, it is true that it is easier to code a program than it is to use a generator but the generator makes later maintenance far easier than it is to do it by hand.

The real problem with the generators was the programmers. They did not like giving up total control over the code that was generated so they would go into the "custom code" points and code around what the generator would create. This made development time and maintenance time increase significantly. So the code generators got the blame when it was really the programmers that were the cause of the problems.
 
Hi! My name is Jair M. Araujo, I am Brazilian, from Campo Grande-MS (BRAZIL), and I developed a Cobol Code generator directed to caracter mode (still). It generates Programs, Reports, Screens and Menus, quickly. Just type the FD, informing the basic properties of each field as nible, name, type, size, initial value (this exactly! Initial value for the fields of the FD can be defined, being that this initial value should be contain as explicit value as as one COBOL valid expression). The generated prgramas count on features as navigation type browse, ordered by an alternative key defined by the programmer. Also features as to resize the window browse, to move this window, to change the color of deep and color of the characters, to go for the first or last file record. Also, exists a incremental research system, where to each pressured keyboard key browse is brought up to date with registers that start for string typed. Very Good! It has a modulate of screens definitions, of data entries where the programmer easily
creates screens of data entries, not only the picture of the screen but all the stretch of source code referring to accept of all the fields of the screen, being enough inseriz it in the source .cbl by using the COPY statment. In I modulate it of criation of menus can be created
easily menus of excellent apresentation, with screensaver, type to baner, where the user should be
configure the text of the message that will be shown as to baner, how much the time for ativation and the speed of the message. The screensaver uses the own "font ", that I developed. Also, there are a interesting report viewer with inumerous resources as for example to
print the report in a Ink Jet printer or another printer. Its possible to create your own catalog printers and to
define the command for each printer function. It can also, in run time, to change the color of deep of the viewr, to change the PORT (LPT1, LPT2, etc) or still to send the report to a text file Still you can search anything in your report. It would have that to still speak on the report generator that is very good and easy to use.... but lacks time... I sugest that visit my hp in: - ALL ITS POSSIBLE IN COBOL!
The problem is the language... Not the Cobol, but the Portuguese or English... I don't speak english very well :)). Would be interesting that you untherstand the Portuguese... Jair M. Araujo
 
All,

sorry for getting back this late; i've been a bit busy.
I know of Cool:gen, and i have used Telon often, but both products are primarily aimed at online dialogs. Both Cool:gen and Telon have some batch-processing abilities, but these are limited to basic report processing. Also, both generate ghastly code...
I'm thinking about a development platform which would be able to cope with the more challenging batch processing programs, like multiple level and multiple balance-line types.
I'm an experienced programmer, so i don't deperately need it, i just wondered if such a tool could help speed development up and assure that sources all have sound, well-formed structure.

Regards,
Ronald.
 
Hi,

I am sure that high-quality products can be build, no doubt about that. Sometimes I have some time to make a piece of such a system. As a JSD/JSP adept, I would love to make such a tool. The problem is to get money to develop it. Also, when it is ready, you are just started. To sell it you need also lots of money. That is not my expertice but I build a lot of good things in the past, and selling it is difficult. It would be great to work for a R&D department of a big company that wants to develop this.

Regards,

Crox
 
In the realm of large corporate IT departments, the largest-selling COBOL code generator is probably ETI*Extract, a product of Evolutionary Technologies Incorporated, located in Austin, Texas, and found on the web at This is NOT a cheap product, by any means, so it is not available for casual use by those who are merely curious as to how it works. (I've also noticed that there is usually great interest in programmers who have ETI*Extract experience listed on their resumes.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top