ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzaik_5.4.0.1/userexitex1.htm

100 lines
5.8 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="Example: ILE C/400 user exit program for exit point QIBM_QZDA_INIT" />
<meta name="abstract" content="The following ILE C/400 program handles ODBC security by rejecting requests from certain users. It can be used as a shell for developing exit programs tailored for your operating environment." />
<meta name="description" content="The following ILE C/400 program handles ODBC security by rejecting requests from certain users. It can be used as a shell for developing exit programs tailored for your operating environment." />
<meta name="DC.Relation" scheme="URI" content="rzaiksampluserextpgm.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1999, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1999, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="userexitex1" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Example: ILE C/400 user exit program for exit point QIBM_QZDA_INIT </title>
</head>
<body id="userexitex1"><a name="userexitex1"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Example: ILE C/400 user exit program for exit point QIBM_QZDA_INIT </h1>
<div><p>The following ILE C/400<sup>®</sup> program handles ODBC security by rejecting requests
from certain users. It can be used as a shell for developing exit programs
tailored for your operating environment.</p>
<div class="example"> <pre>/*--------------------------------------------------------------------------
* @@ss1s@@ Servers - Sample Exit Program
*
* Exit Point Name : QIBM_QZDA_INIT
*
* Description : The following ILE C/400 program handles
* ODBC security by rejecting requests from
* certain users.
* It can be used as a shell for developing
* exit programs tailored for your
* operating environment.
*
* Input : A 1-byte return code value
* X'F0' server rejects the request
* anything else server allows the request
* Structure containing information about the
* request. The format used by this program
* is ZDAI0100.
*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------
* Includes
*------------------------------------------------------------------------*/
#include &lt;string.h&gt; /* string functions */
/*------------------------------------------------------------------------
* User Types
*------------------------------------------------------------------------*/
typedef struct { /* Exit Point QIBM_QZDA_INIT format ZDAI0100 */
char User_profile_name[10]; /* Name of user profile calling server*/
char Server_identifier[10]; /* database server value (*SQL) */
char Exit_format_name[8]; /* User exit format name (ZDAI0100) */
long Requested_function; /* function being preformed (0) */
} ZDAI0100_fmt_t;
/*------------------------------------------------------------------------
------------------------------------------------------------------------*/
/*========================================================================
* Start of mainline executable code
*========================================================================*/
int main (int argc, char *argv[])
{
ZDAI0100_fmt_t input; /* input format record */
/* copy input parm into structure */
memcpy(&amp;input, (ZDAI0100_fmt_t *)argv[2], 32);
if /* if user name is GUEST */
( memcmp(input.User_profile_name, "GUEST ", 10)==0 )
{
/* set return code to reject the request. */
memcpy( argv[1], "0", 1);
}
else /* else user is someone else */
{
/* set return code to allow the request. */
memcpy( argv[1], "1", 1);
}
} /* End of mainline executable code */</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzaiksampluserextpgm.htm" title="The following examples do not show all of the programming considerations or techniques. Review the examples before you begin application design and coding.">Examples: User exit programs</a></div>
</div>
</div>
</body>
</html>