ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Many pfs to 1 lf

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

  • #16
    Re: Many pfs to 1 lf

    I have created this file:

    Code:
         A          R POLTYPA                   PFILE(LIB1/POLTYPES LIB2/POLTYPES) 
         A          K TYPE1
    When I compile a simple rpgle print program using this file I get the following error:

    000200 flftest if e k disk
    ======> aaaaaa
    *RNF2121 30 a 000200 Record format POLTYPA in file LFTEST already defined;
    record format is ignored.
    When I add the rename statement it compiles and runs fine.

    Code:
          flftest    if   e           k disk                          
          f                                     rename(poltypa:poltpa)
    Hope this helps clarify
    GLS
    The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

    Comment


    • #17
      Re: Many pfs to 1 lf

      So if your logical formats are different and the fields are all the same name then you won't care what format you have just read. You will just process it regardless.

      PHP Code:
      FLJoinFile    IF   E           K DISK                     
      F                                     INFSR
      (*PSSR)     

      c                             Read    LJoinFile 
      c                             DoU     
      %Eof(LJoinFile) 
      cthen process all record formats here

      c                              Enddo 
      Good Luck
      Bill
      "A good friend will bail you out of jail,
      A true friend would be sitting beside you saying,
      'Wow, that was fun.'"

      Comment


      • #18
        Re: Many pfs to 1 lf

        After extensive testing I have determined that the method I posted earlier actually does work as I had hoped. Even though it is a multiple format file the RPGLE program still treats it as if it was one great big physical file... which is what I needed. As an added bonus I can even tell what the original physical file was by checking the format field in the INFDS.


        BillW.. yep!
        GLS400... yeah I got that error when I tried to list all of the files in one PFILE statement. Thats what led me to the multiple format structure.

        So it looks like I am all set. Thanks a bunch for all of the replies and suggestions!!!!

        Comment


        • #19
          Re: Many pfs to 1 lf

          Originally posted by soup_dog
          I got that error when I tried to list all of the files in one PFILE statement
          Again you can NOT compile successfully that file in RPG, you can do it in OPM COBOL though.
          Using a multiple format file is a solution, I just wanted to point out another possibility.


          Originally posted by GLS
          When I compile a simple rpgle print program using this file I get the following error:

          Quote:
          000200 flftest if e k disk
          ======> aaaaaa
          *RNF2121 30 a 000200 Record format POLTYPA in file LFTEST already defined;
          record format is ignored.
          Thanks to help me clarify this point. This is what I wanted to describe.
          However renaming the format works only if you have 2 PFs on the PFILE stm. Give it a try with 3 or more and you get the same error again.
          Last edited by Mercury; January 11, 2008, 04:01 AM.
          Philippe

          Comment


          • #20
            Re: Many pfs to 1 lf

            Hi

            Try to create *LF with only one PFILE, compile program and then change *LF to contain all PFILE's and recreate it again.
            LP Zdenko

            Comment


            • #21
              Re: Many pfs to 1 lf

              Zdenko,
              This maneuver is quite wily indeed !
              Philippe

              Comment


              • #22
                Re: Many pfs to 1 lf

                Thanks Mercury:

                I learned something new.

                I also found a work around.

                1. In your rpg program use one of the physical files instead of the logical to compile.
                2. Override the physical to the logical and run the program.

                Surprisingly it worked

                GLS
                The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

                Comment


                • #23
                  Re: Many pfs to 1 lf

                  ok. It strongly looks like the Zdenko's work around.
                  Good to know anyway.
                  Thanks again.
                  Philippe

                  Comment


                  • #24
                    Re: Many pfs to 1 lf

                    I guess the miss leading idea here was the phrase "multiformat logical". In "therory" this isn't a multiformat logical. It only has one format.

                    But it is a nice bit of knowledge to store away for later use.

                    Thnx
                    Bill
                    "A good friend will bail you out of jail,
                    A true friend would be sitting beside you saying,
                    'Wow, that was fun.'"

                    Comment

                    Working...
                    X