Accessing and modifying the Macro code

You can create and modify the Macro source code with the Macro COBOL editor. The input in this editor is made easy by function and subfunction creation wizards, snippets, and micropatterns. The Macro code structure view displays the structure of the Macro with the hierarchy of functions and subfunctions. You can display the structure in the skeleton of a program that is retrieved from a selected model.

About this task

The Macro code must be entered in the COBOL Source tab of the Macro design editor. The functions and subfunction nodes are instantaneously displayed in the Macro code structure view.

Functions and subfunctions are inserted according to their codes. The cursor position is irrelevant.

You can enter source code in any order in the Macro editor. For example, you can create a function 22 after a function 01. In this case, the view shows the hierarchy of the code in the correct order but the editor and the Macro code structure view are out of synchronization. The selections in the tree are disabled. You must then resynchronize the editor and the view by selecting Synchronize the COBOL source with the code structure view in the contextual menu of the editor. This choice is also available in the Macro code structure view menu.

Procedure

You can modify or create source code in different ways:

Results

The source code modifications are now available in the COBOL Source tab of the Macro design editor. You can call the Macro from a Program, Screen, or Server and generate the calling instance.

If errors are detected in the Macro source code, they are displayed in various places.

They are displayed in the COBOL Source tab of the Macro design editor and in the Macro code structure view:
  • Information (information) is displayed on the first line of a function and subfunction that contains detail lines only. The level is missing. This error does not prevent the generation of the Programs, Screens, or Servers that call the Macro.

    To add the level, set your cursor on the line that contains the error symbol in the source code. Right-click and select Update the function or subfunction. Enter the level in the wizard that opens then.

  • Warning (warning) is displayed on the function or subfunction attributes line to flag erroneous references. This error is detected when Data Elements or Segments that are subject to controls do not exist or are not called in the Screen or Server. This error does not prevent the generation of the Screens or Servers that call the Macro.

    References are displayed as REF= on the Macro attributes line.

    To specify another Data Element or Segment, set your cursor on the line that contains the error symbol in the source code. Right-click and select Update the function or subfunction. Click Next in the wizard that opens then, and enter a Data Element or a Segment that is called in the Screen or Server.

  • Error (error) is displayed for all the other error types that prevent the generation. In this case, the Macro code structure view is empty. The function and subfunction modification wizard is not available. You must modify the source code manually before generating.

The errors are also displayed in the Problems view when you save the Macro, load or rebuild the local workspace, or generate the instance that calls the Macro. In this view, these errors are typed as RPP Design Pacbase Problem.


Feedback