ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

free record after chain

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

  • free record after chain

    hello everyone,

    i use the chain comand and update a record in some condition.
    if the condition is false, i jump to tag.

    i need to free the record before , how can i do it?

    thank's
    Rachel

  • #2
    Re: free record after chain

    Why the big concern about releasing the record?

    Comment


    • #3
      Re: free record after chain

      i get an error msg when i tried to read the same record again.
      ineed to read it again later....

      Comment


      • #4
        Re: free record after chain

        You need to release the lock using the "Unlock" opcode.
        Ben

        Comment


        • #5
          Re: free record after chain

          thank you very much

          Comment


          • #6
            Re: free record after chain

            another option would be to SETLL on the file for the matching key. if %EQUAL then either CHAIN or read to do the update, if not updating the record will not be locked...and you mentioned GOTO icky...
            I'm not anti-social, I just don't like people -Tommy Holden

            Comment


            • #7
              Re: free record after chain

              Ouch ... did I see the words "GOTO" and "TAG"?!?

              Comment


              • #8
                Re: free record after chain

                Originally posted by FaStOnE View Post
                Ouch ... did I see the words "GOTO" and "TAG"?!?
                lol i've been doing some contract work on the side to make up for next week's unpaid time off. the guy i'm working with just wrote a brand spanking new SQLRPGLE program (in fixed format) it is riddled with z-add, z-sub, move, movel and GOTO AND TAG!!! and instead of using date functions it's the same old multiply trick to switch date format! add to that using the LDA...if it weren't for the money i'd shoot the guy!
                I'm not anti-social, I just don't like people -Tommy Holden

                Comment


                • #9
                  Re: free record after chain

                  Sounds like the only thing missing were CABxx statements....

                  Comment


                  • #10
                    Re: free record after chain

                    I saw someone write a brand new green screen program in old style RPG like this. He said it was easier to copy an existing program than to write a new one. Even if that existing program is 20 years old!
                    Ben

                    Comment


                    • #11
                      Re: free record after chain

                      ... same situation in my former company.
                      The external programmer wrote everything in ILE!!!, i.e. RPGII style converted into RPGIV!!!!
                      He did not even use Z-ADD but only MOVE and MOVEL, not a single EVAL but lefthand and righthand indicators.
                      I found a subroutine, where he used 2 arrays with 255 single byte elemets, read it from the end, to find the last non blank character and than he filled x'00' into the next element. (but forgot to check if the array is completely filled). Instead of using a single statement to procduce a null terminted string!
                      In an other program I found a bunch of CAT commands to concatenate a string (alway concatening 10 characters).

                      ... and so on! We don't speak about old programs, but about brand new ones!!!

                      Comment


                      • #12
                        Re: free record after chain

                        Originally posted by B.Hauser View Post
                        ... same situation in my former company.
                        The external programmer wrote everything in ILE!!!, i.e. RPGII style converted into RPGIV!!!!
                        He did not even use Z-ADD but only MOVE and MOVEL, not a single EVAL but lefthand and righthand indicators.
                        I found a subroutine, where he used 2 arrays with 255 single byte elemets, read it from the end, to find the last non blank character and than he filled x'00' into the next element. (but forgot to check if the array is completely filled). Instead of using a single statement to procduce a null terminted string!
                        In an other program I found a bunch of CAT commands to concatenate a string (alway concatening 10 characters).

                        ... and so on! We don't speak about old programs, but about brand new ones!!!

                        haha, sweet! A 1980's version of an RPG "C" null terminated string! There should be a law somewhere that says that if you are going to write 80's code today, you should have to do it while wearing spandex pants while sporting a mullet. Or big hair. Or while singing Cyndi Lauper's "Time after Time".
                        Michael Catalani
                        IS Director, eCommerce & Web Development
                        Acceptance Insurance Corporation
                        www.AcceptanceInsurance.com
                        www.ProvatoSys.com

                        Comment


                        • #13
                          Re: free record after chain

                          lol that's how I feel writing free format RPG IV!
                          Ben

                          Comment


                          • #14
                            Re: free record after chain

                            Originally posted by FaStOnE View Post
                            Sounds like the only thing missing were CABxx statements....
                            Don't forget to throw in some MxxZO statements
                            http://www.linkedin.com/in/chippermiller

                            Comment

                            Working...
                            X