Page 1 of 1

INVALID WHOLE NUMBER error. Please help !!

PostPosted: Fri Aug 14, 2015 1:41 pm
by hariharan_bk
Hi All,

I have developed a small rexx code which replaces the characters with the mentioned values, in a single line statement.

This is the input statement I give for the replacing the &B with 'M'

XXX&J..&A&B&C&D..CD&E&I.AT.HARI(+1)

/* I call the FUNCTION HERE */
F8=STRREP(F7,'&B','M')

/* function to replace chars */
STRREP:
FIL_STR = ARG(1)
STR1    = ARG(2)
STR2    = ARG(3)

DO FOREVER
  INTERPRET 'PARSE VAR FIL_STR PART1' "'"STR1"'" 'PART2'
  IF (FIL_STR <> PART1) THEN FIL_STR = PART1||STR2||PART2
  ELSE LEAVE
END
RETURN FIL_STR


When I run the above code, I m getting the desired result.. but an error shows up at the end of processing, which is "Invalid Whole number".

Something is passed between the call and the function, but I am unable to have this resolved. Could you please help

Re: INVALID WHOLE NUMBER error. Please help !!

PostPosted: Fri Aug 14, 2015 4:10 pm
by NicC
What did you try in order to debug your problem? Have your displayed the arguments on entry to your program and on entry to the sub-routine? Have you run with Trace enabled?

Re: INVALID WHOLE NUMBER error. Please help !!

PostPosted: Fri Aug 14, 2015 4:24 pm
by hariharan_bk
Hi NicC,

Have got the issue resolved now.

Misplacement of few keywords have caused this. My apologies.