Sponsored Links
Sponsored Link

sponsored links

Collapse

Announcement

Collapse
No announcement yet.

ILE Level breaks

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • ILE Level breaks

    Hi all,
    I'm new to RPGLE (not Free) and I was wondering; how do you control processing with level breaks so as to still use the RPG cycle?

    With RPG, you just added input specs with the break level. I can't seem to find a way to do this now in RPGLE and internet searching gave examples related to building complex subroutines and save fields. Really! Can't be. There has to be a more suitable code method than that which follows the RPGLE design.

    Red

    Everyday's a school day, what grade are you in?

  • #2
    Something like this

    Code:
    FYOURFILE  IP   E           K DISK
    
    IYOURFILE  
    I                                          STATE         L2
    I                                          CITY          L1
    
    C   L2                CALLP          FIRSTSTATE
    C   L1                CALLP          FIRSTCITY
    C                     CALLP          DETAIL
    CL1                   CALLP          LASTCITY
    CL2                   CALLP          LASTSTATE

    Comment


    • #3
      Originally posted by redvan View Post
      Hi all,
      I'm new to RPGLE (not Free) and I was wondering; how do you control processing with level breaks so as to still use the RPG cycle?

      With RPG, you just added input specs with the break level. I can't seem to find a way to do this now in RPGLE and internet searching gave examples related to building complex subroutines and save fields. Really! Can't be. There has to be a more suitable code method than that which follows the RPGLE design.
      You do it the exact same way as with RPG II or RPG III. The manual has examples.

      Comment


      • #4
        You could write a small RPG program that uses level breaks in the way you want and then use the CVTRPGSRC command to convert the RPG source to RPGLE. Then you can see how to do the level break coding in RPGLE.

        Comment


        • #5
          I hope you aren't writing new programs using the cycle... it had it's perks to be sure but only the old timers really understood the cycle, best to stay away from it outside of maintaining [much] older code.

          Comment


          • #6
            Old code can be difficult to maintain, for a variety of reasons. There certainly are poorly written cycle programs, but I don't think that is an intrinsic attribute of the cycle. It's not the boogeyman it's often portrayed to be. That may be contrary to current rhetoric but that doesn't make it false. I've seen homemade level break logic which is overly convoluted and error prone, perhaps that makes the case to avoid everyone reinventing the wheel their way.

            Comment


            • #7
              Most younger RPGers, including those coming out of school today, have never learned how to use the cycle or level breaks. As has already been noted in this discussion, its hard to find documentation or examples of it, because it's a technique that people don't really use anymore. The easiest way to find help is to look at old RPG II or RPG III books, and maybe use a tool like CVTRPGSRC to convert it (if that's easier than just adapting the code to the appropriate places on the source record.)

              But... the question of whether you SHOULD write new code like this is important to consider.

              Most (but not all) older programmers were glad to leave cycle programming behind. New programmers don't know how to do this stuff at all. Are you sure you want to put code out there that nobody will ever be able to maintain?

              Comment


              • #8
                Originally posted by UserName10 View Post
                Old code can be difficult to maintain, for a variety of reasons. There certainly are poorly written cycle programs, but I don't think that is an intrinsic attribute of the cycle. It's not the boogeyman it's often portrayed to be. That may be contrary to current rhetoric but that doesn't make it false. I've seen homemade level break logic which is overly convoluted and error prone, perhaps that makes the case to avoid everyone reinventing the wheel their way.
                What you say is true, but you're missing my point. Cycle programs can be quite elegant and efficient but that doesn't take away the fact that few people under 40 even know what the cycle is, let alone understand how to use or code it. Whether it be good or bad it's no longer the norm in RPG, personally I'm glad but I can see how that may not be the case of others.

                Comment


                • #9
                  I agree not many under 40 use it, but how many under 40 even use RPG? Kidding aside, maybe they should learn it. First, they are likely to encounter old code that uses it. Second, there are times when it is more concise. It's really not difficult. In my opinion it's reputation is undeserved.

                  Comment


                  • #10
                    Originally posted by UserName10 View Post
                    I agree not many under 40 use it, but how many under 40 even use RPG? Kidding aside, maybe they should learn it. First, they are likely to encounter old code that uses it. Second, there are times when it is more concise. It's really not difficult. In my opinion it's reputation is undeserved.
                    I see it rare enough that I'm almost relearning it every time I see it. I agree with you in that there are some areas where using the cycle makes for some concise and elegant code, but being concise isn't everything.

                    Comment

                    sponsored links

                    Collapse

                    Working...
                    X