RPGLE Source Lines Exceeded

670 pts.
Tags:
AS/400
RPGLE
RPGLE Source Lines Limit exceeded when compiling the Source. Please see below the error message - ""Compilation stopped. Internal failure occurred. Error Code is 1.""
Remove unwanted lines or Divide programs into sub programs. Advice any other ideas to avoid this. Thanks.
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

That is a problem with legacy code. I am surprised at the size of the source though. Depending on the number of lines in your change, you may want to do a CALL to a new program to perform your modifications. That way a bulk of the new source code will be in another program and not pulled in at compile time.  

Discuss This Question: 20  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • hunshabbir7
    How many lines of code you have? Its usually a good practice to divide your program in to modules and then compile them as one unit. It is good to manage code afterwards and also consume less time in maintenance. Good Luck
    2,900 pointsBadges:
    report
  • philpl1jb
    Looks like the compiler limit is 999,999.
    54,090 pointsBadges:
    report
  • as400dev
    This is the existing program developed decades ago, So cannot divide into module, since it is time consuming. Also since it has copy books included, cannot determine the no of Lines.
    670 pointsBadges:
    report
  • azohawk
    is this RPG II code?
    4,055 pointsBadges:
    report
  • philpl1jb
    How are you compiling this?
    54,090 pointsBadges:
    report
  • as400dev
    RPG IV, Using CRTBNDRPG (option 14 in PDM.)
    670 pointsBadges:
    report
  • hunshabbir7
    I am also punching code written about 25 years ago. How it was previously running. Have you added something or why you need to compile it again?
    2,900 pointsBadges:
    report
  • philpl1jb

    Try option 15 create module.  I doubt it will make a difference but it's simple.

    Try compiling the original code .. before your current changes (if any)

    54,090 pointsBadges:
    report
  • philpl1jb

    I could see an issue if two copy books add each other, so the precompiler goes into an endless loop of adding

    Booka which adds Bookb which adds Booka which adds Bookb ...

    54,090 pointsBadges:
    report
  • as400dev
    The existing program has got some enhancement, But when add in the few lines cannot compile. There will be further more changes in future too. Cannot break the current existing code into blocks. No copybooks add each other or looping. 

    All the new enhancement should follow the existing flow. 
    670 pointsBadges:
    report
  • philpl1jb

    Perhaps this will help .. if I understand this, it will remove all comments from the temporary file that is built as the source of the compile. Be safe do this on a copy.

    Try this...14 F9 F4 .. page down to preprocessor options

    *RMVCOMMENT -

    Remove comments, blank lines, and most directives during preprocessing. Retain only the RPG specifications and any directives necessary for the correct interpretation of the specifications.

    54,090 pointsBadges:
    report
  • ToddN2000
    Thanks for the tip *RMVCOMMENT Philipl1jb. We have some very large programs. Our software vendor leaves all code in source. When the make a mod they common out the old and add the new. This goes back to the origin date. As you can imagine they can be quit large. It would help to have these removed when debugging code. I'll have to give it a try.
    134,635 pointsBadges:
    report
  • philpl1jb
    I don't think this will strip the source...I think it strips the copy of the source it's building in qtemp and loading the copy books into during the pre-processor step.
    54,090 pointsBadges:
    report
  • as400dev
    *RMVCOMMENT doesnot remove the comment lines either from spool file when compiled, Nor during Debug. Any other solutions?
    670 pointsBadges:
    report
  • philpl1jb

    This is all I've got, sorry

    Preprocessor ..*DFT
    Run the preprocessor against the input source.
    *RMVCOMMENT, *EXPINCLUDE and *NOSEQSRC will be used as
    the options for generating the preprocessor output.
    Use PPSRCFILE and PPSRCMBR to specify an output source

    Output source file ppsrcfile

    Output source member PPSRCMBR

    54,090 pointsBadges:
    report
  • aceofdelts

    You can save a few lines (maybe that's all you need ... THIS TIME) by rephrasing some If groups

    from style

    If whatever

    A=0

    Else

    A=1

    EndIf

    to style

    A=1

    If whatever

    A=0

    EndIf

    Saves 1 line per occurrence

    This "from" If/else style is quite common so you might gain dozens of lines. Overall, a drop in the bucket ... but a simple code change. Works well with many If %found groups

    2,550 pointsBadges:
    report
  • philpl1jb

    This is a question for technical support at IBM. 

    Few customers would take that one module development to the extreme.   

    54,090 pointsBadges:
    report
  • ToddN2000
    Another thing to try might be if this is an ILE program you might try combining any conditions. Statements like IF  x= 1 or x=2 or x=3 on 1 line instead of individual lines.
    134,635 pointsBadges:
    report
  • as400dev
    Thanks everyone. 
    670 pointsBadges:
    report
  • ToddN2000
    Another option is to move some of the comments to something like a documentation source. We have some source codes that contain a few hundred line of comment on the function of the program and the source code changes made. You could try moving these to a TXT source file.
    134,635 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: