SHIFT

Read syntax diagramSkip visual syntax diagram SHift LeftRight11cols1target*

Purpose

Use the SHIFT subcommand to move data to the right or to the left. Data loss is possible.

Operands

Left
shifts data to the left. Data shifted to the left past the zone1 column is lost. The line is padded with blanks to the right, up through the truncation column.
Right
shifts data to the right. Shifted data that extends past the truncation column may be lost (See Usage Note 2). The line is padded to the left with blanks.
cols
is the number of columns the data is to be shifted. The default is 1.
target
defines the number of lines to be shifted, starting with the current line, up to but not including the target line. If target is not specified, only the current line is shifted.

You can specify a target as an absolute line number, a relative displacement from the current line, a line name, or a string expression. For more information on targets, see LOCATE and z/VM: XEDIT User's Guide.

*
the rest of the file is shifted.

Usage Notes

  1. The SHIFT subcommand should not be confused with LEFT, RIGHT, and SET VERIFY, which move the screen over the data, causing the data to appear to move in the opposite direction, and do not cause data loss.
  2. If SET SPILL OFF is in effect (the default), characters that have been shifted beyond the truncation column are truncated. If SET SPILL ON or SET SPILL WORD is in effect, characters that have been shifted beyond the truncation column are inserted in the file as one or more new lines, starting with the first character or word that would have gone beyond the truncation column. SET SPILL affects only SHIFT issued with the RIGHT operand. SET SPILL has no effect on SHIFT LEFT; data shifted to the left past zone1 is lost.

Responses

If you specify a SHIFT is to occur on multiple lines and it does occur, the current line pointer:

  1. Is unchanged, if SET STAY ON is in effect
  2. Moves to the last line shifted, if SET STAY OFF is in effect (the default)

SHIFT does not affect the column pointer.

Messages and Return Codes

504E
nn line(s) {truncated|spilled} [RC=3]
520E
Invalid operand: operand [RC=5]
543E
Invalid number: number [RC=5]
545E
Missing operand(s) [RC=5]
546E
Target not found [RC=2]
585E
No line(s) changed [RC=1 or 4]

where return codes are:

0
Normal
1
TOF or EOF reached during execution
2
Target line not found
3
Truncated or spilled
4
No lines changed
5
Invalid or missing operand(s) or number
6
Subcommand rejected in the profile due to LOAD error, or QUIT subcommand has been issued in a macro called from the last file in the ring