Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Retrieving AS400 system name within RPG ILE program

1,147 views
Skip to first unread message

eli

unread,
Dec 20, 2001, 9:04:27 AM12/20/01
to
Hello to all AS400 skilled people !

My question is:

"How I can retrieve this AS400 system name within RPG ILE program ( I don't
want to call CL procedure
which issues RTVNETA command )?"

Any help will be greatly appreciatrd ...

Thanks in advance

ELI


Carsten Flensburg

unread,
Dec 20, 2001, 9:32:40 AM12/20/01
to
Hello Eli,

Call the QWCRNETA API.

Best regards,
Carsten Flensburg

"eli" <e...@bsafesolutions.com> skrev i en meddelelse
news:3c21...@news.bezeqint.net...

Thomas Raddatz

unread,
Dec 20, 2001, 1:56:13 PM12/20/01
to eli
You may do it this way:

*
* Display local location name
C Eval $$SYSTEM = f_rtvNetAtrA('LCLLOCNAME')
*

*
H EXTBININT(*YES)
*

*=========================================================================
* Retrieve aplha-numeric System
Value.
*=========================================================================
*
P f_rtvNetAtrA...
P B export
*
D f_rtvNetAtrA...
D PI
128A
D i_netAtrName 10A value
*
* return value
D netAtrA S 128A inz
*
* some fields
D rcvVar S inz like(netAtrA )
D rcvVarLen S 10I 0 inz(%size(rcvVar))
D numNetAtr S 10I 0 inz(1)
D errCode E DS extname(xdErrCode)
D prefix(errCode_)
D inz
*
D dataRet DS based(pDataRet)
D dataRet_numNetAtr...
D 10I 0
D dataRet_ofsInfTbl...
D 10I 0
*
D infTbl DS based(pInfTbl )
D infTbl_netAtrName...
D 10A
D infTbl_dataType...
D 1A
D
infTbl_infSts...
D 1A
D infTbl_dataLen...
D 10I 0
D infTbl_data...
D like(netAtrA )
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*
C Call 'QWCRNETA'
C Parm rcvVar
C Parm rcvVarLen
C Parm numNetAtr
C Parm i_netAtrName
C Parm errCode
*
C Eval pDataRet = %addr(rcvVar)
C Eval pInfTbl = %addr(rcvVar) + dataRet_ofsInfTbl
*
C If (infTbl_dataType = 'C') and
C (infTbl_infSts <>'L')
C Eval netAtrA = %subst(infTbl_data: 1:
C infTbl_dataLen)
C Else
C Eval netAtrA = '*ERROR'
C Endif

*
C return netAtrA
*
P f_rtvNetAtrA...
P E


*
A R FXDERRCODE TEXT('API error code')
*
A BYTPRV 9B 0 TEXT('Bytes Provided ')
A BYTAVL 9B 0 TEXT('Bytes Available')
A EXCID 7A TEXT('Exception ID ')
A RES01 1A TEXT('Reserved ')
A EXCDTA 256A TEXT('Exception Data ')
*

You can search the Information Center for "QWCRNETA" to get a complete list of
keywords.

Thomas Raddatz.


eli schrieb:

--
*=====================================================*

e-mail Adresse:
Thomas....@tools400.de

Homepage:
http://www.tools400.de

*=====================================================*

0 new messages