ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

How To Check Uniqueness ......

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

  • How To Check Uniqueness ......

    Hi,

    I am stuck with validating few fields for uniqueness.
    There is main screen which has a subfile format and a control format.The subfile fields are populated to an array.There is also another window which is also a subfile and populated to a different array.There are same two fields field1 and field2 in all these formats.
    Now i have to validate such that each value entered is unique for field2.
    I dont have idea of comparing these two arrays and the control format

    sub file format and window format looks like this:
    Field1...........field2
    AAAA ...........123456
    bbbb.............123457
    ...
    ...
    (sflsiz = 99)

    control format
    Field1...........field2
    cccc....................124589

    anyone knows how to do this.I am coding in COBOL.


    Thanks
    Sudarshan
    Thanks
    Sudarshan

  • #2
    Re: How To Check Uniqueness ......

    You could do a lookup from array1fld2(x) to array2fld2(y) and cycle thru.
    You could also scan array2fld2 (if alpha) and you redefine the array as a DS.
    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


    • #3
      Re: How To Check Uniqueness ......

      Kit,
      This is the COBOL forum.

      Sudarshan,
      Read the subfile and move fld2 to an occursed array, then search the array to verify if "subfile" fld2 is already loaded in that table.
      Last edited by Mercury; February 13, 2008, 06:35 AM.
      Philippe

      Comment


      • #4
        Re: How To Check Uniqueness ......

        uffff... ok, I'll go sit in the corner with my dunce cap on

        but the principle remains the same, just the opcodes change a little. heck, It's now 11 years since I even touched COBOL.
        Last edited by kitvb1; February 7, 2008, 10:08 AM.
        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


        • #5
          Re: How To Check Uniqueness ......

          Originally posted by Mercury View Post
          Kit,
          This is the COBOL forum.

          Sudarshan,
          Read the subfile and move fld2 to an occursed table, then search the table to verify if "subfile" fld2 is already loaded in that table.
          I always thought Cobol was an "occursed" language, hell I cursed it enough at uni !!!
          Greg Craill: "Life's hard - Get a helmet !!"

          Comment


          • #6
            Re: How To Check Uniqueness ......

            Actually, I loved COBOL, Just didn't like the long field names, and the having to define WS section etc. But the language itself, is great. I still did it on an ICL ME29 which is/was a horrible word (1 word = 4 bytes) machine. The ME29 was ICL's answer to S/38
            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


            • #7
              Re: How To Check Uniqueness ......

              Very funny Greg ! How should I call this array ?
              Philippe

              Comment

              Working...
              X