Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

how to close one file in RPGIII

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

  • how to close one file in RPGIII

    Hi I need to test a program with over 13 files that are being used. I know "seton LR" will close them all but I was wondering if there is a operation code that will allow me to close just one file. And if I chain to a file and latter on do a SETLL to the same file do I have to reset the pointer before I do the SETTLL? I appreciate any help Frank

  • #2
    how to close one file in RPGIII

    Frank - The best way control the opening and closing of files is to describe a file in your F specs with 'UC' in the file condition position (stands for user control). Then you have to remember to 'open' the file before doing a read or write. Use the opcode 'OPEN' followed by the name of the file in Factor 2. At the same time, set on an indicator to keep track that the file has been opened. If you return to this code more than once, test the indicator before you try to open the file again or you'll get an error.. The same goes for closing the file. Test the indicator to see if the file is open or you'll get an error trying to close it. If it is open, put 'CLOSE' in the opcode (followed by the name of the file in Factor 2). The program will close the file. Remember to turn off the indicator as well. With SETLL, if I'm reading from the first record, I automatically use *LOVAL as a pointer each time I open the file. It may be an extra line, but it's easier to read when others have to maintain my code.

    Comment


    • #3
      how to close one file in RPGIII

      I'm not sure why you are using the SETLL after you've chained to the file. Have you closed the file? If you haven't and you want the next record later on, you simply do a READ if you're reading records by key or arrival sequence. The first record you've chained to is still in the 'input handler' and the pointer to the file is 'set' to that first record. BTW, SETLL is a good way to check for the existance of a record without reading it into your program and possibly inadvertently updating file fields used in the program. Herb Kingsbury

      Comment


      • #4
        how to close one file in RPGIII

        SETLL is an operation that "sets the pointer", so you don't have to do anything else between a CHAIN and a SETLL. Barbara Morris

        Comment


        • #5
          how to close one file in RPGIII

          You can set up a second User ID with a class of Master Security Officer. Dave

          Comment


          • #6
            how to close one file in RPGIII

            I don't know the current master userid, so i can't create another master.

            Comment


            • #7
              how to close one file in RPGIII

              You shouldn't need to know the previous User Id. Master Security Officer on the S/36 is a class. When the User Id is created, the class may be assigned. Dave

              Comment


              • #8
                how to close one file in RPGIII

                Don't you need to be a Master Security Office to create another one? If you sign on as security officer, I don't think you can create a Master Security Officer.

                Comment


                • #9
                  how to close one file in RPGIII

                  that my problem I don't know the userid and password for the master security officer. there must be someway to get around it.

                  Comment


                  • #10
                    how to close one file in RPGIII

                    There's an alternate Master sign on. Do you know what that is? Just for the hell of it, try MSTR MSTR

                    Comment


                    • #11
                      how to close one file in RPGIII

                      Emil Ratti wrote: Don't you need to be a Master Security Office to create another one? That is correct. My apologies for the previous post. Dave

                      Comment


                      • #12
                        how to close one file in RPGIII

                        THANKS FOR EVERYONE'S HELP. WE WERE ABLE TO FIND SOMEONE WITH THE PASSWORD.

                        Comment

                        Working...
                        X