Previous Topic: SyntaxNext Topic: REFFILE


Parameters

RDW supports the following parameters:

N

For variable length records, the four-byte record descriptor word does not display and is not considered in positional parameters. The first data byte of the record is position 1. N is the default value, but it may have been changed during installation.

Y

For variable length records, the four-byte record descriptor word displays in the output of the PRINT command or is considered in the input positional parameter of any keyword. The first data byte of the input record is position 5 and the RDW is in position 1. With RDW(Y), the RDW is made available to the current command and its keywords. For example, it is available to move to a specific position within a record, to query its value, or to compare it to another RDW.

Example 1

This example copies a variable length record file to a fixed length record file and includes the RDW in the fixed length file. The MOVE keyword moves the RDW starting at position 1 of the input record to data position 1 of the output record.

READ,
  INFILE(VBFILE),
  RDW(Y),
  MOVE(1,0,1),
  WRITE(FBFILE)

Example 2

This example identiies any records with a length of 80. (54 is the hex value of the record length (80) + the RDW(4)). Only the record's data are moved to the output buffer, before being written to the ddname LRECL80. Note that the first four bytes of the from-position are not referenced. This is because the RDW value places the RDW in these first four bytes of the from-data.

READ,
  RDW(Y),
  IF(1,EQ,X'0054'),
	MOVE(1,0,5),
	WRITE(LRECL80)