ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

chaining to a subfile in free

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

  • chaining to a subfile in free

    I am trying to convert an older program to /free but am running into an interesting problem. Using a relative record number I could chain to the subfile using the following...

    C EVAL RRN = 1
    C RRN CHAIN SFL

    When I try the following using /free I get an error.

    /free
    CHAIN (RRN) SFL
    /end-free


    Here is the error I get.

    *RNF7702 30 1 A list of key fields is not allowed with program described file.

    Anyone know how to do this in /free?

  • #2
    Re: chaining to a subfile in free

    Soup,

    Just take the ( and ) out.

    HTH,
    MdnghtPgmr
    "Tis better to be thought a fool then to open one's mouth and remove all doubt." - Benjamin Franklin

    Comment


    • #3
      Re: chaining to a subfile in free

      doh!!! I can't believe it was that simple.

      Thanks a bunch mdnght!!!!!

      Comment


      • #4
        Re: chaining to a subfile in free

        That has thrown me also. The people who wrote our system created a System Control File that contains the next available customer#. (This is from the S/36 days before *dtaara)

        IIRC, a couple years ago, pgms would not compile if I did:
        Chain 00010 SYSCTL;
        I had to do Chain (00010) SYSCTL.

        Now it compiles either way. However, the Chain to sfl only works without the parens.
        http://www.linkedin.com/in/chippermiller

        Comment


        • #5
          Re: chaining to a subfile in free

          I THINK that the compiler sees the ( after the CHAIN and expects a list of key fields with : between them. I THINK that the single value throws it (the compiler) a curve.

          My $0.02,
          MdnghtPgmr
          "Tis better to be thought a fool then to open one's mouth and remove all doubt." - Benjamin Franklin

          Comment


          • #6
            Re: chaining to a subfile in free

            Originally posted by MdnghtPgmr View Post
            I THINK that the compiler sees the ( after the CHAIN and expects a list of key fields with : between them. I THINK that the single value throws it (the compiler) a curve.

            My $0.02,
            MdnghtPgmr
            that's it...when the compiler sees parens on a CHAIN, READE, etc. it assumes that it's a KLIST, %KDS or a list of key fields. for single values leave the parens off.
            I'm not anti-social, I just don't like people -Tommy Holden

            Comment


            • #7
              Re: chaining to a subfile in free

              Originally posted by MdnghtPgmr View Post
              I THINK that the compiler sees the ( after the CHAIN and expects a list of key fields with : between them. I THINK that the single value throws it (the compiler) a curve.

              My $0.02,
              MdnghtPgmr
              Originally posted by tomholden View Post
              that's it...when the compiler sees parens on a CHAIN, READE, etc. it assumes that it's a KLIST, %KDS or a list of key fields. for single values leave the parens off.
              When I have a free moment, I'm going to try this with a couple of variations with a one-key field for:

              Chain w/ numeric number no parens
              Chain w/ numeric number in parens
              Chain w/ %KDS with & without parens
              Chain w/ field name with & without parens

              Then do the same thing for a file with a one key alpha field.

              Maybe the problem was a file with two numeric fields where I did a Setll/Reade with only one number.
              http://www.linkedin.com/in/chippermiller

              Comment


              • #8
                Re: chaining to a subfile in free

                When you find those free moments... please send some down here. I haven't seen one of those in AGES!! I seem to remember I had one of those a long time ago...

                Comment


                • #9
                  Re: chaining to a subfile in free

                  Originally posted by FaStOnE View Post
                  When you find those free moments... please send some down here. I haven't seen one of those in AGES!! I seem to remember I had one of those a long time ago...
                  I recall what I said to my roommate in college:
                  * Going to school full time
                  * Working 20-25 hours per week
                  * Involved with extra cirricular activities (Marching Band -- rehearsal 3-5 M/W/F plus 9-5 Sat if home game)
                  * Etc etc

                  I said to my roommate, "Boy, I'll so be glad when I graduate. All I'll have to do is work 40 hours a week. I'll have all this FREE TIME during the evenings and on weekends."
                  http://www.linkedin.com/in/chippermiller

                  Comment


                  • #10
                    Re: chaining to a subfile in free

                    Originally posted by Chipper View Post
                    I said to my roommate, "Boy, I'll so be glad when I graduate. All I'll have to do is work 40 hours a week. I'll have all this FREE TIME during the evenings and on weekends."
                    poor lil' naive Chipper...sounds like famous last words
                    I'm not anti-social, I just don't like people -Tommy Holden

                    Comment


                    • #11
                      Re: chaining to a subfile in free

                      You can CHAIN with a single value inside ( ). I believe that gives you the flexibility of the value being the same type, but not necessarily length of the key field setup in the file.
                      Your friends list is empty!

                      Comment


                      • #12
                        Re: chaining to a subfile in free

                        Originally posted by mjhaston View Post
                        You can CHAIN with a single value inside ( ). I believe that gives you the flexibility of the value being the same type, but not necessarily length of the key field setup in the file.
                        but not with subfiles. the compiler knows that a subfile has only one key value and that's why it doesn't allow parens...should it? i think so. it really shouldn't matter to the compiler if parens are there or not, just that the number of keys and data type and length match...but that's just my opinion. i really don't know why IBM did this one...but i can live with it.
                        I'm not anti-social, I just don't like people -Tommy Holden

                        Comment


                        • #13
                          Re: chaining to a subfile in free

                          Tom,

                          Yep, that's it. Just another fun fact to know and share!

                          MdnghtPgmr
                          "Tis better to be thought a fool then to open one's mouth and remove all doubt." - Benjamin Franklin

                          Comment


                          • #14
                            Re: chaining to a subfile in free

                            I did not know that!
                            Your friends list is empty!

                            Comment


                            • #15
                              Re: chaining to a subfile in free

                              mjhaston,

                              Yeah, I should have been a little more clear in my response. In re-reading it I relise that now. Hind sight is 20/20

                              MdnghtPgmr
                              "Tis better to be thought a fool then to open one's mouth and remove all doubt." - Benjamin Franklin

                              Comment

                              Working...
                              X