COBOL to Oracle PL/SQL Online Presentation


Demo presentation text:

Hello!

Today in this demo, I will show how SQLWays tool can automatically convert Cobol Programs to Oracle PL/SQL scripts. For this type of migration, Ispirer provides several tools: the first one, SQLWays Studio, you can see it on your screen.

Before running the migration, you need to specify source like COBOL and target direction it is Oracle in our case -and then open some script for the migration. For example, it is simple COBOL script that displays first demo.

Every COBOL procedure consists of 4 divisions:

First, identification division - this is where you must enter the program name (in our case it is Demo ID). You can place here some comments about your program.

Secondly, environment division -this is where you define the files and program that you need in this COBOL program.

Thirdly, data division this is where you can declare variables, records and files.

And the last, procedure division - this is where you write the program and all business logic is placed here.

When the script is open, you only need to click button Run and wait for the result.

In the right panel, you can see the result. COBOL program is converted to package and Oracle package specification is generated. Procedure division is migrated to main procedure that is placed in package and in the package body, you can see this procedure.

DISPLAY statement is converted to DBMS_OUTPUT.PUT_LINE method with the same string “First Demo” in it. We can open another script, for example, here you can see the declaration of two (2) variables. In the procedure division there are move statement and perform statements that execute two (2) paragraphs. First paragraph is S1000, here is also move statement, and second is S1001 with move statement. Let’s run the migration and see the result.

During the migration, you can see how the migration process is running – how many lines are there in your script and how many seconds is necessary to complete the migration. The result is appeared in the right panel. Lets review it.

All variables are converted to package variables with appropriate types in Oracle. Here you can see x60 is successfully converted to CHAR(60). Procedure division is converted to main procedure and it is added to package specification. In the procedure, MOVE statements are migrated to ASSIGN statements; and PERFORM statements are successfully converted to CALLs of procedures. Exit statement is converted to Return. Two (2) paragraphs are converted to Oracle procedures. These procedures are only used internally in package body. We can only run and have access to main procedure in package.

So as you can see, SQLWays Studio is a very useful tool when you need to convert separate script and review the result, for example, how SQLWays converts some statement or construction from COBOL to Oracle. When you need to convert multiple scripts or, for example, the whole COBOL application, for this purposes Ispirer provides another tool – SQLWays Commander - you can see it on your screen now. This tool is very similar with SQLWays Studio.

You also need to specify source like COBOL and target like Oracle. In this case, you can choose 1, 2, or 3 scripts for the migration or you can choose the whole directory where scripts of your whole COBOL application are placed.

You need to run the migration, and in the window that appeared you can review that source, and target directions are specified.

Convert TO - it is folder where the output PLSQL scripts will be generated. For example, we want to place it to RSLT directory. When the directory already exists the results will be placed there, or if it’s a new one, this directory will be created.

In File Mask you can specify type of files you need to migrate. For example, we want to migrate COBOL programs (*.cob) or Copy block of COBOL (*.cpy). If all scripts should be migrated, you can leave file mask as it is *.* and run the migration.

Below you can see that all files from sample directory are recognized. There are nine files. Here you can see that every script goes to converter. In addition, here there is the information about every script, for example, 61 lines and you need 30 seconds to complete.

The total information about the conversion is appeared after the migration. You can see that nine scripts were converted and we have near 321 lines. We need only near 50 seconds to complete this migration.

In the appeared directory RSLT we can see the results of migration. You can review the results. For example let’s take a look at perform until procedure. The declare variables are successfully converted to variables of package; all types are correctly recognized. If statement is successfully converted. PERFORM UNTIL is successfully converted to WHILE LOOP. You can see that comments of COBOL program are saved and Exit statement is converted to Return.

SQLWays can automatically convert COBOL records to Oracle records. Lets look at a script, you can see, that for every record, the user-defined type in Oracle is created with the definition of rows. When sub-record is used – it is also created in user-defined type and then it is used in another type of the main layer. Then it is created like variable of this type in the package.

When this record is used in the source, SQLWays automatically correctly colors it to the specific variables of types with all sub-layers in it. Here you can see it. Also SQLWays can automatically convert Embedded SQL statements from COBOL to Oracle. For example, here you can see how SQL SELECT statement is successfully converted to SELECT statement in Oracle and here the migration of indicator is performed to CASE expression in Oracle. Here you can see that for error-handling- exception section is generated.

SQLWays supports the migration of CURSORs. Let’s open some script with Cursor in EXEC SQL statements. There is a declaration of cursor open, FETCH into variables and Close. SQLWays converts it to cursor statements; FETCH and Close statements.

SQLWays can automatically convert arrays in COBOL. You can see that it is converted to user-defined type with VARRAY of number and then it is used in another type. Here there is a definition of array variable in package. Then when we use it, we can see that it is colored correctly by our tool.

As you can see SQLWays can automatically convert COBOL programs to PLSQL code. SQLWays can highly reduce time and risks for this migration because it is done automatically.

If you are interested in these services or tools please contact us. All information you can find on our site ispirer.com. We will be happy to assist you in this type of migration. Thank you for your attention. Bye!

Do you want to move from COBOL to Oracle PL/SQL?

Let's do it together!

Learn more