× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: occur
  • From: Art Baker <Art_Baker@xxxxxxxx>
  • Date: Mon, 27 Dec 1999 11:47:10 -0500

Hi,
        I have been working on this RPG routine that passes data to a
financial software package. The routine is to create an account by passing
the data to the AS400 from an outside source. I have been successful
creating an account passing one database file attached to the routine but
having problems passing two databases with this routine. I have been trying
to put the data in a dataq and then passing the dataq to the AS400 but since
adding the second data file I get an empty dataq or some other error caused
by me modifying the source code. The RPG routine starts with reading the two
input files, ACCTINF and CONTIN. The 'copy iaslnkrsrc ...' are copybooks
that the financial software uses, basically takes care of the API's needed
to pass parameters.
      *  External Feed File                                             
      *                                                                 
     FACCTINF IF  E                    DISK                           U 
     FCONTIN  IF  E                    DISK                           U 
      /COPY IASLNKRSRC,LINKVERSEX                                       
      /COPY IASLNKRSRC,LINKDTAQEX                                       
      *                                                                 
   
     .                                   
     .Then the data files are read
      * Process External Feed Data                                    
      ****************************************************************
     C           PRCESS    BEGSR                                      
      *                                                               
      *  Perform initial read of external data                        
      *                                                               
     C                     READ ACCTINF                  29           
     C                     READ CONTIN                   30           
      *                                                               
      *  Loop while there is data present                             
      *                                                               
     C           *IN29     DOWEQ*OFF                                  
     C           *IN30     DOWEQ*OFF                                  
      *                                                               
     .
     . Then the ACCTINF file is inputted to the Address page of the account.

 C                     Z-ADD1         ILQOCR                      
 C           ILQOCR    OCUR ILADEN                     ;point to 1
 C                     CLEARILADEN                                
 C                     MOVELADDR1     ILADAT                      
 C                     MOVELADDR2     ILADA1                      
 C                     MOVELADDR3     ILADA2                      
 C                     MOVELADDR4     ILADA3                      
 C                     MOVELADDR5     ILADA4                      
 C                     MOVELADDR6     ILADTO                      
 C                     MOVELADDR7     ILADCO                      
 C                     MOVELADDR8     ILADCU                      
 C                     MOVELZIPCD     ILADPO                      
  *                                                               
      .
      .The address page is sent.
   *                                                                 
   C                     MOVELILADEN    ILDATA           ;copy to tem 
   C                     MOVELILQPUT    ILQACT           ;set action  
   C                     Z-ADDILADSP    ILQOFF           ;offset      
   C                     Z-ADDILADLE    ILQLEN           ;length of e 
   C                     EXSR LNKOCC                                  
   C                     EXSR LNKSND             
      .
      .Then the CONTIN is passed to the CONTACT page of the account.
     C                     CLEARILAPCO                     ;data queue  
     C                     MOVELILQE07    ILCOID           ;IASCONTACT  
     C                     Z-ADD1         ILQOCR                        
     C           ILQOCR    OCUR ILCOEN                     ;point to 1s 
     C                     CLEARILCOEN                                  
     C                     MOVELC         ILCOCC                        
     C                     MOVELO         ILCOCO                        
     C                     MOVELX         ILCOTX                        
     C                     MOVELR         ILCOTE                        
     C                     MOVELT         ILCOCR                        
     C                     MOVELF         ILCOFA

        .
        .Then the CONTACT page is sent.
                                         
      C                     MOVELILCOEN    ILDATA           ;copy to tem 
      C                     MOVELILQPUT    ILQACT           ;set action  
      C                     Z-ADDILCOSP    ILQOFF           ;offset      
      C                     Z-ADDILCOLE    ILQLEN           ;length of e 
      C                     EXSR LNKOCC                                  
      C                     EXSR LNKSND

         .
         .Then the data is passed to the parameters and dataq.
    C           LNKOCC    BEGSR                                        
    C                     CALL 'LNKOCCUR'                              
    C                     PARM           ILQACT           ;action      
    C                     PARM           ILQOFF           ;offset      
    C                     PARM           ILQOCR           ;occurrence  
    C                     PARM           ILQLEN           ;length of e 
    C                     PARM           ILQDTA           ;target stri 
    C                     ENDSR                                  
      
Hope this isn't too choppy. Didn't want to create a gigantic message. 
The problem I seem to have is using 'occur'. The only example RPG routine I
found on site here was using SETON and SETOFF but I think using 'SET..' is
from RPGII days and the way to do this now is with occur or even set up an
array.
So, I'm not a RPG expert but I have a working routine that uses one database
file, the problem is adding in a second data base file that is a problem.
Appreciate any advice you might have,
Art
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.