ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Occur Opcode in Free Foramt

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

  • Occur Opcode in Free Foramt

    Hi All,

    Please tell me syntax of, Occur opcode in free foramt

    Thanks in advanced,
    Vishal

  • #2
    Re: Occur Opcode in Free Foramt

    use %OCCUR()
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: Occur Opcode in Free Foramt

      Thanks Tom

      Comment


      • #4
        Re: Occur Opcode in Free Foramt

        For your reference

        Code:
        D mds DS OCCURS(10) 
        /FREE 
        
        n = %OCCUR(mds); 
        // n = 1 
        
        %OCCUR(mds) = 7; 
        
        n = %OCCUR(mds); 
        // n = 7 
        
        /END-FREE
        Regards,
        Vinothkumar S.

        Comment


        • #5
          Re: Occur Opcode in Free Foramt

          Edit: Previous message was just too wrong :P

          Anyways wouldnt it be better to use qualified in conjuction with Dim instead of Occurs to make accessing the values easier?
          Last edited by vikramx; March 18, 2009, 07:17 AM.

          Comment


          • #6
            Re: Occur Opcode in Free Foramt

            I agree with previous post. MODS are no longer necessary, use the overlay array instead

            Code:
            dDsSingle         ds                                  
            d Field1                         5a                   
            d Field2                         5p 0                 
            dDsArray          ds                  LIKEDS(DsSingle)
            d                                     DIM(99)
            You can access single occurrence of the array simply using the array notation
            (DsArray(N))

            Comment

            Working...
            X