× 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.



I have a program that is doing a user controlled open and close of a file,
overriding to a specific member in the file.  
I want to be able to use the rrn(397-400I) of the infds.  However when I
override and try to do a setll I seem to get erroneous information.  
I have tried z-add the value to another variable and using this, but still i
get bad results. 

So, First question is.  Can i use the Relative record number in the INFDS on
a multimember file.
Second can i do this on a file that is being opened in the program.  
third.  what is wrong.
any help is greatly appreciated.

here is a code snippet.

FORDERLIST IP   E           K DISK                            
FPIFORDER  IF   E             DISK    USROPN                  
F                                     INFDS(INFDS)            
FPIFORDERS O    E             DISK    USROPN                  
F                                     PREFIX(N)               
F                                     RENAME(PIDTA00R:PIREC)  

 D INFDS           DS                                            
 D DB_RRN                397    400I 0                           
  *                                                              
  *                                                              
 DQCmdExc          PR                  EXTPGM('QCMDEXC')         
  *      Execute a command.                                      
 D PR_CmdStr                   4096A   CONST OPTIONS(*VARSIZE)   
 D PR_CmdStrLen                  15P 5 CONST                     

                                                                  
 C                   IF        NOT %OPEN(PIFORDER)                
                                                                  
 C                   EVAL      CMDSTR    = 'OVRDBF PIFORDER MBR(' 
 C                   EVAL      CMDSTR    = %TRIM(CMDSTR) +        
 C                                         %TRIM(MLNAME) + ')'    
  *                                                               
 C                   CALLP     QCmdExc(CmdStr:                    
 C                                     %LEN(%TRIMR(CmdStr)))      
 C                   OPEN      PIFORDER                           
 C                   ENDIF                                        
 C                   EXSR      $PROCESS   

                       
 C     $PROCESS      BEGSR                                         
 C                   EXSR      $OPNPIREC                           
  * START AT THE BEGGINING OF THE FILE OR WHEREEVER IT LEFT OFF.   
 C                   Z-ADD     DB_RRN        #RECHOLD              
 C     #RECHOLD      SETLL     PIFORDER                            
 C                   DOU       %EOF(PIFORDER)                      
 C                   READ      PIFORDER                            
 C                   IF        NOT %EOF(PIFORDER)                  
 C                   IF        %SUBST(PIFLD:1:5) <> '@FILE'










                                                                 
+---
| 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-Ups:

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.