IBM Support

Enabling Profiles with a Program

Troubleshooting


Problem

This example program allows a user to have adopted authority rather than granting authorities to the user.

Resolving The Problem

Caution: This document is provided as is with no support on it available.


This will walk through creating a program that will allow a user with limited authority to re-enable another user profile. The following steps must be done logged on as QSECOFR.

1. On the operating system command line, type the following:

STRPDM

Press the Enter key.
2. Select Option 3, Work with members, and press the Enter key.
3. Specify Members to Work With.

Type the choices, and then press the Enter key.

File . . . . . . . . . . QCLSRC Name, F4 for list

Library . . . . . . . . QGPL *LIBL, *CURLIB, name

Member:
Name . . . . . . . . . *ALL *ALL, name, *generic*
Type . . . . . . . . . *ALL *ALL, type, *generic*, *BLANK
4. To create a new source member, Press F6. Name it: ENABLE.
5. This should bring you to an edit screen. Here is the source for the program:

0001.00 PGM PARM(&USER)
0002.00 DCL VAR(&USER) TYPE(*CHAR)
0003.00 CHGUSRPRF USRPRF(&USER) STATUS(*ENABLED)
0004.00 ENDPGM
6. Press F3 and create the source member.
7. Select Option 14 to compile the source.
8. Exit to a command line and type

CRTCLPGM

Press F4 to prompt and type the following parameter values.

Program . . . . . . . . . . . . enable
Library . . . . . . . . . . . *CURLIB
Source file . . . . . . . . . . QCLSRC
Library . . . . . . . . . . . *LIBL
Source member . . . . . . . . . enable
Text 'description' . . . . . . . 'Program to enable profiles'
9. Set it up to use adopted authority with the User Profile set to *OWNER on the CRTCLPGM command.
10. Do a WRKOBJ on the program, and make sure *PUBLIC is set to *EXCLUDE.
11. Grant *USE authority to the users you want to be able to do this.

They should now be able to type the following on a command line:

CALL ENABLE <user profile>

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.1.0"}]

Historical Number

19965123

Document Information

Modified date:
21 September 2020

UID

nas8N1019569