INVALID WHOLE NUMBER error. Please help !!



IBM's Command List programming language & Restructured Extended Executor

INVALID WHOLE NUMBER error. Please help !!

Postby hariharan_bk » Fri Aug 14, 2015 1:41 pm

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
Many Thanks,
Harry
hariharan_bk
 
Posts: 73
Joined: Thu Mar 29, 2012 11:13 am
Has thanked: 5 times
Been thanked: 0 time

Re: INVALID WHOLE NUMBER error. Please help !!

Postby NicC » Fri Aug 14, 2015 4:10 pm

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?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: INVALID WHOLE NUMBER error. Please help !!

Postby hariharan_bk » Fri Aug 14, 2015 4:24 pm

Hi NicC,

Have got the issue resolved now.

Misplacement of few keywords have caused this. My apologies.
Many Thanks,
Harry
hariharan_bk
 
Posts: 73
Joined: Thu Mar 29, 2012 11:13 am
Has thanked: 5 times
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post