Skip to content

ZosServer

The ZosServer object represents a single connection to a server. This object can be obtained using the Servers property of ZosNetwork or the Item property of ZosServers.

Normally, there is only one user ID logged on to the each server from the desktop at a time. However, in a server application, there may be a requirement to have more than one user ID logged onto the same server at the same time. You can accomplish this by using alternate connections to the server. Each server can have alternate connections, with connection IDs numbered 1 – 255. The default connection has a connection ID of 0.

The Connection property of the ZosServer object contains the connection ID. The Connection property is read-only and you must create a new ZosServer object to change the connection ID.

There are two ways to create a ZosServer object with an alternate connection ID:

  • Specify a connection ID when using the Item property of ZosServers.
  • Call the NewConnection method of ZosServer to create a new server object with a different connection ID.

    For more information on alternate connections, see the section entitled "Alternate Connections" on page 34.

ZossServer Properties

ZosServer exposes the following properties:

Property Type R/W Description
Name String R Name of the server.
Connection Int16 R Connection ID (default connection is 0)
Path String R File system path name for server.
Description String R/W Server description (volume label).
Address String R/W I/P address or DNS name.
Port Int32 R/W I/P port number.
Secure Boolean? R/W Enables TLS security for all ports on this server, including ChangeMan ports.
HostCodePage Int32 R/W Server EBCDIC code page
PasswordPhrase Boolean R/W Indicates whether password phrases (long passwords) are allowed.
DisablePort Boolean R/W Disables XCH port. If the port is disabled, the “DataSets”, “Jobs”, and “Unix” folders are hidden and unavailable.
MaxSessions Int32 R/W Maximum number of concurrent sessions.
UtcOffset TimeSpan R Time zone offset from UTC. UTC + UtcOffset = Local
Today DateTime R Current date on the server.
User String R User ID of currently logged on user.
Groups String[] R Array of security group names to which the currently logged on user is connected. (requires SerNet 7.1.3+)
DataSetFolders ZosDataSetFolders R Collection of toplevel data set folders for server.
JobFolders ZosJobFolders R Collection of toplevel job folders for server.
UnixFolders ZosUnixFolders R Collection of Unix folders for server.
UnixRootDirectory ZosUnixDirectory R Root directory for the Unix file system.
ChangeManInstances ZosChangeManInstances R Collection of all ChangeMan instances for server.
DataSetFileFormatMappi ngs ZosFileFormatMappings R Collection of data set file format mappings for server.
UnixFileFormatMappings ZosFileFormatMappings R Collection of Unix file format mappings for server. This property is available for version 7.1+ servers only.
LibTypeMappings ZosLibTypeMappings R Collection of all library type mappings for server.
FileExtensionMappings ZosFileExtensionMappings R Collection of all file-extension mappings for server.
DataSetProfiles ZosDataSetProfiles R Collection of all data set profiles for server.
IsHidden Boolean R/W Indicates that this server is hidden in the File Explorer and the ZDD user interface. This is a user-specific setting.

...

ZosServer Methods

ZosServer exposes the following methods:

GetDataSet Method

Gets a data set by name.

ZosDataSet  GetDataSet(  
        String dsName  
    ) 

...

GetJesJob Method

Gets a JES job by its fully qualified name in the following form: **jobname.jobid

Overrides

GetJesJob(String)

ZosJesJob  GetJesJob(  
        String fullname     
        ) 

...

GetJesJob(String, String)

Gets a JES job by job name and job ID.

ZosJesJob  GetJesJob(  
        String jobname,  
        String jobid  
        )

...

GetUnixObject Method

Gets a Unix directory, file, or symbolic link object, given the Unix path name.

ZosUnixObject  GetUnixObject(  
        String path  
        ) 

...

Logoff Method

Logoff from server.

void  Logoff() 

Logon Method

Logon to server.

void Logon(  
        String userID, [optional]  
        String password, [optional]  
        String newPassword [optional] 
        ) 

NewConnection Method

Create a new server object for the same server, but with a different connection ID. The connection ID must be 0 – 255.

ZosServer  NewConnection( Int16 connection ) 

NotifyChange Method

Notifies file system driver that a data set or member has been created or deleted by an external process.

void  NotifyChange(  
        String dsName,  
        String memberName [optional]    
        ) 

SubmitJcl Method

Submits JCL to the server. This routine returns an array of ZosJesJob objects representing the submitted jobs. A single JCL file can contain multiple jobs. The job IDs can be obtained from the JobID property of the ZosJesJob object. The notify argument is optional. Specify true to add a notify job step to the submitted JCL. A notify job step will send you a message indicating the highest return code for the job.

ZosJesJob[]  SubmitJcl(  
        String fileName,  
        Boolean notify [optional] 
        ) 

SubmitXml Method

Submit XML request to server. Must be a SerNet XML service, rather than a ChangeMan XML service.

void  SubmitXml(  
        String inputFileName,  
        String outputFileName  )

...

ZosServer Examples

C

ZosServer server;
String userID = server.User;
server.Address = “192.11.23.66”;
server.Logon(“USR001”, “password”);
server.NotifyChange(“USR001.NEW.DATA”, “MEMBER1”);
server.SubmitJcl(“C:\\JCL\\Print.jcl”);

...

C++

ZosServer^ server;
String^ userID = server->User;
Server->Address = “192.11.23.66”;
Server->Logon(“USR001”, “password”);
Server->NotifyChange(“USR001.NEW.DATA”, “MEMBER1”);
Server->SubmitJcl(“C:\\JCL\\Print.jcl”);

...

Visual Basic

Dim server As ZosServer
Dim userID As String server.User
server.Address = “192.11.23.66”
server.Logon(“USR001”, “password”)
server.NotifyChange(“USR001.NEW.DATA”, “MEMBER1”)
server.SubmitJcl(“C:\JCL\Print.jcl”)

...

Jscript

var server : ZosServer;
var userID : String = server.User;
server.Address = “192.11.23.66”;
server.Logon(“USR001”, “password”);
server.NotifyChange(“USR001.NEW.DATA”, “MEMBER1”);
server.SubmitJcl(“C:\\JCL\\Print.jcl”);

...

Back to top