RPGIV @ Work

A unique site for RPG and System i Lovers

Welcome!

Hi, this site will provide all what you need in System i and RPG developments.

My Name is Chamara Withanachchi, System i Expert and RPG Developer. And in the field for last 11 years.

I hope you will find lot of valuable information from this site

Retrieve Database File Description (QDBRTVFD) API Print E-mail
User Rating: / 0
PoorBest 
Written by Chamara Withanachchi   

The Retrieve Database File Description (QDBRTVFD) API allows you to get complete and specific information about a file on a local or remote system. The information is returned to a receiver variable in either a file definition template or a format definition mapping.


 h debug datedit(*ymd) datfmt(*iso-) decedit('0.')           
                                                             
 d QDBRTVFD        pr                  extpgm('QDBRTVFD')    
 d Receiver                   65535                          
 d receiver_len                  10I 0 const                 
 d actual_file                   20                          
 d Format                         8    const                 
 d search_file                   20    const                 
 d format_name                   10    const                 
 d Override                       1    const                 
 d System_Input                  10    const                 
 d Format_type                   10    const                 
 d ErrorCode                           like(error_code      )

 d receiver        s          65535                          

 d len             s             10I 0                         
 d actual_file     s             20                            
                                                               
 d Error_Code      ds                  qualified               
 D  provided                     10I 0 INZ(%size(Error_Code )) 
 D  available                    10I 0                         
 D  msgid                         7                            
 D  msgdta                      240                            
                                                               
  /Free                                                        
                                                               
   receiver = *Loval;                                          
   len = %Len(receiver);                                       
   
   // reclaim all data form a file            
   QDBRTVFD (receiver                         
      : len                                   
      : actual_file                           
      :  'FILD0200'                           
      :  'FTPLOG    SDBUTILS  '               
      :  '*FIRST'                             
      :  '0'                                  
      :  '*LCL'                               
      :  '*INT'                               
      : Error_Code );                         
   Dump;                                      
   *InLr = *On ;                              
                                             
  /end-free   

Format name


1. FILD0100 - File definition template
2. FILD0200 - Format definition template
3. FILD0300 - Key field information template
4. FILD0400 - Trigger information template


Format type


*EXT - The formats returned are external. If the specified file is a logical file, the format returns data for the logical fields defined in the logical record format. If the specified file is a physical file, the internal and external field names are the same.
*INT- The formats returned are internal. If the specified file is a logical file, the format returns data for the fields on which the logical fields are based. If the specified file is a physical file, the internal and external field names are the same.


User Comments

Please login or register to add comments

<Previous   Next>