9 Must-see features to migrate your PowerBuilder application

Visual Expert Features for Code Migration

Whether you're moving to PB 2017, upgrading your database, going mobile or migrating to 64-bit, it's always a challenge to rework large and complex applications.

This article introduces tools coming with Visual Expert and simplifying your migration.

Clean-up your code

Why migrate obsolete or unused code? Better find and remove it...

  1. Find and remove unused objects and methods
  2. Find and remove duplicated objects

Estimate the migration effort

This feature will calculate the number of objects, methods, and lines of code in your application, to help you estimate the migration effort

  1. How many Lines of Code, objects and methods in your PB app?

Find and replace obsolete features

You may have to replace obsolete features: deprecated PB functions, unsupported features for Appeon web/mobile migration, old OLE objects, unsecured web services calls.

  1. Find where a given feature is used in your code

64-bit migration - Update dll dependencies

If you’re migrating to 64 bits, you need to check whether your application is using 32 bits dlls and update each reference to use 64 bits dlls instead.

  1. Find calls to 32 bits dlls

Review client / server dependencies

Depending on the nature of your migration, you may have to review and update the dependencies between your PB client and database:

  1. Which objects use which tables, in what way (CRUD Matrix)?
  2. Which objects call which stored procedures?

Isolate modules from the rest of the application

You may need to isolate some parts of your application:

  • To migrate a subset of your features to Appeon Mobile or Appeon Web
  • To split a large set of code into several smaller ones
  • To move some PB logic to the server (into Web services, Stored Procedures, dlls...)
  1. Check dependencies at PBL level

Document the changes made during the migration

Once the migration completed, keep track of all the changes made for future references.

  1. Compare the code before & after migration

Try Visual Expert Now

Clean-up your code

Find and remove unused objects and methods

Why do this?

Most large applications include a fair number of obsolete objects that are no longer called by the rest of the application. They usually stay there, as they are not so easy to identify. A migration is a good occasion to get rid of them: why bother migrating obsolete code indeed?

Visual Expert will list possibly unused objects so that you can remove them if needed.

Expected results

Find unused PowerBuilder Objects

How to get there?

  1. Install Visual Expert for PowerBuilder and create a new project to analyze your code
  2. To find unused PowerBuilder objects, select a target, a PBL, or an Object type (Windows, UO, DW…) in the treeview, and click on "Possibly Unused Objects".
  3. To find unused PowerBuilder methods, variables and parameters, select a PB Object and click on "Possibly Unused items".
  4. To find unused Oracle PL/SQL or SQL Server Transact-SQL objects, select an application, a package or an object type and click on "Unused components".

Note: An object is considered "unused" when the code analysis could not find any reference to this object. There is always the possibility for dynamic references that cannot be detected in the source code (static analysis). Still, "unused" features will help to focus on a very small number of "probably unused objects", rather than checking the entire application. If needed, you can also search for the name of a given object (simple string search). In the Ribbon menu, go to "Search" and enter the object name in the field "Source code".

Find and remove duplicated objects

Why do this?

While your application can include some copies of objects under modifications in a temporary PBL, most duplicated are left behind, unused components that can be removed to enlighten your code.

Visual Expert will generate a list of all PBL objects that belong to the same target and have the same name and type.

Expected Result

Find duplicated PowerBuilder Objects

How to get there?

  1. Install Visual Expert for PowerBuilder and create a new project to analyze your code.
  2. To find duplicated PowerBuilder objects, select a target and click on "Duplicated Components".
  3. To identify possibly duplicated Oracle PL/SQL or SQL Server Transact-SQL functions or procedures, select the corresponding object type(s) at the root of the treeview, and click on "Find similar items".

Estimate the migration effort

How many Lines of Code, objects, and methods in your PowerBuilder app?

Why do this?

Based on your experience, and depending on the nature and complexity of your application, you may have some internal metrics defining an average migration cost per object, method, and/or line of code.

Visual Expert will calculate the number of items for you so that you can estimate your migration effort.

Expected results

Visual Expert provides Code Metrics: the number of PowerBuilder or Database items in an application

How to get there?

  1. Install Visual Expert for PowerBuilder and create a new project to analyze your code.
  2. As soon as the code is analyzed, the number of key PowerBuilder, Oracle, PL/SQL, SQL Server and Transact-SQL objects will show up in the treeview.
  3. To calculate the number of Lines of PowerBuilder Code, select a target, a PBL, an Object type (Windows, UO, DW...) or specific PB Object(s) and click on "Lines of Code".
  4. To calculate the number of Lines of PL/SQL or Transact-SQL Code, select an object type at the root of the treeview, or specific Object(s) and click on “Lines of Code”.
  5. To calculate the number of PowerBuilder functions, events, variables, and constants, select a target, a PBL, an Object type (Windows, UO, DW…) or specific PB Object(s) and click on “Item count”.

Find and replace obsolete features

Find where a given feature is used in your code

Why do this?

You may have to replace obsolete features in your application: deprecated PB functions, unsupported feature when migrating to Appeon web/mobile migration, old OLE objects, unsecured calls to web services.

Visual Expert will show where each feature is used in your code.

Expected Result

Find references to a given PowerBuilder Feature or stored procedure, web service etc. in your code

How to get there?

  1. Install Visual Expert for PowerBuilder and create a new project to analyze your code.
  2. To find the calls to a given PowerBuilder feature (built-in object, control, method or attribute), select the virtual application “PowerBuilder System Object” in the top section of the treeview.
    Then click on "All PB objects" and open the type of item you're looking for (e.g. "Functions").
    Locate the deprecated PB feature (e.g. systemfunctions.findclassdefinition).
    Click on “Impact Analysis”.
  3. To find the calls to an external object or method, checkout the list of external functions: select a PB target in the treeview, click on “External Functions” and search for the function name in the search field above the treeview. Once the external function is selected, click on “Impact Analysis”

64-bit migration - Update dll dependencies

Find calls to 32-bit dlls

Why do this?

Some PowerBuilder applications include calls to Windows APIs or integrate with 3rd party tools by calling their dlls. If you’re migrating to 64-bit, you need to check whether your application is using 32-bit dlls and update each reference to use 64-bit dlls instead.

Visual Expert will list all the dll used by your application, as well as the dll functions called, and find all references to each dll function in the PowerBuilder code.

Expected result

Find calls to 32-bit dlls in your PowerBuilder Code

How to get there?

  1. Install Visual Expert for PowerBuilder and create a new project to analyze your code.
  2. To find the calls to a given dll function, open the list of dll at the root of the treeview, double-click on the dll, select the dll functions you’re looking for and click on “Impact Analysis”.
  3. To identify the PowerBuilder objects declaring functions from this dll, select the dll in the treeview and click on “PB Components linked”
  4. To find functions from a dll, that are declared, but unused in your code, select the dll and click on “Unused external functions”

Review client/server dependencies

Which objects use which tables, in what way (CRUD Matrix)?

Why do this?

Depending on the nature of your migration, you may have to review and update dependencies to database tables.

This matrix will show which PowerBuilder and DB objects are calling tables, and indicate for which type of access (Create, Read, Update, Delete).

Expected result

Overview of Process-to-Data dependecies in PowerBuilder

How to get there?

  1. Install Visual Expert for PowerBuilder and create a new project to analyze your code.
  2. In the treeview, double-click on the table icon, select one or several tables and click on “Create a CRUD Matrix”. An Excel file is generated with the CRUD matrix, that you can open, comment and share if needed.
  3. If you need to learn more about the dependencies to a particular table, select this table in the treeview and click on “Impact Analysis”. All the calls to the table will show up.
  4. Select an object in the result to see the exact reference(s) in its code.

Which objects call which stored procedures?

Why do this?

As for the table (see above), you may have to review and update dependencies to Stored Procedures, for instance when replacing some of them with web services.

For each PBL, Visual Expert will list the PowerBuilder objects calling stored procedures, indicate the procedures called, and show the corresponding references in the PB code.

Expected Results

Find the PowerBuilder objects calling stored procedures

How to get there?

  1. Install Visual Expert for PowerBuilder and create a new project to analyze your code.
  2. Select one or several PBLs in the treeview and click on “Stored Procedures Called”. The result will show up, no matter you included the code of the procedure in your project or not (Oracle PL/SQL or SQL Server Transact-SQL). The Visual Expert code parsers will primarily track references to Stored Procedure in the PowerBuilder code to build this list.
  3. In the result, select a PowerBuilder Object to see the reference(s) to the procedure(s) in its code.
  4. If you need to list only the references to a given procedure, select this procedure and click on “Impact Analysis”

Isolate modules from the rest of the application

Check dependencies between PBLs

Why do this?

Along the migration process, you may need to isolate some parts of your application:

  • to migrate a subset of your features to Appeon Mobile or Appeon Web
  • to split a large set of code into smaller ones
  • to move some PowerBuilder logic to the server (into Web services, Stored Procedures, dlls...)

Visual Expert will show dependencies between PBLs in your app.
If you select several PBLs composing a given module, you can then check and update their dependencies to other PBLs and modules.

Expected result

Review PBLs Dependencies in your PowerBuilder Code

How to get there?

  1. Install Visual Expert for PowerBuilder and create a new project to analyze your code.
  2. In the treeview, double-click on the PBL icon, select the PBLs composing your module and click on “PBL dependencies”.
  3. If dependencies to a given PBL need to be reviewed in detail, select this PBL and click on “External References”. This will show all references to objects of this PBL, coming from objects located in other PBL(s).

Document the changes made during the migration

Compare the code before & after migration

Why do this?

Once the migration completed, keep track of all the changes made for future references.

Expected result

Compare Versions of your PowerBuilder Code before and after migration

How to get there?

  1. Install Visual Expert for PowerBuilder and create a new project to analyze your code.
  2. In the treeview, select a PBL or a PB object(s) of your choice.
  3. In the menu go to “Comparison” then go to “Compare with analysis”.
  4. Choose the analysis you need then click on “Compare”
PowerBuilder, Oracle, SQL Server, Code Exploration, VE 2017