|
neat stuff! The program is a great example of blending RPG and MI. -Steve -----Original Message----- From: mi400-bounces@xxxxxxxxxxxx [mailto:mi400-bounces@xxxxxxxxxxxx]On Behalf Of Howard Norcross Sent: Friday, January 21, 2005 11:11 AM To: MI Programming on the AS400 / iSeries Subject: RE: [MI400] Query object - retrieving spooled output details Hi Carsten, Thank you for the quick and perfect reply! This has answered the question exactly, I'm impressed! Regards, Howard -----Original Message----- From: mi400-bounces@xxxxxxxxxxxx [mailto:mi400-bounces@xxxxxxxxxxxx] On Behalf Of Carsten Flensburg Sent: 21 January 2005 15:55 To: MI Programming on the AS400 / iSeries Subject: Re: [MI400] Query object - retrieving spooled output details Hello Howard, - Here's the Retrieve Query Information source that the EXTQRYDFN utility was based on - it has a little more details: **-- nfo: -------------------------------------------------------------** ** ** The *PSSR subroutine could be modified to more elegantly inform ** the caller about the actual exception that occurred. ** ** It is up to you to add parameters to return the information you ** are interested in to the program's parameter list and subsequently ** add code to move the relevant subfields to these parameters. ** **-- eader: -----------------------------------------------------------** H DftActGrp( *No ) BndDir( 'QC2LE' ) **-- MI unctions: -----------------------------------------------------** D rslvsp Pr * ProcPtr ExtProc( 'rslvsp' ) D ObjTyp 2a Value D ObjNam * Value Options( *String ) D ObjLib * Value Options( *String ) D AutReq 2a Value ** D setsppfp Pr * ExtProc( 'setsppfp' ) D Object * Value ProcPtr ** D setsppo Pr * ExtProc( 'setsppo' ) D SpcPtr * Value D Offset 10i 0 Value ** D MemCpy Pr * ExtProc( 'memcpy' ) D pOutMem * Value D pInpMem * Value D iMemSiz 10u 0 Value **-- Query outfile pecification: --------------------------------------** D QiOutFil Ds D OfDtaLen 10i 0 Inz D OfFilNam 10a D 5i 0 Inz D OfLibNam 10a D 5i 0 D OfMbrNam 10a D 5i 0 D OfDtaOpt 1a D 3i 0 D OfFilAut 10a **-- Query inputfile(s) pecification: ---------------------------------** D QiInpFil Ds D IfNbrFil 5i 0 Inz D IfFilInf 80a Dim( 32 ) D 5i 0 Overlay( IfFilInf: 1 ) D IfFilNam 10a Overlay( IfFilInf: 3 ) D 5i 0 Overlay( IfFilInf: 13 ) D IfLibNam 10a Overlay( IfFilInf: 15 ) D 5i 0 Overlay( IfFilInf: 25 ) D IfMbrNam 10a Overlay( IfFilInf: 27 ) D 5i 0 Overlay( IfFilInf: 37 ) D IfRcdNam 10a Overlay( IfFilInf: 39 ) D 5i 0 Overlay( IfFilInf: 49 ) D IfFilId 4a Overlay( IfFilInf: 51 ) D 5i 0 Overlay( IfFilInf: 55 ) D IfRcdId 13a Overlay( IfFilInf: 57 ) D 11a Overlay( IfFilInf: 70 ) **-- Query printed output pecifications: ------------------------------** D QiOutWtr Ds D OwDtaLen 10i 0 Inz D OwWtrNam 10a D 26a D OwPprLen 5i 0 D OwPprWdt 5i 0 D 5i 0 D 5i 0 D 5i 0 D OwFrmTyp 10a D 12a D OwPrtLin1 5i 0 D OwPrtLinLst 5i 0 D OwPrtLinDst 5i 0 D Owx90 3i 0 D OwPrtDfn 3i 0 ** D QiRptHdr Ds D RhHdrLen 10i 0 Inz D 10i 0 D 10i 0 D RhNbrLin 5i 0 D RhLinLen 5i 0 D RhDta 320a ** D QiPagHdr Ds D PhHdrLen 10i 0 Inz D 10i 0 D 10i 0 D PhNbrLin 5i 0 D PhLinLen 5i 0 D PhDta 240a ** D QiPagTrl Ds D PtTrlLen 10i 0 Inz D 10i 0 D 10i 0 D PtNbrLin 5i 0 D PtLinLen 5i 0 D PtDta 80a **-- Query selection riterias: ----------------------------------------** D QiSelCriHdr Ds D ScTotLen 10i 0 Inz D 10i 0 D 10i 0 D 10i 0 D ScNbrCri 5i 0 ** D QiSelCriDtl Ds D ScCriLen 5i 0 Inz D 10i 0 D 10i 0 D ScCriRelN 10i 0 D ScCriRel 1a Overlay( ScCriRelN: 4 ) D ScCriArg1 14a D ScCriOpr 2a D ScCriArg2Lin 5i 0 D ScCriArg2Dta 4096a ** D QiSelCriArg2 Ds Based( pArg2 ) D ScCriArg2Len 5i 0 D ScCriArg2 512a ** Formatted selection criterias: D SelCri Ds D SelTxt 55a Dim( 256 ) D SelRel 3a Overlay( SelTxt: 1 ) D SelArg1 14a Overlay( SelTxt: 5 ) D SelOpr 5a Overlay( SelTxt: 20 ) D SelArg2 30a Overlay( SelTxt: 26 ) ** D Opr Ds D Opr1 14a Inz('INLKNKNSNSNTBT') D Opr2 35a Inz('LIST LIKE NLIKENLISTISNOTRANGE') D OprMnm 2a Dim( 7 ) Overlay( Opr1 ) D OprTxt 5a Dim( 7 ) Overlay( Opr2 ) **-- Global ariables: -------------------------------------------------** D pQryObj s * ProcPtr D pQryTpl s * D QryTpl s 32767a Based( pQryTpl ) ** D Int s 10i 0 D Idx s 5i 0 D Lin s 5i 0 D OutOpt s 1a **-- arameters: -------------------------------------------------------** D PxQryNam s 10a D PxQryLib s 10a ** C *Entry Plist C Parm PxQryNam C Parm PxQryLib ** **-- ainline: ---------------------------------------------------------** ** C Eval pQryObj = rslvsp( x'1911' C : %TrimR( PxQryNam ) C : %TrimR( PxQryLib ) C : x'0000' C ) ** c Eval pQryTpl = setsppfp( pQryObj ) ** c Eval pQryTpl = setsppo( pQryTpl: 260 ) C CallP MemCpy( %Addr( OutOpt ) C : pQryTpl C : %Size( OutOpt ) C ) ** C If OutOpt = '3' C Eval OfFilNam = '*DFT' C Eval OfLibNam = '*PRV' C Eval OfDtaLen = 25 C EndIf ** c Eval pQryTpl = setsppo( pQryTpl: 380 ) C CallP MemCpy( %Addr( Int ) C : pQryTpl C : %Size( Int ) C ) ** C If Int > 0 c Eval pQryTpl = setsppo( pQryTpl: Int ) C CallP MemCpy( %Addr( QiOutFil ) C : pQryTpl C : %Size( QiOutFil ) C ) C EndIf ** c Eval pQryTpl = setsppo( pQryTpl: 396 ) C CallP MemCpy( %Addr( Int ) C : pQryTpl C : %Size( Int ) C ) ** C If Int > 0 c Eval pQryTpl = setsppo( pQryTpl: Int ) C CallP MemCpy( %Addr( QiOutWtr ) C : pQryTpl C : %Size( QiOutWtr ) C ) C EndIf ** C Eval pQryTpl = setsppo( pQryTpl: x'019C' ) C CallP MemCpy( %Addr( Int ) C : pQryTpl C : %Size( Int ) C ) ** C If Int > 0 c Eval pQryTpl = setsppo( pQryTpl: Int ) C CallP MemCpy( %Addr( QiRptHdr ) C : pQryTpl C : %Size( QiRptHdr ) C ) C EndIf ** c Eval pQryTpl = setsppo( pQryTpl: x'01AC' ) C CallP MemCpy( %Addr( Int ) C : pQryTpl C : %Size( Int ) C ) ** C If Int > 0 c Eval pQryTpl = setsppo( pQryTpl: Int ) C CallP MemCpy( %Addr( QiPagHdr ) C : pQryTpl C : %Size( QiPagHdr ) C ) C EndIf ** c Eval pQryTpl = setsppo( pQryTpl: x'01BC' ) C CallP MemCpy( %Addr( Int ) C : pQryTpl C : %Size( Int ) C ) ** C If Int > 0 c Eval pQryTpl = setsppo( pQryTpl: Int ) C CallP MemCpy( %Addr( QiPagTrl ) C : pQryTpl C : %Size( QiPagTrl ) C ) C EndIf ** C Eval pQryTpl = setsppo( pQryTpl: 558 ) C CallP MemCpy( %Addr( IfNbrFil ) C : pQryTpl C : %Size( IfNbrFil ) C ) ** C Eval pQryTpl = setsppo( pQryTpl: 560 ) ** C For Idx = 1 To IfNbrFil C CallP MemCpy( %Addr( IfFilInf( Idx )) C : pQryTpl C : %Size( IfFilInf ) C ) ** C Eval pQryTpl = pQryTpl + %Size( IfFilInf ) C EndFor ** C Eval pQryTpl = setsppo( pQryTpl: x'5C' ) C CallP MemCpy( %Addr( Int ) C : pQryTpl C : %Size( Int ) C ) ** C If Int > 0 C Eval pQryTpl = setsppo( pQryTpl: Int ) C CallP MemCpy( %Addr( QiSelCriHdr ) C : pQryTpl C : %Size( QiSelCriHdr ) C ) ** C Eval pQryTpl = pQryTpl + %Size( QiSelCriHdr ) ** C Eval Lin = *Zero ** C Do ScNbrCri C CallP MemCpy( %Addr( QiSelCriDtl ) C : pQryTpl C : %Size( QiSelCriDtl ) C ) ** C Eval pArg2 = %Addr( ScCriArg2Dta ) C Eval Lin = Lin + 1 ** C If ScCriRel = x'80' C Eval SelRel(Lin) = 'OR ' C Else C Eval SelRel(Lin) = 'AND' C EndIf C Eval SelArg1(Lin) = ScCriArg1 C Eval SelOpr(Lin) = ScCriOpr ** C For Idx = 1 To ScCriArg2Lin C Eval SelArg2(Lin) = %SubSt( ScCriArg2 C : 1 C : ScCriArg2Len C ) ** C If Idx < ScCriArg2Lin C Eval Lin = Lin + 1 C Eval pArg2 = pArg2 + ScCriArg2Len + 2 C EndIf C EndFor ** C Eval pQryTpl = pQryTpl + ScCriLen C EndDo C EndIf ** C Eval *InLr = *On ** C *Pssr BegSr ** C Return ** C EndSr - I hope that'll make it work for you - otherwise let me know! Best regards, Carsten Flensburg ----- Original Message ----- From: "Howard Norcross" <howard.norcross@xxxxxxxxxxxxxxxxxxxxx> To: <mi400@xxxxxxxxxxxx> Sent: Friday, January 21, 2005 4:44 PM Subject: [MI400] Query object - retrieving spooled output details Hi, Hi all. I'm a newbie to the list, newbie to MI but know the iSeries and its ancestors back to 1984... I'm using a reworked version of a Carsten Flensburg program (See <http://archive.midrange.com/repository/extqrydef.htm>) to get details of the spooled output from queries. I don't know what to do in the code sections shown below to access the correct part of the object, i.e. the one which will get me the output queue, formtype, etc. These are the D-specs for the section I need to populate with data from the query object: **-- Query printed output specifications: D QiOutWtr Ds D OwDtaLen 10i 0 Inz D OwWtrNam 10a D 26a D OwPprLen 5i 0 D OwPprWdt 5i 0 D 5i 0 D 5i 0 D 5i 0 D OwFrmTyp 10a D 12a D OwPrtLin1 5i 0 D OwPrtLinLst 5i 0 D OwPrtLinDst 5i 0 D Ow1 5i 0 D Ow2 5i 0 And these are the C-specs I've added - xXx in the setsppo function denotes an offset value which I can't discover anywhere :( c Eval pQryTpl = setsppo( pQryTpl: xXx ) C CallP MemCpy( %Addr( QiOutWtr ) C : pQryTpl C : %Size( QiOutWtr ) C ) c move Owdtalen dtalen c move Owwtrnam wtrnam c move Owfrmtyp frmtyp Can someone point me in the right direction please? Thanks, Howard Norcross Senior A/P Charles Stanley Stockbrokers, London. ------------------------------------------------------------------------ ---- ---------------------------------------- The information contained in this e-mail is strictly confidential, some or all of which may be legally privileged. It is for the intended recipient only. Access to this e-mail by any other person is prohibited. If you are not the intended recipient, any use, disclosure, copying, printing, distribution of, replying to or any action taken or omitted to be taken in reliance on this e-mail, is prohibited and may be unlawful. Please contact the sender immediately should this e-mail have been incorrectly addressed or transmitted. You accept that any instructions are deemed to have been given at the time the recipient(s) accesses them and that delivery receipt does not constitute acknowledgement or receipt by the intended recipient(s). You accept that there may be a delay in processing the instructions received from e-mails after Charles Stanley has received them. You are advised that urgent, time sensitive and confidential communications should not be sent by e-mail. You acknowledge that e-mails are not secure and you accept the risk of malfunction, viruses, unauthorised interference, mis-delivery or delay. ************************************************************************ ** Registered Office: 25 Luke Street London EC2A 4AR Tel: 0207 739 8200 Fax: 0207 739 7798 Registered in England No. 1903304 Authorised and Regulated by the Financial Services Authority, Member of the London Stock Exchange, Member of The London International Financial Futures and Options Exchange. This footnote also confirms that this email message has been swept by McAfee VirusScan and SurfControl Email Filter software. _______________________________________________ This is the MI Programming on the AS400 / iSeries (MI400) mailing list To post a message email: MI400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/mi400 or email: MI400-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/mi400. ########################################### This message has been scanned by F-Secure Anti-Virus for Internet Mail. For more information, connect to http://www.F-Secure.com/ _______________________________________________ This is the MI Programming on the AS400 / iSeries (MI400) mailing list To post a message email: MI400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/mi400 or email: MI400-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/mi400. ---------------------------------------------------------------------------- ---------------------------------------- The information contained in this e-mail is strictly confidential, some or all of which may be legally privileged. It is for the intended recipient only. Access to this e-mail by any other person is prohibited. If you are not the intended recipient, any use, disclosure, copying, printing, distribution of, replying to or any action taken or omitted to be taken in reliance on this e-mail, is prohibited and may be unlawful. Please contact the sender immediately should this e-mail have been incorrectly addressed or transmitted. You accept that any instructions are deemed to have been given at the time the recipient(s) accesses them and that delivery receipt does not constitute acknowledgement or receipt by the intended recipient(s). You accept that there may be a delay in processing the instructions received from e-mails after Charles Stanley has received them. You are advised that urgent, time sensitive and confidential communications should not be sent by e-mail. You acknowledge that e-mails are not secure and you accept the risk of malfunction, viruses, unauthorised interference, mis-delivery or delay. ************************************************************************** Registered Office: 25 Luke Street London EC2A 4AR Tel: 0207 739 8200 Fax: 0207 739 7798 Registered in England No. 1903304 Authorised and Regulated by the Financial Services Authority, Member of the London Stock Exchange, Member of The London International Financial Futures and Options Exchange. This footnote also confirms that this email message has been swept by McAfee VirusScan and SurfControl Email Filter software. _______________________________________________ This is the MI Programming on the AS400 / iSeries (MI400) mailing list To post a message email: MI400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/mi400 or email: MI400-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/mi400.
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.