ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

/free + subprocedure + O-Spec update

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

  • /free + subprocedure + O-Spec update

    Hi all
    I have a subprocedure and i need to update some data from a file by the O-Specs.
    Here some of the code, the subprocedure retrieves some "next number":
    PHP Code:
    P rtvNextEndoso   b                             
    D rtvNextEndoso   pi             5  0           
     
    /free                                          
                                                    
          k211ram 
    ds25.p25ram;                    
          
    chain key211 sc211p1;                     
          if %
    found;                                
             
    end211 += 1;                           
             
    except upd;                            
          endif;                                    
          return 
    end211;                            
                                                    
     /
    end-free                                      
    OSC211P1   E            upd                     
    O                       end211              28  
    P rtvNextEndoso   e 
    I have tested many ways, like setting the O-Specs at the end of the whole code, inside the subrpocedure as we can see above, but i get always the same errors, it's like the O-Specs are not in the correct place:
    PHP Code:
    *RNF0258 30      2 Form-Type entry is not valid for subprocedures, or is out o
                       sequence
    .                                                  
    *
    RNF7025 30      1 The operand for operation EXCPT is not defined.            
    *
    RNF7030 30      1 The name or indicator is not defined
    Any help? or al least any other way of updating the file? (It is a system/36 database, it has no DDS), that is why i use O-Specs.-

  • #2
    Re: /free + subprocedure + O-Spec update

    Hi jborgh

    O specs come before P specs

    I think that was your question

    Best of Luck
    GLS
    The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

    Comment


    • #3
      Re: /free + subprocedure + O-Spec update

      Originally posted by GLS400 View Post
      Hi jborgh

      O specs come before P specs

      I think that was your question

      Best of Luck
      GLS
      true and that's why the errors are there. O specs are a part of the main proc and therefore MUST come before any subprocs.
      I'm not anti-social, I just don't like people -Tommy Holden

      Comment


      • #4
        Re: /free + subprocedure + O-Spec update

        OK .. let me ask about the White Elephant in the room here...

        Why use the O-Spec for the update? Why not do an update %Fields() or something cleaner?

        Just curious...

        Comment


        • #5
          Re: /free + subprocedure + O-Spec update

          Thanks to both!
          That answer was the real thing.
          I dont know why i didnt tried to place the O-Specs there..
          Problem solved!!
          As en example, the code:

          PHP Code:
          ITablas Generales para impuestos IVA Argentina 
          ISB011P1   NS        1 C0    2 C4    3 C1          
          I         
          AND        4 C0    5 C0    6 C0          
          I         
          AND        7 C0    8 C1                  
          I                                 43   47 2impiva1 
          I                                 49   53 2impiva2 
          I                                 55   59 2impiva3 
          *******************************************
           /
          free                                     
                                                     
             
          // ** MAINLINE PROCESS **               
                                                     
                
          StartProgram();                      
                
          newCertif rtvNextCertif();         
                
          setll *loval polel70a;               
                
          read polel70a;                       
                
          dow not %eof;                        
                     if 
          not KeyChange;               
                        
          LastKey p70agr;            
                        
          KeyChange = *on;             
                     endif;                          
                     if 
          LastKey <> p70agr;           
                        
          key12.p12cdp p62cdp;       
                        
          setll %kds(key12:1prolef12;
                        
          reade %kds(key12:1prolef12;       
                        
          dow not %eof;                       
                            
          CreateTMF6();                   
                            
          CreateTMF5();                   
                            
          WriteReport();                  
                            
          Update25();                     
                            
          reade %kds(key12:1prolef12;   
                        
          enddo;                              
                        
          LastKey p70agr;                   
                     endif;                                 
                     
          CreateData25();                        
                     
          CreateData46();                        
                     
          CreateData24();                        
                     
          read polel70a;                         
                
          enddo;                                      
                
          EndProgram();           
                              
             
          // ** END MAINLINE PROCESS **                     
                                                               
           
          /end-free                                           
                                                               
          *****************************************************
          OSC211P1   E            upd                          
          O                       end211              28       
          *****************************************************

             
          // rtvNextEndoso Procedure: Recupera ultimo endoso y actualiza 
          P rtvNextEndoso   b                                               
          D rtvNextEndoso   pi             5  0                             
           
          /free                                                            
                                                                            
                k211ram 
          ds25.p25ram;                                      
                
          chain key211 sc211p1;                                       
                if %
          found;                                                  
                   
          end211 += 1;                                             
                   
          except upd;                                              
                endif;                                                      
                return 
          end211;                                              
                                                                            
           /
          end-free                                                        
          P rtvNextEndoso   e 

          Comment


          • #6
            Re: /free + subprocedure + O-Spec update

            Originally posted by FaStOnE View Post
            OK .. let me ask about the White Elephant in the room here...

            Why use the O-Spec for the update? Why not do an update %Fields() or something cleaner?

            Just curious...
            because i said that it was a program described file, with no DDS

            Comment


            • #7
              Re: /free + subprocedure + O-Spec update

              Must ... Take ... Reading ... Class ...

              :

              Comment

              Working...
              X