|
This is one I managed to save. Thanks Bruce!! Bryan Dietz 3X Corp. ============ Previously in Midrange-L ============================= The Retrieve Network Attributes (QWCRNETA) API will do this. Here is an "as-is" sample of using the API to access the system name. The sample does assume you have OS/400 option 13 (QSYSINC - Openness includes) installed. Bruce Vining I/COPY QSYSINC/QRPGSRC,QWCRNETA I/COPY QSYSINC/QRPGSRC,QUSEC I* Declare the receiver variable IRCV DS 256 I B 1 40NUMBER I B 5 80OFF1 I* Declare the size of receiver, number of network attributes to I* retrieve, and the attribute to retrieve (respectively) IMISC DS I I 256 B 1 40RCVSIZ I I 1 B 5 80NBR I I 'SYSNAME' 9 18 NETA C* Set error reporting to exception mode C Z-ADD0 QUSBNB C* Call Retrieve Network Attributes API C CALL 'QWCRNETA' C PARM RCV C PARM RCVSIZ C PARM NBR C PARM NETA C PARM QUSBN C* If we got here, then no exception took place C NUMBER IFEQ 1 C* So, adjust the offset from base 0 to RPGs base 1 C OFF1 ADD 1 OFF 30 C* Get the header information for the network attribute C 16 SUBSTRCV:OFF QWCBV C* Adjust OFF to address the returned value C ADD 16 OFF C* Check for system name being returned C QWCBVB IFEQ 'SYSNAME' C* Blank out any residual data from SYSNAM C MOVE *BLANKS SYSNAM 8 C* Get the returned value C QWCBVF SUBSTRCV:OFF SYSNAM C* Display the system name C SYSNAM DSPLY C END C END C* And get out C MOVE '1' *INLR C RETRN "Ron Hudson" <roxrhud@colaik.com> on 11/13/98 10:09:39 AM Please respond to MIDRANGE-L@midrange.com To: MIDRANGE-L@midrange.com cc: (bcc: Bryan Dietz/Columbus/3X Corp) Subject: Retreiving System ID within RPG Is there any way to retreive the System ID from within a RPG program without passing it as a parm or calling QCMDEXEC to retreive. Ron Hudson Ron.Hudson@colaik.com +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.