|
I have used code posted recently that showed how to get the name of the attached journal receiver, (I forget who posted it, beg forgivness). I modified the code to give me the names of ALL the receivers associated with the journal and it works fine, please see below. This API has a variable length parameter by which it returns data. I use a DS (RJRN0100) to get the returned data My problem is that RPG DS have a max size of 64K bytes. In the archives I note Carsten Flensburg and others mention pointer handles. Can I use pointers to get back more than 64K bytes of data in case I have more than 512 associated receivers. Can I get the API to populate a User Space or a MODS. I have used User Spaces previously but those APIs directly populated. I have searched the archives but I am too thick to get it, any help is muchly appreciated. Frank Kolmann PS It may have been Carsten Flensberg or Jon Paris who posted the original. but in any case I have significantly changed the original and I have not been able to find any code that gave me the names of the receivers like the below does. H DFTACTGRP(*NO) ACTGRP(*CALLER) OPTIMIZE(*NONE) D RtvJrnInf PR ExtProc( 'QjoRetrieveJournal+ D Information' ) D RjRcvrVar 1 Const D Options( *VarSize ) D RjLenRcvrVar 10I 0 Const D RjQlJrnName 20 Const D RjFmtName 8 Const D RjJrnInf 1 Const D Options( *VarSize ) D RjApiErr Like( ApiErr ) D ApiErr DS D AeBytesProv 10U 0 D AeBytesRetd 10U 0 D AeMsgId 7 D 1 D AeMsgDta 256 * This DS is initialised to request that we want ALL the * receivers associated with the journal * VD Key = 1 means Journal Receiver Directory Information *JrnInfToRtv DS * JtrNumVarLenR This is 1 as I am only sending(asking) for 1 set of info * VDLen The length of this request is 16 bytes (this does not incl JtrNumVarLenR) * VDKey I am asking for the reveivers (code is 1) * VDLenDta This req passes no data but a min of 4 bytes must be specified * VDDta This is the 4 empty bytes D JrnInfToRtv DS D JtrNumVarLenR 10I 0 Inz(1) D VDLen 10U 0 Inz(16) D VDKey 10U 0 Inz(1) D VDLenDta 10U 0 Inz(4) D VDDta 4 D PrmJrnName S 10 D PrmJrnLib S 10 D DtaStr S 10U 0 D RcvDtaPos S 10U 0 D I S 10U 0 D J S 10U 0 D RJRN0100 DS 65535 D RjBytesRetd 10I 0 D RjBytesAvl 10I 0 D RjKeyOffs 10I 0 D RjJnlNam 10 D RjJnlLib 10 D RjAttachRcvrN 201 210 D RjAttachRcvrL 211 220 D Rfill1 448 448 D RjKeys 10U 0 ***** Use offsets to get to the receiver info D ApiKeys DS D RjKey 10U 0 D RjKeyOff 10U 0 D RjKeyHdrLen 10U 0 D RjKeyNumEnt 10U 0 D RjKeyEntLen 10U 0 ***** KEY 1 (Jnl Receiver data) D RcvInf DS 65535 D RjTotRcv 10U 0 D RjTotRcvSiz 10U 0 D RjTotSizMult 10U 0 D RjResrv1 8 D RcvInfDS DS D RjRcvNam 10 D RjRcvLib 10 D RjRcvNbr 5 D RjRcvAttDte 13 D RjRcvSts 1 D RjRcvSavDte 13 D RjRcvLclSys 8 D RjRcvSrcSys 8 D RjRcvSiz 10U 0 D RjResrv2 56 C *Entry Plist C Parm PrmJrnName C Parm PrmJrnLib /Free *INLR = *On; // Initialize bytes provided in two data structures AeBytesProv = %Size( ApiErr ); RjBytesAvl = %Size( RJRN0100 ); // Invoke the QjoRetrieveJournal API CallP RtvJrnInf( RJRN0100: %Size( RJRN0100 ): PrmJrnName + PrmJrnLib: 'RJRN0100': JrnInfToRtv: ApiErr ); // Following the above CallP, if AeBytesRetd = *Zero, then // RjAttachedRcvrName contains the attached receiver name and // RjAttachedRcvrLib contains the attached receiver library name RjAttachRcvrN = RjAttachRcvrN; RjAttachRcvrL = RjAttachRcvrL; DtaStr = RjKeyOffs + 5; //Key data actually starts from RjKeys on // Now we are going to get all the receiver names for j = 1 to RjKeys; ApiKeys = %subst(RJRN0100 : DtaStr :%len(ApiKeys)); If RjKey = 1; // Process Receiver Info ExSR GetRcvNam; EndIf; endfor; BegSR GetRcvNam; RcvInf = %subst(RJRN0100 : DtaStr+RjKeyOff ); RcvDtaPos = DtaStr + RjKeyOff + RjKeyHdrLen- RjKeyEntLen; for j = 1 to RjKeyNumEnt; RcvDtaPos = RcvDtaPos + RjKeyEntLen; RcvInfDS = %subst(RJRN0100 : RcvDtaPos); // Here we have the name of each Receiver in turn in RjRcvNam endfor; EndSR; /end-free ****************** END OF DATA *************************************************
As an Amazon Associate we earn from qualifying purchases.
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.