ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

OVERLAY in data structures

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

  • OVERLAY in data structures

    Hi, I have the following spec. in my code.

    Code:
    D                 DS                  Inz              
    D Rcd                          103    DIM(9999) DESCEND
    D SortKey                       25    OVERLAY(Rcd:1)   
    D Key1                          10    OVERLAY(Rcd:1)   
    D Req1                          15  2 OVERLAY(Rcd:11)  
    D NVal1                         15  4 OVERLAY(Rcd:26)  
    D CVal1                         10    OVERLAY(Rcd:41)  
    D KeyD1                         50    OVERLAY(Rcd:51)  
    D Opt1                           1    OVERLAY(Rcd:101) 
    D Dlt1                           1    OVERLAY(Rcd:102) 
    D Mlt1                           1    OVERLAY(Rcd:103)
    In my RPGLE Iam using SORTA over SortKey field. But this is not working correctly for negative sign. I mean if field Req1 has any negative data, the sorting isn't correct. Please help.
    Last edited by kartikchowdary; October 6, 2009, 08:06 PM.

  • #2
    Re: OVERLAY in data structures

    Hi... plz help me how we can include the negative (-ve) sign while sorting the array. Currently the data structure show some junk value inplace of sign.

    Comment


    • #3
      Re: OVERLAY in data structures

      Please use the code block - that's the # symbol. Your post is difficult to read.
      Regards

      Kit
      http://www.ecofitonline.com
      DeskfIT - ChangefIT - XrefIT
      ___________________________________
      There are only 3 kinds of people -
      Those that can count and those that can't.

      Comment


      • #4
        Re: OVERLAY in data structures

        RPG treats the negative values as postive value i.e it treats them equally unless you use Sign keyword.

        May be cause of that you are experiencing the error

        Try to search logical file use Signed keyword at key level or we can use Order By Clause ...

        Pramendra Pandeya
        Last edited by pramendra; October 6, 2009, 06:16 AM.
        Young people knows how to run fast but old people knows the way..

        Comment


        • #5
          Re: OVERLAY in data structures

          I may be completely wrong here.... but I remember having something like this a looooong time ago.... I think changing the numeric fields to 'SIGNED' rather than PACKED fixed it.

          I might be wrong, but its worth mentioning :/
          predictably positive, permanently punctilious, purposely proactive, potentially priceless, primarily professional : projex

          Comment


          • #6
            Re: OVERLAY in data structures

            ¡ Viva la Revolución !
            Last edited by Mercury; October 6, 2009, 08:54 AM.
            Philippe

            Comment


            • #7
              Re: OVERLAY in data structures

              not in London its not
              predictably positive, permanently punctilious, purposely proactive, potentially priceless, primarily professional : projex

              Comment


              • #8
                Re: OVERLAY in data structures

                Hey what happen ?? did your problem get resolved..what is status..

                Pramendra Pandeya
                Young people knows how to run fast but old people knows the way..

                Comment


                • #9
                  Re: OVERLAY in data structures

                  Originally posted by kitvb1 View Post
                  Please use the code block - that's the # symbol. Your post is difficult to read.
                  Hi Kitvb1, I've changed the text to code format as per your suggestion. Please help to resolve my query.

                  Comment


                  • #10
                    Re: OVERLAY in data structures

                    Anyone know is there any way to handle this through SORTA....... Ive applied program logic to sort the arrays anway. But I would like to know if it is possible by a command.

                    Comment


                    • #11
                      Re: OVERLAY in data structures

                      partial sorting with bif %subarr:
                      SORTA %subarr(Req1:1:N)

                      Comment

                      Working...
                      X