The following examples are not coding samples, rather, they demonstrate
how to construct the input parameter list for a number of requests.
Example 1: Add user BRUCE with some BASE segment fields
and some OMVS segment fields.
Function code = ADMN_ADD_USER
Note: For fields which take quoted
data (for example, user name), the quotes must be included as part
of the data.
* First, define the request header
HEADER DS 0H
DC AL1(5) Length of user
DC CL8'BRUCE' User name
DC AL1(0) Reserved byte
DC AL2(0) Not used on input
DC AL2(2) Number of segments (BASE+OMVS)
* First segment entry - BASE
BSEG DC CL8'BASE' BASE segment entry
DC CL1'Y' Flag byte - Y - create segment
DC AL2(3) Field count - 3
* First BASE segment field entry
BFLD1 DC CL8'NAME' Name field
DC CL1'Y' Flag byte - Y - create field
DC AL2(13) Length of field data
DC CL13'''BRUCE WELLS''' Field data
* Second BASE segment field entry
BFLD2 DC CL8'OWNER' Owner field
DC CL1'Y' Flag byte - Y - create field
DC AL2(7) Length of field data
DC CL7'RACFDEV' Field data
* Third BASE segment field entry
BFLD3 DC CL8'SPECIAL' Special field
DC CL1'Y' Flag byte - Y - boolean value
DC AL2(0) Length 0 - no data for booleans
* Second segment entry - OMVS
OSEG DC CL8'OMVS' OMVS segment entry
DC CL1'Y' Flag byte - Y - create segment
DC AL2(3) Field count - 3
* First OMVS segment field entry
OFLD1 DC CL8'UID' UID field
DC CL1'Y' Flag byte - Y - create field
DC AL2(4) Length of field data
DC CL4'3500' Field data
* Second OMVS segment field entry
OFLD2 DC CL8'HOME' Home field
DC CL1'Y' Flag byte - Y - create field
DC AL2(10) Length of field data
DC CL10'/u/brwells' Field data
* Third OMVS segment field entry
OFLD3 DC CL8'PROGRAM' Program field
DC CL1'Y' Flag byte - Y - create field
DC AL2(7) Length of field data
DC CL7'/bin/sh' Field data
Example 2: This is the same as example 1, but is shown in
"rows", where a single line represents the request header, and individual
segment and field entries. This convention will be used from this
point on.
Function code = ADMN_ADD_USER
HEADER DC AL1(5),CL8'BRUCE',AL1(0),AL2(0),AL2(2)
BSEG DC CL8'BASE',CL1'Y',AL2(3)
BFLD1 DC CL8'NAME',CL1'Y',AL2(13),CL13'''BRUCE WELLS'''
BFLD2 DC CL8'OWNER',CL1'Y',AL2(7),CL7'RACFDEV'
BFLD3 DC CL8'SPECIAL',CL1'Y',AL2(0)
OSEG DC CL8'OMVS',CL1'Y',AL2(3)
OFLD1 DC CL8'UID',CL1'Y',AL2(4),CL4'3500'
OFLD2 DC CL8'HOME',CL1'Y',AL2(10),CL10'/u/brwells'
OFLD3 DC CL8'PROGRAM',CL1'Y',AL2(7),CL7'/bin/sh'
Example 3: Alter user BRUCE to add some categories and delete
a couple of OMVS segment fields.
Function code = ADMN_ALT_USER
HEADER DC AL1(5),CL8'BRUCE',AL1(0),AL2(0),AL2(2)
BSEG DC CL8'BASE',CL1'Y',AL2(1)
BFLD1 DC CL8'CATEGORY',CL1'A',AL2(14),CL14'CAT1 CAT2 CAT3'
OSEG DC CL8'OMVS',CL1'Y',AL2(2)
OFLD1 DC CL8'UID',CL1'N',AL2(0)
OFLD2 DC CL8'HOME',CL1'N',AL2(0)
Example 4: Alter user BRUCE to delete some categories, delete
the entire OMVS segment, and add a TSO segment.
Function code = ADMN_ALT_USER
HEADER DC AL1(5),CL8'BRUCE',AL1(0),AL2(0),AL2(3)
BSEG DC CL8'BASE',CL1'Y',AL2(1)
BFLD1 DC CL8'CATEGORY',CL1'D',AL2(9),CL9'CAT2 CAT3'
OSEG DC CL8'OMVS',CL1'N',AL2(0)
TSEG DC CL8'TSO',CL1'Y',AL2(2)
TFLD1 DC CL8'ACCTNUM',CL1'Y',AL2(7),CL7'ACCT123'
TFLD2 DC CL8'JOBCLASS',CL1'Y',AL2(1),CL1'J'
Example 5: List user BRUCE, displaying the OMVS and TSO
segments (and not the BASE segment).
Function code = ADMN_LST_USER
HEADER DC AL1(5),CL8'BRUCE',AL1(0),AL2(0),AL2(2)
OSEG DC CL8'OMVS',CL1'Y',AL2(0)
TSEG DC CL8'TSO',CL1'Y',AL2(0)
Example 6: Delete user BRUCE.
Function code = ADMN_DEL_USER
HEADER DC AL1(5),CL8'BRUCE',AL1(0),AL2(0),AL2(0)
Example 7: Retrieve the password envelope for user BRUCE.
Function code = ADMN_XTR_PWENV
HEADER DC AL1(5),CL8'BRUCE',AL1(0),AL2(0),AL2(0)
Note: This
example also applies to the extraction of a password phrase envelope
using the function code ADMN_XTR_PPENV.