EXTRACT Macro

The EXTRACT macro extracts a segment from a text string.

Parameters: EXTRACT Macro

Example 1: EXTRACT Macro

In the following example, the EXTRACT macro is used to extract the text string DEF. Because no value is specified in the Find Text field, the reference point for the starting position is the first character of the value of the Input field. In this example, the first character of the extract is the 5th character of the Input text string (D), and because the length to extract is 3, the resulting extract is DEF.

PROD----- Automation Services : EXTRACT Macro Parameter Definition ------------ Command ===> Function=BROWSE .- Where to Extract From -----------------------------------------------------. | Input .... ABC DEF GHI JKL MNO | | (Text String or Variable(s)) | '-----------------------------------------------------------------------------' .- Variable to hold Extracted String -----------------------------------------. | Output ... FRED (Variable Name) | | | '-----------------------------------------------------------------------------' .- How to do the Extraction --------------------------------------------------. | Starting Position ... 5 (Extraction to begin from this position. (1-256)) | | | | Length to Extract ... 3 (Extract data for this length. (1-256)) | | | | Find Text ........... | | (Extraction to begin from the start of this text + Starting Position) | '-----------------------------------------------------------------------------' F1=Help F2=Split F3=Exit F9=Swap

Example 2: EXTRACT Macro

In the following example, the EXTRACT macro is used to extract the text string GHI J. Because no value has been given to the Starting Position field, the reference point for the starting position is the value of the Find Text field. In this example, the first character of the extract is the first character of the Find Text string (G), and because the length to extract is 5, the resulting extract is GHI J.

PROD----- Automation Services : EXTRACT Macro Parameter Definition ------------ Command ===> Function=BROWSE .- Where to Extract From -----------------------------------------------------. | Input .... ABC DEF GHI JKL MNO | | (Text String or Variable(s)) | '-----------------------------------------------------------------------------' .- Variable to hold Extracted String -----------------------------------------. | Output ... FRED (Variable Name) | | | '-----------------------------------------------------------------------------' .- How to do the Extraction --------------------------------------------------. | Starting Position ... (Extraction to begin from this position. (1-256)) | | | | Length to Extract ... 5 (Extract data for this length. (1-256)) | | | | Find Text ........... GH | | (Extraction to begin from the start of this text + Starting Position) | '-----------------------------------------------------------------------------' F1=Help F2=Split F3=Exit F9=Swap

Example 3: EXTRACT Macro

In the following example, the EXTRACT macro is used to extract the text string HI JK. In this example, a value has been given to the Find Text field, and therefore that value becomes the reference point for the starting position. Because a value of 2 has been given to the Starting Position field, the first character of the extract is the second character of the Find Text string (H), and because the length to extract is 5, the resulting extract is HI JK.

PROD----- Automation Services : EXTRACT Macro Parameter Definition ------------ Command ===> Function=BROWSE .- Where to Extract From -----------------------------------------------------. | Input .... ABC DEF GHI JKL MNO | | (Text String or Variable(s)) | '-----------------------------------------------------------------------------' .- Variable to hold Extracted String -----------------------------------------. | Output ... FRED (Variable Name) | | | '-----------------------------------------------------------------------------' .- How to do the Extraction --------------------------------------------------. | Starting Position ... 2 (Extraction to begin from this position. (1-256)) | | | | Length to Extract ... 5 (Extract data for this length. (1-256)) | | | | Find Text ...........GH | | (Extraction to begin from the start of this text + Starting Position) | '-----------------------------------------------------------------------------' F1=Help F2=Split F3=Exit F9=Swap


Copyright © 2010 CA. All rights reserved.