Managing the code slice for a workbook
After you create a workbook, you can add an extra code slice to the workbook or delete a code slice from the workbook as needed.
Adding an extra code slice to a workbook
After you create a workbook, you can add extra code blocks by slicing on the key conditions to the workbook.
To add a code slice, complete the following steps:
- Select the specific workbook that you want to add a code slice.
- Select a type of Key conditions from the drop-down list if desired, the conditions that are highlighted in the source viewer will change depending on your selection.
- Right-click a key condition and then select the option to slice on conditional statement to the
current workbook. Or, select the non-highlighted lines that you want to add, right-click, and then
select the option to copy selected lines to the current workbook.
- If the selected line has multiple key conditions, click the drop-down list. Select the key
condition to compute the code slice to add, and click Next.
- Optional: In the dialog that is displayed, add tags.
- Click Save to add the code slice.
Deleting a code slice from a workbook
After you create a workbook with code blocks that are sliced on conditional statements and paragraphs, you can delete a code slice that is not needed from the workbook.
Attention:
- The option to delete a code slice is available only for conditional statements and paragraphs.
- The option is not an undo action of slicing on conditional statements or paragraphs to a
workbook. When you select the option, the code blocks that are sliced will be computed and verified
whether the code blocks can be deleted or not. A code block from a slice cannot be deleted in the
following conditions.
- The code block is referenced by other code blocks in the workbook.
- The contents of the code block are modified.
- Any code block that is referenced by the code blocks that cannot be removed because they fulfill the conditions in this list.
- If a COBOL code block that needs to be deleted is a part of a larger code block, the lines of the code block will be commented out in the larger code block.
To delete a code slice, complete the following steps:
- Select the specific workbook that you want to delete a code slice from the Workbooks page.
- Select the Conditional statements or Paragraphs from the Key conditions drop-down list if desired, the conditions that are highlighted in the source viewer will change depending on your selection.
- Right-click a key condition and then select the option to delete the code slice from the current
workbook.
- If the selected line has multiple key conditions, click the drop-down list and select the key
condition to compute the code slice to delete.
- Click Delete.
Restriction: The delete algorithm relies on the references and relationships between
code blocks, and how the static information is computed from IBM® ADDI. However, the code blocks are not parsed in the
workbook. If the contents of code blocks are modified or code blocks are created by users, the
delete algorithm will not figure out the references and relationships between the code
blocks.