RPUT

Returns the value of a portion of a record after being overlaid with a specified string. The string is converted to a numeric format based on a specified conversion type.

Syntax

RPUT(record,string,[type,start,number])

Arguments

Argument Description Default
record The string to create. None
string Data that contains the information to add to record. string should contain a value consistent with type. If record is not long enough to place string, Enrichment pads record with blanks to the appropriate length. None
[type] One of the following, to indicate how Enrichment is to write the data to record: N
B Insert the character whose value the binary pattern in string specifies. Specify an 8-byte pattern containing only 1 and 0 with high-order bits first (10000000 = 128).
C Insert the character whose value the integer in string specifies. This value must be in the range 0 to 255.
N Insert the two-byte binary integer value of the number specified in string.
I Insert the four-byte binary integer value of the number specified in string.
F Insert the four-byte binary floating-point value of the number specified in string.
D Insert the eight-byte binary floating-point value of the number specified in string.
L Insert a number-digit packed decimal value starting to the left of the byte at start. If string has fewer digits than number, string is padded with zeroes on the left to the appropriate length. If string has more digits than number, only the first number digits are written. Only digits from 0 to 9 are valid. Embedded blanks are invalid.
R Insert a number-digit packed decimal value starting to the right of the byte at start. If string has fewer digits than number, string is padded with zeroes on the left to the appropriate length. If string has more digits than number, only the first number digits are written. Only digits from 0 to 9 are valid. Imbedded blanks are invalid.
S Insert number characters as a string beginning at start. If string is shorter than number, string is padded with blanks on the left to the appropriate length. If string is longer than number, only the first number characters are written.
[start] The column number (greater than 0) in record at which the data to modify begins. 1
[number] The number (greater than 0) of characters, bytes, or digits to write. number is used in conjunction with a type of L, R, or S. For type L or R, number must not exceed 100 digits. 1

Results

Result Description
Return The modified value of record after being overlaid with string.
%%RC One of the following:
o No error.
1 string did not contain the proper data type or was not long enough.
2 The packed decimal value was more than number digits long. Enrichment wrote the first number digits.
%%RM A null string ('').
%%RV Always set to 0.

Examples

Prior to the initial function call:

%%record='---------------------'
Function Call Return %%RC
RPUT(%%record,'ANSWER',S,5,5) '----ANSWE------------' 0
RPUT(%%record,'21',I,13) (2 bytes written at 13) 0
RPUT(%%record,'Hello',D,10) '---------------------' 1