ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahz_5.4.0.1/svrrun.htm

138 lines
3.7 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content=
"text/html; charset=utf-8">
<title>Example: Creating and running the server program</title>
<LINK rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</HEAD>
<body bgcolor="#FFFFFF">
<!-- Java sync-link -->
<SCRIPT LANGUAGE="Javascript" SRC="../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
<h2>Example: Creating and running the server program</h2>
<strong>Creating the server program</strong> The following example
shows how to create the server program on i5/OS<SUP>(TM)</SUP>. The example
assumes that the source for the server program is in member SERVER
in the file QGPL/QCSRC. The server program is owned by a special
user profile QSHSVR that has minimal authorities but private
authority to the QSYGETPH(), QSYRLSPH(), and QWTSETP() APIs. It is
not possible to sign on using the QSHSVR user profile. The server
program adopts the authority of QSHSVR so it can switch to the
client's user profile.
<pre>
CRTBNDC PGM(QGPL/SERVER)
SRCFILE(QGPL/QCSRC)
SRCMBR(SERVER)
OPTIMIZE(40)
SYSIFCOPT(*IFSIO)
LOCALETYPE(*LOCALE)
USRPRF(*OWNER)
AUT(*USE)
TEXT('Shell server')
CRTUSRPRF USRPRF(QSHSVR)
PASSWORD(*NONE)
USRCLS(*USER)
TEXT('Shell server profile')
CHGOBJOWN OBJ(QGPL/SERVER)
OBJTYPE(*PGM)
NEWOWN(QSHSVR)
GRTOBJAUT OBJ(QSYS/QSYGETPH)
OBJTYPE(*PGM)
USER(QSHSVR)
AUT(*USE)
GRTOBJAUT OBJ(QSYS/QSYRLSPH)
OBJTYPE(*PGM)
USER(QSHSVR)
AUT(*USE)
GRTOBJAUT OBJ(QSYS/QWTSETP)
OBJTYPE(*PGM)
USER(QSHSVR)
AUT(*USE)
</pre>
<!--<table width="480"><tr><td>--><strong>Running the server
program</strong> You may want to run the server program and any
child processes started by the server in their own subsystem. The
following example shows how to create the following objects:
<ul>
<li>A subsystem description and related routing entry and prestart
job entries for both non-threaded and multi-thread capable
jobs.</li>
<li>A class.</li>
<li>A job description.</li>
<li>A job queue.</li>
</ul>
<!--</td></tr></table>-->
<pre>
CRTSBSD SBSD(QGPL/SHELL)
POOLS((1 *BASE))
AUT(*USE)
TEXT('Shell server subsystem')
CRTCLS CLS(QGPL/SHELL)
RUNPTY(20)
TIMESLICE(2000)
DFTWAIT(30)
AUT(*USE)
TEXT('Shell server class')
CRTJOBQ JOBQ(QGPL/SHELL)
AUTCHK(*DTAAUT)
AUT(*USE)
TEXT('Shell server job queue')
CRTJOBD JOBD(QGPL/SHELL)
JOBQ(QGPL/SHELL)
AUT(*USE)
TEXT('Shell server job description')
ADDJOBQE SBSD(QGPL/SHELL)
JOBQ(QGPL/SHELL)
MAXACT(*NOMAX)
ADDRTGE SBSD(QGPL/SHELL)
SEQNBR(1)
CMPVAL(*ANY)
PGM(*LIBL/QCMD)
ADDPJE SBSD(QGPL/SHELL)
PGM(QSYS/QP0ZSPWP)
USER(QSHSVR)
STRJOBS(*YES)
INLJOBS(10)
THRESHOLD(2)
ADLJOBS(3)
MAXJOBS(*NOMAX)
JOBD(QGPL/SHELL)
ADDPJE SBSD(QGPL/SHELL)
PGM(QSYS/QP0ZSPWT)
USER(QSHSVR)
STRJOBS(*YES)
INLJOBS(10)
THRESHOLD(2)
ADLJOBS(3)
MAXJOBS(*NOMAX)
JOBD(QSYS/QAMTJOBD)
</pre>
<strong>Starting the subsystem</strong> The following example shows
how to start the subsystem described in the previous example and
the server program.
<pre>
STRSBS SBSD(QGPL/QSHELL)
SBMJOB CMD(CALL QGPL/SERVER)
JOB(SERVER)
JOBD(QGPL/SHELL)
JOBQ(QGPL/SHELL)
USER(QSHSVR)
</pre>
</body>
</html>