# jCL - command

Updated: 10/19/2020, 10:24:56 AM
Created: 10/19/2020, 10:24:56 AM
Last Updated By: Daniel Klein
Read Time: 1 minute(s)

Tags: buffer input jcl

# Description

The - command subtracts an integer from the current parameter in the active input buffer. It takes the general form:

-n
1

Where n is the integer to be subtracted.

# Note

If the number of characters within a parameter decreases with a - command, the result is prefixed with zeros to maintain the same number of characters as the original value. Parameters within the input buffer can be preceded by a minus sign. If the buffer pointer is at the end of the buffer, a new parameter will be created. If the referenced parameter is non-numeric, a zero is used.

# Example 1

Command PIB Before PIB After

-300 AAA^345^666 AAA^045^666
a a
1
2

# Example 2

Command PIB Before PIB After

-20 AAA^ABC^666 AAA^-20^666
a a
1
2

# Example 3

Command PIB Before PIB After

-50 AAA^-50^666 AAA^-100^666
a a
1
2

# Example 4

001 PQN
002 OEnter a number+
003 S5
004 IBP
005 +7
006 T %5
007 -3
008 T %5
009 RTN
1
2
3
4
5
6
7
8
9

This example receives input from the terminal and places it in the 5th parameter of the primary input buffer. It adds 7 to the value stored in the 5th parameter and displays the result. It then subtracts 3 from the result and displays the new value.

Back to jCL Commands