ジャーナル情報の API (QjoRetrieveJournalInformation) による取得 (2) - ジャーナル情報の取得 -

Key 1 の場合です。

ジャーナルを指定して、そのジャーナルの情報を取得します。
どのジャーナルレシーバーに接続されているか、いつ接続されたか、いまどんな状態か、などといった情報が取得できます。

Key 1 Output Section

Offset Type Field
Dec Hex
Note: The following fields are returned when the journal receiver directory key information is specified. Otherwise, they will not be used.
0 0 BINARY(4) Total number of journal receivers
4 4 BINARY(4) Total size of journal receivers
8 8 BINARY(4) Total size of journal receivers multiplier
12 C CHAR(8) Reserved
Note: The following fields repeat for each journal receiver that is returned.
CHAR(10) Journal receiver name
CHAR(10) Journal receiver library name
CHAR(5) Journal receiver number
CHAR(13) Journal receiver attached date and time
CHAR(1) Journal receiver status
CHAR(13) Journal receiver saved date and time
CHAR(8) Local journal system associated with the journal receiver
CHAR(8) Source journal system associated with the journal receiver
BINARY(4) Journal receiver size
CHAR(56) Reserved

例によって簡単にするために、情報を取って DSPLY で確認するだけのプログラムになっています。

     H DFTACTGRP(*NO)                                                            
     **                                                                                             
     D RTVJRNINF1      PR                                                                           
     D  JRN                          10                                                             
     D  LIB                          10                                                             
     D RTVJRNINF1      PI                                                                           
     D  JRN                          10                                                             
     D  LIB                          10                                                             
     **                                                                                             
     D ERRC0100        Ds                  Qualified                                                
     D  ByteProvided                 10i 0 Inz( %Size( ERRC0100 ))                                  
     D  ByteAvail                    10i 0 Inz                                                      
     D  ExcpID                        7a                                                            
     D                                1a                                                            
     D  ExcpData                    128a                                                            
     **                                                                                             
     D i               s             10u 0                                                          
     D ApiRcvSiz       s             10u 0                                                          
     **                                                                                             
     D RJRN0100        Ds                  Based( pJrnInf )  Qualified                              
     D  ByteReturned                 10i 0                                                          
     D  ByteAvail                    10i 0                                                          
     D  OfsKeyInf                    10i 0                                                          
     D  JrnNam                       10a                                                            
     D  JrnLib                       10a                                                            
     D  ASP                          10i 0                                                          
     D  MsgQName                     10a                                                            
     D  MsgQLib                      10a                                                            
     D  MngRcvOpt                     1a                                                            
     D  DltRcvOpt                     1a                                                            
     D  RMVINTENT                     1a                                                            
     D  MINFIXLEN                     1a                                                            
     D  MAXOPT1                       1a                                                            
     D  MAXOPT2                       1a                                                            
     D  MAXOPT3                       1a                                                            
     D  rsvd1                         2a                                                            
     D  JrnType                       1a                                                            
     D  RmtJrnType                    1a                                                            
     D  JrnStatus                     1a                                                            
     D  JrnDlvyMode                   1a                                                            
     D  LclJrnName                   10a                                                            
     D  LclJrnLib                    10a                                                            
     D  LclJrnSys                     8a                                                            
     D  SrcJrnName                   10a                                                            
     D  SrcJrnLib                    10a                                                            
     D  SrcJrnSys                     8a                                                            
     D  RedirRcvLib                  10a                                                            
     D  JrnText                      50a                                                            
     D  MinEntDtaAra                  1a                                                            
     D  MinEntFiles                   1a                                                            
     D  rsvd2                         8a                                                            
     D  JrnCache                      1a                                                            
     D  NbrAtcdRcvs                  10i 0                                                          
     D  AtcdRcvName                  10a                                                            
     D  AtcdRcvLib                   10a                                                            
     D  AtcdLclSys                    8a                                                            
     D  AtcdSrcSys                    8a                                                            
     D  AtcdDualRcv                  10a                                                            
     D  AtcdDRcvlib                  10a                                                            
     D  MngRcvDly                    10i 0                                                          
     D  DltRcvDly                    10i 0                                                          
     D  ASPDevName                   10a                                                            
     D  LclJrnGrp                    10a                                                            
     D  SrcJrnGrp                    10a                                                            
     D  JobNameStored                 1a                                                            
     D  UsrNameStored                 1a                                                            
     D  PgmNameStored                 1a                                                            
     D  LibNameStored                 1a                                                            
     D  SysseqStored                  1a                                                            
     D  RmtAdrStored                  1a                                                            
     D  THDidStored                   1a                                                            
     D  LUWidStored                   1a                                                            
     D  XIDStored                     1a                                                            
     D  rsvd3                         4a                                                            
     D  JrnObjLmt                     1a                                                            
     D  JrnObjTotal                  10u 0                                                          
     D  JrnTblTotal                  10u 0                                                          
     D  JrnMbrTotal                  10u 0                                                          
     D  JrnDATotal                   10u 0                                      Journaled Data Area 
     D  JrnDQTotal                   10u 0                                      Journaled Data Q    
     D  JrnIfsTotal                  10u 0                                                          
     D  JrnAPTotal                   10u 0                                      Journaled AccessPath
     D  JrnCmtTotal                  10u 0                                      CMTDFN              
     D  rsvd4                       104a                                                            
     D  NbrKey                       10i 0                                                          
     **                                                                                             
     D JrnKey          Ds                  Based( pJrnKey )  Qualified                              
     D  Key                          10i 0                                                          
     D  OfsKeyInf                    10i 0                                                          
     D  KeyHdrLen                    10i 0                                                          
     D  Entries                      10i 0                                                          
     D  EntriyLen                    10i 0                                                          
     **                                                                                             
     D JrnKeyHdr1      Ds                  Based( pKeyHdr1 )  Qualified                             
     D  TotalRcvs                    10i 0                                                          
     D  TotalRcvSize                 10i 0                                                          
     D  RcvSizeMult                  10i 0                                                          
     D  rsvd                          8a                                                            
     **                                                                                             
     D JrnKeyEnt1      Ds                  Based( pKeyEnt1 )  Qualified                             
     D  RcvName                      10a                                                            
     D  RcvLib                       10a                                                            
     D  RcvNbr                        5a                                                            
     D  RcvAtcdTime                  13a                                                            
     D  RcvStatus                     1a                                                            
     D  RcvSavdTime                  13a                                                            
     D  LclJrnSys                     8a                                                            
     D  SrcJrnSys                     8a                                                            
     D  RcvSize                      10i 0                                                          
     D  rsvd                         56a                                                            
     **                                                                                             
     D JrnInfRtv       Ds                  Qualified                                                
     D  NbrVarRcd                    10i 0 Inz( 1 )                                                 
     D  VarRcdLen                    10i 0 Inz( 12 )                                                
     D  Key                          10i 0 Inz( 1 )                                                 
     D  DataLen                      10i 0 Inz( 0 )                                                 
     **                                                                                             
     D RtvJrnInf       Pr                  ExtProc( 'QjoRetrieveJournal-                            
     D                                     Information' )                                           
     D  RcvVar                    65535a   Options( *VarSize )                                      
     D  RcvVarLen                    10i 0 Const                                                    
     D  JrnName                      20a   Const                                                    
     D  FmtName                       8a   Const                                                    
     D  InfToRtv                  65535a   Const Options( *VarSize )                                
     D  Error                     32767a         Options( *VarSize: *Omit )                         
     **                                                                                             
     D  JrnNameLib     s             20a                                                            
     **                                                                                             
      /Free                                                                                         
                                                                                                    
             *inLR = *on;                                                                           
                                                                                                    
             ApiRcvSiz = 65535;                                                                     
             pJrnInf   = %Alloc( ApiRcvSiz );                                                       
             RJRN0100.ByteAvail = *Zero;                                                            
                                                                                                    
             JrnNameLib = JRN + LIB;                                                                
                                                                                                    
             DoU  RJRN0100.ByteAvail <= ApiRcvSiz  or                                               
                  ERRC0100.ByteAvail  > *Zero;                                                      
                                                                                                    
               If  RJRN0100.ByteAvail > ApiRcvSiz;                                                  
                 ApiRcvSiz  = RJRN0100.ByteAvail;                                                   
                 pJrnInf    = %ReAlloc( pJrnInf: ApiRcvSiz );                                       
               EndIf;                                                                               
                                                                                                    
               RtvJrnInf( RJRN0100                                                                  
                        : ApiRcvSiz                                                                 
                        : JrnNameLib                                                                
                        : 'RJRN0100'                                                                
                        : JrnInfRtv                                                                 
                        : ERRC0100                                                                  
                         );                                                                         
              EndDo;                                                                                
                                                                                                    
              If  ERRC0100.ByteAvail = *Zero;                                                       
                                                                                                    
                pJrnKey = pJrnInf                                                                   
                        + RJRN0100.OfsKeyInf + %Size( RJRN0100.NbrKey );                            
                pKeyHdr1 = pJrnKey  + JrnKey.OfsKeyInf;                                             
                pKeyEnt1 = pKeyHdr1 + %Size( JrnKeyHdr1 );                                          
                                                                                                    
                For  i = 1  to JrnKey.Entries;                                                      
                                                                                                    
                    dsply JrnKeyEnt1.RcvName ;                                                      
                    dsply JrnKeyEnt1.RcvLib ;                                                       
                    dsply %subst(JrnKeyEnt1.RcvAtcdTime:2:6) ;                                      
                                                                                                    
                  If  i < JrnKey.Entries;                                                           
                    pKeyEnt1 = pKeyEnt1 + JrnKey.EntriyLen;                                         
                  EndIf;                                                                            
                EndFor;                                                                             
                                                                                                    
              EndIf;                                                                                
                                                                                                    
              Dealloc pJrnInf ;                                                                     
                                                                                                    
              return;                                                                               
                                                                                                    
      /End-Free

こんなかんじの実行結果になります。

[Top Pageに戻る]

Ads by TOK2