Anmelden

View Full Version : RNX0100 bei %SUBST Funktion



Marimari1009
01-03-07, 15:08
Hallo zusammen,

folgender Fehler

Message ID . . . . . . : RNX0100 Severity . . . . . . . : 50
Message type . . . . . : Escape
Date sent . . . . . . : 01/03/07 Time sent . . . . . . : 11:31:10

Message . . . . : Length or start position is out of range for the string
operation.
Cause . . . . . : One of the following has occurred in RPG procedure RECVPF5
in program DCM/RECVPF5:
- A numeric length or start position is less than 1 or too large for the
string operation.
- The search-argument parameter of the %SCAN built-in function has zero
length or is longer than the source-string parameter.
- The maximum-length parameter of the %STR built-in function is not a value
between 1 and the maximum size of a character field.
Recovery . . . : Contact the person responsible for program maintenance to
determine the cause of the problem.

bei folgendem Statement:

EVAL %SUBST(WRKREC:J:COMLEN)=*ALL' '

wobei WRKREC eine Länge von 9900 hat, J hat den Wert 1291,
COMLEN hat den Wert 3683.

Wer kann helfen?

Vielen Dank im Voraus

Klaus

kuempi von stein
01-03-07, 15:55
....wobei WRKREC eine Länge von 9900 hat, J hat den Wert 1291,
COMLEN hat den Wert 3683.

Wer kann helfen?
....

Hallo Klaus,

ich stecke da gerade nicht drin gedanklich.... aber immer wenn "solche" Probleme auftreten, tritt bei mir Regel 1 in Kraft: "Don't trust"

Also um das nochmal auf den Punkt zu bringen:
Bist Du Dir sicher, dass VOR dem Scan WIKLICH der Inhalt so in allen Variabeln steht, wie Du es schreibst? (ggf. mit DSPLY oder Debug prüfen)....

kuempi

Fuerchau
02-03-07, 09:26
Das Problem ist meist die figurative Konstante, deren Länge bereits zur Compilezeit festgelegt wird.

An Stelle von *ALL' ' solltest du ggf. *BLANKS verwenden, wenn das nichts hilft, lege dir eine initialisierte Hilfsvariable an und kopiere per:

EVAL %SUBST(WRKREC:J:COMLEN)=%subst(MYHELP:1:COMLEN);