ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

*RNF7030 compile error

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

  • *RNF7030 compile error

    Hi all,

    I am a newbie for RPGIV, I got a compile error with following source, so anyone can help me? thank you so much~

    *RNF7030 30 001009 The name or indicator CARDNM2 is not defined.
    *RNF7030 30 001010 The name or indicator CARDTP2 is not defined.
    *RNF7030 30 001011 The name or indicator MONTH2 is not defined.
    *RNF7515 30 001009 Move operands CARDNM and CARDNM2 have types that are not
    compatible.
    *RNF7515 30 001010 Move operands CARDTP and CARDTP2 have types that are not
    compatible.
    *RNF7515 30 001011 Move operands MONTH and MONTH2 have types that are not
    compatible.
    *RNF7030 30 3 The name or indicator is not defined.
    *RNF7515 30 3 The move operation has operands that are not compatible.

    Code:
    CARDF1
    ----------
    A                                      UNIQUE               
    A          R CARDP1                                         
    A            CARDNM        16S 0       COLHDG('CARD NUMBER')
    A            CARDTP         2A         COLHDG('CARD TYPE')  
    A            MONTH          6S 0       COLHDG('MONTH')      
    A          K CARDNM                                         
    
    CARDF1A
    ------------
    A                                      UNIQUE               
    A          R CARDP1A                                        
    A            CARDNMA       16S 0       COLHDG('CARD NUMBER')
    A            CARDTPA        2A         COLHDG('CARD TYPE')  
    A            MONTHA         6S 0       COLHDG('MONTH')      
    A          K CARDNMA   
    
    CARDF1B
    -----------
    A                                      UNIQUE                 
    A          R CARDP1B                                          
    A            CARDNMB       16S 0       COLHDG('CARD NUMBER')  
    A            CARDTPB        2A         COLHDG('CARD TYPE')    
    A            MONTHB         6S 0       COLHDG('MONTH')        
    A          K CARDNMB

    Code:
    0000.01 FCARDF1    IF   E           K DISK                                      
    0000.02 FCARDF1A   IF   E           K DISK                                      
    0000.03 FCARDF1B   O  A E           K DISK                                      
    0010.02  *                                                                      
    FMT C   CL0N01Factor1+++++++Opcode&ExtFactor2+++++++Result++++++++Len++D+HiLoEq.
    0010.03                                                                         
    0010.04 C                   READ      CARDF1                                 80 
    0010.05 C                   DOW       *IN80 = *OFF                              
    0010.06 C     CARDNM        SETLL     CARDP1A                                81 
    0010.07 C                   IF        *IN81 = *ON                               
    0010.08 C     CARDNM        CHAIN     CARDP1A                            82     
    0010.09 C                   IF        *IN82 = *OFF                              
    0010.10 C                   MOVE      CARDNM        CARDNM2                     
    0010.11 C                   MOVE      CARDTP        CARDTP2                     
    0010.12 C                   MOVE      MONTH         MONTH2                      
    0010.13 C                   WRITE     CARDP1B                                   
    0010.14 C                   ENDIF                                               
    0010.15 C                   ENDIF                                               
    0010.16 C                   SETOFF                                       8182   
    0010.17 C                   READ      CARDF1                                 80 
    0010.18 C                   ENDDO                                               
    0010.19  *                                                                      
    0010.20 C                   EVAL      *INLR = *ON                               
    0017.00 C                   RETURN

  • #2
    Re: *RNF7030 compile error

    you have to define those fields and the errors will go away.

    your file definitions do not include the fields:
    Code:
    *RNF7030 30 001009 The name or indicator CARDNM2 is not defined.
    *RNF7030 30 001010 The name or indicator CARDTP2 is not defined.
    *RNF7030 30 001011 The name or indicator MONTH2 is not defined.
    so you'll have to define them in your D specs.
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: *RNF7030 compile error

      You can copy the following code into your program, which should define the 3 fields.


      Code:
      d CardNm2         s                   Like( CardNm ) 
      d CardTp2         s                   Like( CardTp ) 
      d Month2          s                   Like( Month )

      Once you take care of the undefined fields, most or all of the other errors in your program will also go away.
      Michael Catalani
      IS Director, eCommerce & Web Development
      Acceptance Insurance Corporation
      www.AcceptanceInsurance.com
      www.ProvatoSys.com

      Comment


      • #4
        Re: *RNF7030 compile error

        Hi gqtarou:

        I would guess that you wanted:
        Code:
        0010.10 C                   MOVE      CARDNM        CARDNMB
        0010.11 C                   MOVE      CARDTP        CARDTPB                     
        0010.12 C                   MOVE      MONTH         MONTHB  
               instead of:
        0010.10 C                   MOVE      CARDNM        CARDNM2     
        0010.11 C                   MOVE      CARDTP        CARDTP2                     
        0010.12 C                   MOVE      MONTH         MONTH2
        Best of Luck
        GLS
        The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

        Comment


        • #5
          Re: *RNF7030 compile error

          Code:
          0010.06 C     CARDNM        SETLL     CARDP1A                                81 
          0010.07 C                   IF        *IN81 = *ON                               
          0010.08 C     CARDNM        CHAIN     CARDP1A                            82
          In the above section of your code, you do not need the SETLL operation, or the following IF statement (and its corresponding endif statement.) You can simply perform a chain to the file without position via a setll operation.
          Michael Catalani
          IS Director, eCommerce & Web Development
          Acceptance Insurance Corporation
          www.AcceptanceInsurance.com
          www.ProvatoSys.com

          Comment


          • #6
            Re: *RNF7030 compile error

            Please declare the below fields in your program..

            It's giving error like:

            *RNF7030 30 001009 The name or indicator CARDNM2 is not defined.
            *RNF7030 30 001010 The name or indicator CARDTP2 is not defined.
            *RNF7030 30 001011 The name or indicator MONTH2 is not defined.

            here you have to make sure that the fields CARDNM2,CARDTP2 and MONTH2 are being declared in the program or else if these fields are in some other file then declare that file in the program.

            Coz,I can't see these three fields in your DDS for PF/LF.

            Hope this will work...

            Comment


            • #7
              Re: *RNF7030 compile error

              Originally posted by MichaelCatalani View Post
              Code:
              0010.06 C     CARDNM        SETLL     CARDP1A                                81 
              0010.07 C                   IF        *IN81 = *ON                               
              0010.08 C     CARDNM        CHAIN     CARDP1A                            82
              In the above section of your code, you do not need the SETLL operation, or the following IF statement (and its corresponding endif statement.) You can simply perform a chain to the file without position via a setll operation.
              yes...if you just want to know the existence of the record then use CHAIN. It will be easier.

              Comment


              • #8
                Re: *RNF7030 compile error


                yes...if you just want to know the existence of the record then use CHAIN. It will be easier.
                If you just want to check just for existence SETLL will be a better idea..as it does fetch the record in to memory buffer ..it just point it

                Use SETLL and BIF %found that will serve the purpose


                Pramendra Pandeya
                Young people knows how to run fast but old people knows the way..

                Comment


                • #9
                  Re: *RNF7030 compile error

                  Originally posted by pramendra View Post
                  If you just want to check just for existence SETLL will be a better idea..as it does fetch the record in to memory buffer ..it just point it

                  Use SETLL and BIF %found that will serve the purpose


                  Pramendra Pandeya
                  you'll want to check %EQUAL not %FOUND!!!
                  I'm not anti-social, I just don't like people -Tommy Holden

                  Comment


                  • #10
                    Re: *RNF7030 compile error

                    hmmm...my mistake

                    it should be %FOUND .....

                    Pramendra Pandeya
                    Young people knows how to run fast but old people knows the way..

                    Comment


                    • #11
                      Re: *RNF7030 compile error

                      Just for information:
                      %EQUAL is set to *ON if an exact match is found.
                      %FOUND is set to *ON if a subsequent read would be successfull, but that does not imply that there is an exact match.

                      Birgitta

                      Comment

                      Working...
                      X