ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Except opcode

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

  • Except opcode

    Can any body post a sample code of using Except opcode to modify only certain fields of a file



    Regards
    sai
    To every equation there is a solution....
    Regards
    Sai.

  • #2
    Re: Except opcode

    If filea has fields field1, field2, field3, and we want to write out field2 only ...

    C...except..zput

    Ofilea...E...zput
    O...............field2


    John McKay
    jmckay@mckaysoftware.ie
    John McKay
    jmckay@mckaysoftware.ie
    http://www.rpglanguage.com

    Comment


    • #3
      Re: Except opcode

      PHP Code:
      C     *IN10         WHENEQ    *ON                                    
      C     JBAKY2        CHAIN     JBAJOBSR                           80  
      C                   MOVE      CCM1          JACCM1                   
      C                   MOVE      CCM2          JACCM2                   
      C                   MOVE      CCM3          JACCM3                   
      C                   MOVE      CCM4          JACCM4                   
      C                   EXCEPT    UPDJBA                                 
      C     JACONT        IFEQ      
      *BLANKS                                
      C     JASL
      #         CHAIN     ARACUSTR                           80  
      C                   MOVEL     AASLNM        JACONT                   
      C                   
      ENDIF                                            

        *                                                     
      OJBAJOBSR  E            UPDJBA                         
      O                       JACCM1                         
      O                       JACCM2                         
      O                       JACCM3                         
      O                       JACCM4 

      maybe try a little free

      Code:
      update CICADLC  %fields(CCBRNIPP:CCCYCLE#:CCCYCLTM: 
                              CCTOTLTM:CCCOST:CCUNITP);
      All my answers were extracted from the "Big Dummy's Guide to the As400"
      and I take no responsibility for any of them.

      www.code400.com

      Comment

      Working...
      X