× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: QUSRSPLA API
  • From: alan shore <SHOREA@xxxxxxxx>
  • Date: Fri, 02 Oct 1998 12:08:29 -0400

Bruce - I cannot tell you how grateful I am by you taking the time to create 
the example. This highlighted the two stupid problems I had made. Much 
appreciated. Thanks

>>> <bvining@VNET.IBM.COM> 10/02 9:52 AM >>>
Though nothing fancy the following works for me:

     I* Define a Receiver Variable large enough to handle variable
     I* length fields at end of fixed structure.  Then copy in the
     I* pertinent elements from QSYSINC/QRPGSRC(QUSRSPLA).  Note that
     I* the RCVVAR is defined as 4096 bytes in size.
     IRCVVAR      DS                           4096
     I*                                             Qus SPLA0100
     I                                    B114511480QUSF01
     I*                                             Usr Def Options Offset
     I                                    B114911520QUSF02
     I*                                             Usr Def Options Number
     I                                    B115311560QUSF03
     I*                                             Usr Def Options Entry Length
     I* Miscellaneous declares for Binary values
     IMISC        DS
     I I            4096                  B   1   40RCVSIZ
     I I            -1                    B   5   80SPLNUM
     I I            0                     B   9  120ECBP
     C* Call API getting last spooled QSYSPRT file
     C                     CALL 'QUSRSPLA'
     C                     PARM           RCVVAR
     C                     PARM           RCVSIZ
     C                     PARM 'SPLA0100'FORMAT  8
     C                     PARM '*'       JOBNAM 26
     C                     PARM *BLANKS   JOBINT 16
     C                     PARM *BLANKS   SPLINT 16
     C                     PARM 'QSYSPRT 'SPLFNM 10
     C                     PARM           SPLNUM
     C                     PARM           ECBP
     C* Check if any user options returned
     C           QUSF02    IFGT 0
     C* If so, process them
     C* First add one to the offset as RPG is base 1 and APIs are base 0
     C           QUSF01    ADD  1         X       90
     C                     DO   QUSF02
     C* Get the value
     C           10        SUBSTRCVVAR:X  USROPT 10
     C* Display the value
     C           USROPT    DSPLY
     C* Add the size of each entry to get the next entry
     C                     ADD  QUSF03    X
     C                     ENDDO
     C                     ENDIF
     C* All done
     C                     MOVE '1'       *INLR
     C                     RETRN

Bruce Vining

>
>Bruce - thanks for the information. I did find that info in the online
>V3R7 System API Reference, but when I attempted to use it, I found that
>the Offset to user-defined option (decimal offset 1144) = Number of user
>defined option returned (decimal offset 1148) = Length of user-defined
>option entry (decimal offset 1144) = 77952576, whether or not the spool
>file  contained any entries to the user defined options within the spool
>file attributes.  Again if anybody knows how to do this - or may guess
>what I am doing wrong, help is appreciated.
>

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List!  To submit a new         *
* message, send your mail to "RPG400-L@midrange.com".  To unsubscribe   *
* from this list send email to MAJORDOMO@midrange.com and specify       *
* 'unsubscribe RPG400-L' in the body of your message.  Questions should *
* be directed to the list owner / operator: david@midrange.com          *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                   
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List!  To submit a new         *
* message, send your mail to "RPG400-L@midrange.com".  To unsubscribe   *
* from this list send email to MAJORDOMO@midrange.com and specify       *
* 'unsubscribe RPG400-L' in the body of your message.  Questions should *
* be directed to the list owner / operator: david@midrange.com          *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.