How to retrieve system name on which I am working in AS/400?

5 pts.
Tags:
AS/400 administration
CL Program
CL programming
How do I retrieve system name on which I am working in AS/400?

Software/Hardware used:
as/400

Answer Wiki

Thanks. We'll let you know when a new response is added.

A CL program (or module) can retrieve the system name this way:

dcl &SysName *char 10
rtvneta sysname( &SysName )

In HLLs such as RPG, the Retrieve Network Attributes (QWCRNETA) API can retrieve the same info. (The API can also be called in CL, but the RTVNETA command is easier.)

You need to be aware that the “system name” is not the same as the system’s host name. To retrieve the host name, use the gethostname() — Retrieve Host Name — API like you would on any system that runs TCP/IP.

Also be aware that a system name isn’t required to be unique. Some other identifier might be better in some cases. System serial number is an example.

Tom

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • jinteik
    wrkjob then the system name will be shown like qpadev******
    18,085 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following