ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

readc subfile issue

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

  • #16
    Re: readc subfile issue

    I would suggect changing your chain opcode line back to this:

    chain (zip:actno) customersl;


    recompile the program. Signoff. Then log back on and run the program.
    Michael Catalani
    IS Director, eCommerce & Web Development
    Acceptance Insurance Corporation
    www.AcceptanceInsurance.com
    www.ProvatoSys.com

    Comment


    • #17
      Re: readc subfile issue

      no luck it gives three errors when i change the chain and compile. i only change the chain from chain key14 customersl; to chain (zip:actno) customersl; the first errors the second compiles. those are the correct fields. i tried remaking all the files with different names and it still wont do a multiple chain. it will chain one item but when i try putting more then one seperated by a colon it throws out the same three errors.

      is it possible my version dont support multiple chains?

      *RNF5031 20 1 Result-Field operand is not valid.
      *RNF5309 30 1 Factor 1 operand is not valid.
      *RNF5507 30 1 A semi-colon is not specified at the end of a free-format

      Comment


      • #18
        Re: readc subfile issue

        i think this *RNF5507 30 1 A semi-colon is not specified at the end of a free-format may be the culprit this entire time. anytime a semi-colon is missed you'll get other errors that are totally unrelated since the compiler considers all code between semi-colons as a single operation. find where the semi-colon is missing, add the semi-colon and recompile...i'm willing to bet your other compile errors in that portion of code will go away...if not post the entire compile listing if possible.
        I'm not anti-social, I just don't like people -Tommy Holden

        Comment


        • #19
          Re: readc subfile issue

          Please post the code with the free format changes...

          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


          • #20
            Re: readc subfile issue

            Sorry if i am bothersome. I was just trying to teach myself how to use subfiles to select records in free format all the examples i find are not in free format. Thanks for all your responses and like i said it works i was just trying to figure out why i could not chain using 2 keys, but i was able to chain using a klist with the same keys.

            the code i uploaded is the working version i only change one spot in the code and it wont compile.
            the only line i change is line 45.17

            before (working):
            chain key14 customersl;

            after (compile errors):
            chain (zip:actno) customersl;
            PHP Code:
             
            0011.00  
            /FREE                                                                                              100608                  
            0011.01     DOW NOT 
            EXIT;                                                                                   100615                  
            0011.04      EXFMT CUSTINQ
            ;                                                                                 100610                  
            0012.01      EXSR ZIPSEARCH
            ;                                                                                100615                  
            0028.00     ENDDO
            ;                                                                                          100615                  
            0030.00     
            *INLR = *ON;                                                                                    100610                  
            0031.00     
            RETURN;                                                                                         100610                  
            0032.00                                                                                                     100608                  
            0032.01   
            //---------------------------------------------------                                             100615                  
            0032.02   // SUBROUTINE TO SEARCH ACCOUNT FOR ZIP                                                           100615                  
            0032.03   //---------------------------------------------------                                             100615                  
            0032.04                                                                                                     100615                  
            0032.05        BEGSR ZIPSEARCH
            ;                                                                             100615                  
            0032.07           SETLL ZIP CUSTOMERSL
            ;                                                                     100615                  
            0032.08           
            IF NOT %EQUAL(CUSTOMERSL);                                                                100615                  
            0032.09              ZIPNF 
            = *ON;                                                                           100615                  
            0032.10           
            ELSE;                                                                                     100615                  
            0032.11             EXSR CLEARSFL
            ;                                                                          100615                  
            0032.12             EXSR LOADSFL
            ;                                                                           100615                  
            0032.13             WRITE FOOTER
            ;                                                                           100615                  
            0032.14             EXFMT CTLCUST
            ;                                                                          100615                  
            0032.15             
            IF NOT EXIT AND NOT CANCEL;                                                             100615                  
            0032.16                EXSR UPDATECUST
            ;                                                                     100615                  
            0032.17             
            ENDIF;                                                                                  100615                  
            0032.18           
            ENDIF;                                                                                    100615                  
            0032.19        ENDSR
            ;                                                                                       100615                  
            0032.20                                                                                                     100615                  
            0032.21   
            //-------------------------------------------------                                               100615                  
            0032.22   //---------------------------------------------------                                             100608                  
            0034.00   // SUBROUTINE TO CLEAR SUBFILE AND RESET RECORD NUMBER TO 0                                       100608                  
            0034.01   //---------------------------------------------------                                             100608                  
            0035.00                                                                                                     100608                  
            0036.00        BEGSR CLEARSFL
            ;                                                                              100608                  
            0037.00           SFLCLR 
            = *ON;                                                                             100608                  
            0038.00           SFLDSP 
            = *OFF;                                                                            100610                  
            0039.00           WRITE CTLCUST
            ;                                                                            100610                  
            0040.00           SFLCLR 
            = *OFF;                                                                            100608                  
            0041.00           RRN 
            0;                                                                                  100614                  
            0042.00        ENDSR
            ;                                                                                       100608                  
            0043.00                                                                                                     100608                  
            0043.01   
            //-------------------------------------------------                                               100608                  
            0044.00                                                                                                     100608                  
            0044.01   
            //-------------------------------------------------                                               100608                  
            0044.02   // SUBROUTINE TO LOAD SUBFILE UNTIL NO MORE RECORDS                                               100608                  
            0044.03   //-------------------------------------------------                                               100608                  
            0044.04                                                                                                     100608                  
            0044.05        BEGSR LOADSFL
            ;                                                                               100608                  
            0044.06           READE ZIP CUSTOMERSL
            ;                                                                     100615                  
            0044.07           DOW NOT 
            %EOF(CUSTOMERSL);                                                                 100615                  
            0044.09              RRN 
            RRN 1;                                                                         100614                  
            0044.11              WRITE SFLCUST
            ;                                                                         100608                  
            0044.12              READE ZIP CUSTOMERSL
            ;                                                                  100615                  
            0044.14           ENDDO
            ;                                                                                    100615                  
            0044.18           SFLDSP 
            = (RRN 0);                                                                       100614                  
            0044.19        ENDSR
            ;                                                                                       100608                  
            0044.22                                                                                                     100608                  
            0044.23   
            //-------------------------------------------------                                               100608                  
            0045.00                                                                                                     100608                  
            0045.01   
            //------------------------------------------------                                                100608                  
            0045.02   // SUBROUTINE TO READ CHANGED RECORDS AND UPDATE                                                  100608                  
            0045.03   //-------------------------------------------------                                               100608                  
            0045.04                                                                                                     100608                  
            0045.05     BEGSR UPDATECUST
            ;                                                                               100615                  
            0045.06        READC SFLCUST
            ;                                                                               100615                  
            0045.07        DOW NOT 
            %EOF;                                                                                100615                  
            0045.08          
            IF NOT EXIT AND NOT CANCEL;                                                                100615                  
            0045.17             CHAIN KEY14 CUSTOMERSL
            ;                                                                 100616                  
            0045.19               
            IF %FOUND(CUSTOMERSL);                                                                100615                  
            0045.21                  EXFMT CUSTEDIT
            ;                                                                    100615                  
            0045.24                  UPDATE CUSTREC
            ;                                                                    100615                  
            0045.26               
            ENDIF;                                                                                100615                  
            0045.27          
            ENDIF;                                                                                     100615                  
            0045.28        READC SFLCUST
            ;                                                                               100615                  
            0045.29        ENDDO
            ;                                                                                       100615                  
            0045.30     ENDSR
            ;                                                                                          100615                  
            0045.31                                                                                                     100608                  
            0045.37   
            //-------------------------------------------------                                               100616                  
            0045.38                                                                                                     100616                  
            0045.64  
            /END-FREE                                                                                          100608 

            Comment

            Working...
            X