z/OS ISPF Edit and Edit Macros
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


SAVE_LENGTH—Set or Query Length for Variable-Length Data

z/OS ISPF Edit and Edit Macros
SC19-3621-00

The SAVE_LENGTH macro command sets or queries the length to be used to save each record in a variable-length file. It does not enable you to truncate the nonblank portion of a record, but it does enable you to extend a record. When records are written to disk, they are padded on the end with blanks as needed.

Syntax

Read syntax diagramSkip visual syntax diagram
Assignment statement syntax

>>-ISREDIT--(varname)-- = --SAVE_LENGTH--+-label---+-----------><
                                         '-linenum-'   

Read syntax diagramSkip visual syntax diagram
>>-ISREDIT--SAVE_LENGTH--+-linenum-+-- = --value---------------><
                         '-label---'               

Description

You can use the SAVE_LENGTH macro command to set or query the minimum length that is used to store an individual record in a variable-length data set.

When setting a length, the length is automatically adjusted to include the nonblank portion of the line.

When retrieving the length, the number returned reflects the line length that would be used if the line were saved immediately. This is the greater of these two values:

  • The length of the nonblank portion of the line and the length set by a previous SAVE_LENGTH request.
  • The length of the nonblank portion of the line and the original line length.

You can use the SAVE_LENGTH command in edit macros to define line commands to prompt the user for final record lengths or to check the record length. You might also use it to substitute a visible character for trailing blanks to make editing easier.

Use of the SAVE_LENGTH command does not prevent the editor from working on data past the specified record length. The length set and returned by the SAVE_LENGTH command is only used when the data is written and does not affect the operation of any other edit functions.

Return codes

0
Normal completion
4
Value supplied on set call was out of range. If the supplied length was too great, it is adjusted to equal the maximum record length. Otherwise, the length was adjusted to the length of the nonblank data portion of the record.
6
Record format is not variable. Any value on an assignment request is ignored.
16
Error setting variable.
20
Severe error

Examples

To save the number of characters that are saved for the last line in the file when PRESERVE OFF is active:
ISREDIT (NCHARS) = SAVE_LENGTH .ZLAST
To set the minimum line length for the last line in the file and to set PRESERVE ON active:
ISREDIT SAVE_LENGTH .ZLAST = 74

Another edit macro sample using the SAVE_LENGTH command can be found in the ISRSETLN member of the ISPF EXEC library.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014