ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

subfile issues

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

  • subfile issues

    hi guys
    thanks alot for the previous helps
    here is my 2 screens

    screen 1

    Company Code . . . . . : AAA


    once pressed enter i come to the second screen containing a subfile

    Company Code . . . . . : AAA
    Company Description. . : descaaaa


    ID Beneficiary Account

    DFDF RTRT 0002572502
    GHGHH FGFGFG 0002578406
    RTR RTR 0002572581
    TT TRR 0008555050

    where all these fields are input and output
    i want once i press F11 to update the record that i modified directly on this screen2

    here is my f11 code

    Code:
    C     F11           BEGSR                                    
    C                   READC     RSTFL                           
    C                   DOW       %EOF = *OFF                     
    C     ##CDE         CHAIN (E) DSC03LF                         
     *Update the record only if the record is found in the file.  
    C                   IF        NOT %ERROR                      
    -------------PROCESSING
    C                   UPDATE    DSC031      
    C                   ENDIF                 
    C                   READC (E) RSTFL       
    C                   ENDDO                                            
    c                   endsr
    but the thing is that the file dsc03lf have the keys
    id and beneficiary
    how can i update the keys.........
    how thsi can be done?

    thanks

  • #2
    Re: subfile issues

    Easy ! Keep a copy of the Key fields ! (otherwhise you are updating the wrong record !

    Reread my post ! http://www.code400.com/forum/showpos...52&postcount=6

    I warned you !

    Comment


    • #3
      Re: subfile issues

      but what if i choose not to update the key fieldi chose to update another field
      here is the code i am using but no update is beeing issued
      can u halp me in it please?
      thansk alot
      Code:
      C     F11           BEGSR                               
      c     'f11'         dsply                               
      C                   READC     RSTFL                     
      C                   DOW       %EOF = *OFF               
      C     ##CDE         CHAIN (E) DSC03LF                   
       *Update the record only if the record is found in the f
      C                   IF        NOT %ERROR                
      c     'oupi'        dsply                               
      c                   eval      X_DSC03CCD  = ##CCDE      
      c                   eval      X_DSC03BUID = ##CDE       
      c     comcdk2       chain     dsc031                    
      c                   IF        %FOUND(DSC03LF1)          
      c     'found'       dsply                               
      C                   EVAL      X_DSC03BNM= 'ZZZZZ'       
      C                   UPDATE    DSC031                    
      C                   ENDIF                               
      C                   ENDIF                     
      C                   READC (E) RSTFL           
      C                   ENDDO                     
      C                   ENDSR

      Comment


      • #4
        Re: subfile issues

        This is strange !

        CHAIN (E) DSC03LF

        %FOUND(DSC03LF1)

        You made a typing error ?

        Just a tip!

        For easier reading: change
        Code:
        C DOW %EOF = *OFF
        
        to
        
        C DOW NOT %EOF
        
        A common newbee mistake: change
        
        C IF NOT %ERROR
        
        to
        
        C IF %FOUND(the_name_of_your_LF_file_you_used_for_CHAIN)
        And how is the key ##CDE build?

        I saw from your code on another post that that part is OK !
        Last edited by Marc_d; October 14, 2008, 12:28 AM.

        Comment


        • #5
          Re: subfile issues

          i fixed as u said b ut it still not working

          Comment


          • #6
            Re: subfile issues

            please see following links:
            http://www.amazon.com/Essentials-Sub...3989271&sr=1-2
            http://www.amazon.com/Subfiles-RPG-I...3989271&sr=1-1
            I'm not anti-social, I just don't like people -Tommy Holden

            Comment


            • #7
              Re: subfile issues

              post your new jacked up code as well as the dds to the files and we will
              help you...... We are starting to slip into old habits of not providing us enough information to help you do your job!

              jamie
              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


              • #8
                Re: subfile issues

                hi jamief
                no of course not the old habit i won't go in the same mistake as before
                i will reload here all my code tomorrow morning
                thanks for all alot

                Comment

                Working...
                X