Previous Topic: POSITION CommandNext Topic: RENUMBER Command


PREVIOUS Command

The PREVIOUS command locates the previous occurrence of a string of characters. The search begins with the line before the current top line of the display region and processes backward.

The PREVIOUS command applies to certain components (see Notes). When editing a report definition, working data, or parameter definition, PREVIOUS applies only to the field name. You can use the ERROR operand to locate statements the compiler marked as an error in the procedure definition.

Use the COLUMNS operand or the SET EDIT BOUNDS command to restrict the search to an inclusive range of columns. You can also locate a specific number of occurrences.

This command has the following format:

PREVIOUS [1  ] [/string/]
         [n  ] [ERROR   ]
         [ALL]         
         [COLUMNS start‑column [MAX       ]]
         [                     [end‑column]]
1| n| ALL

The maximum number of occurrences of the string to find. The default is 1. Specifying 1 positions the previous occurrence of the string at the top of the region with subsequent lines filling the region. Specify ALL to locate all occurrences of the string. If you specify ALL or any value greater than 1, only the lines containing the string display. Use scrolling commands or function keys to view all occurrences if the display exceeds the size of the region.

/

The character that delimits the search string. You must use the same character consistently in a command. You can use any special character except the currently defined command delimiter (installed default is a semicolon (;)) or comment character (installed default is a colon (:)), an asterisk (*), an at sign (@), a pound sign (#), or a dollar sign ($).

string

A character or string of characters to find. If you do not specify a string, the string specified on the previous FIND, INCLUDE, EXCLUDE, FIRST, NEXT, PREVIOUS, or LAST command is used as a default value.

The string cannot include the string delimiter character or the current command delimiter.

ERROR (Procedure definition only)

Locates a line that the compiler marked as an error (using the MEL=YES operand of the COMPILE command and SET EDIT HIGHLIGHT ERRORS). You cannot specify column ranges.

start‑column

The column where the search for the string begins.

end‑column

The column where the search for the string ends.

MAX

Default. The furthest right‑hand column.

The PREVIOUS command applies to the components listed below. Default column boundaries for each component are also listed.

 

Column Edited

Column Boundaries

Member

Data area

1‑72

Report

 

 

Detail

Field name

1‑25

Heading

Field name

1‑56

Column

Field name

1‑25

Program

 

 

Procedure

Data area

1‑72

Parameter

Field name

1‑19

Working data

Field name

1‑19

Dataview

 

 

Field

Field name

1‑19

Key (VSAM)

Field name

1‑32

Plan

 

 

DBRM

DBRM

1‑8

Resource

Program name

1‑8

If you use the n operand and specify ALL or any value greater than 1, only the lines that contain the string display. You can use the following commands without changing this display:

FIND, FIRST, NEXT, PREVIOUS, or LAST (where n > 1)
IGNORE
SCROLL

The use of any command other than those listed above replaces this display with a display showing the lines of data in sequence.