Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1298725
  • 博文数量: 287
  • 博客积分: 11000
  • 博客等级: 上将
  • 技术积分: 3833
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-16 08:43
文章分类
文章存档

2013年(15)

2012年(17)

2011年(17)

2010年(135)

2009年(85)

2008年(18)

分类: 系统运维

2010-06-11 09:30:29

QDBRTVFD - Retrieve Database File Description
 
 * List Key Fields (QDBRTVFD retrieve file desc)API Procedure     
DListFileDesc     pr                  ExtPgm('QDBRTVFD')          
d  OutputData                32766a   Options(*Varsize)           
d  OutputDataLen                10i 0 Const                       
d  CUSPFNameRet                 20a                               
D  PFRcdFmt                      8a   Const                       
d  CUSPFName                    20a   Const                       
D  RcdFmt                        8a   Const                       
d  OverrideProc                  1a   Const                       
d  System                       10a   Const                       
d  FormatType                   10a   Const                       
d  ErrorCode                 32766a   options(*varsize)

* List File Description Header DS     
D  FDHDS          ds                   
D  FDHBytesRet                  10i 0  
D  FDHBytesAvail                10i 0  
D  FDHMaxKeyLen                  5i 0  
D  FDHKeyCount                   5i 0  
D  FDHReserved                  10a    
D  FDHFormatCnt                  5i 0  
D  KeyRecFmt                    10a    
D  KeyReserve                    2a    
D  Key#OfKeys                    5i 0  
D  KeyReserv1                   14a    
D  KeyInfoOffset                10i 0  

                                         
* List Key Information DS               
D KeyDS           ds                     
D  KeyIntName                   10a      
D  KeyExtName                   10a      
D  KeyDtaType                    5i 0    
D  KeyFldLen                     5i 0    
D  Key#OfDigits                  5i 0    
D  KeyDecPos                     5i 0    
D  KeyAttrFlg                    1a      
D  KeyAltLen                     5i 0    
D  KeyAltName                   30a      
D  KeyReserv3                    1a      
D  KeyAttrFlg1                   1a      
D  KeyReserv4                    1a                 

c                   CallP(E)  ListFileDesc(OutputData: 
c                             OutputDataLen:           
c                             CUSPFNameRet:            
c                             'FILD0300':              
C                             CUSPFName:               
c                             RcdFmtName:              
c                             OverrideProc:            
c                             '*LCL':                  
c                             '*EXT':                  
c                             ErrorDS)                 

                                                                     
* If Any Errors Occur or No Key Fields Found, Set Number Of Keys To 0
c                   If        OutputData=*Blanks                     
C                             OR %Error                              
c                             OR %len(%Trim(OutputData))=0           
c                   Eval      Key#OfKeys=0                           
c                   Else                                             
c                   MoveL     OutputData    FDHDS                    
c                   EndIf                                            
                                                                     
* Process Key Information Stored in the OutputData Variable         
c                   Eval      StrPos=KeyInfoOffset+1                 
c                   Do        Key#OfKeys                             
c                   Eval      KeyDS=%Subst(OutputData:StrPos:        
c                             +%Size(KeyDS))                         

阅读(793) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~