Previous Topic: FIND Command

Next Topic: SPECS Command

CHANGE Command

The CHANGE command is optional. When specified, it must follow the INPUT command that defines the data file to be processed. It is used to define a relative field in an input record to be CHANGEd and the data used to facilitate this. It is not necessary to code FIND command(s) in order to use the CHANGE function. CHANGE commands entered with FIND command(s) are applied only to those records selected by the FIND command(s). Conversely, CHANGE commands entered independently of FIND commands are applied to all records in the input file.

   Command    Operands
CHANGE=t'data',POS=nnnnn,OFFSET=nnnnn,OFFSIZ=n,RDW

where:

t

(required) is the data type.

c

specifies that the following data is considered to be character data and used as is.

x

specifies that the following data is considered to be hex data.

p

specifies that the following data is considered to be packed.

data

(required) is the actual data string to be placed in the record. The data must be enclosed in single quotes.

POS=nnnnn

(required) a 1- to 5-digit numeric value specifying the starting position, relative to zero (0), of the target data within the record. For variable length records (RECFM=VB or RECFM=VBS), the standard 4-byte RDW field is ignored for purposes of coding POS=n. That is, POS=0 addresses the first byte of the record itself (not the first byte of the RDW). This rule is adjusted if OFFSET is also coded.

OFFSET=nnn

(optional) a 1- to 5-digit numeric value used to defines the starting position, relative to zero (0), of a field containing an offset value that when added to the start of the record, addresses a data segment within the record.

When OFFSET= is specified, the keyword POS= refers to the start of the data segment itself, not the start of the record.

OFFSIZ=n

where n is a value between 1 and 4 that defines the size of the field found at OFFSET=nnnnn.

RDW

(optional) specifies that the value found at OFFSET= includes a 4-byte length for the record descriptor word.