75 pts.
Q:
Change Text Description of All the AS/400 User Profiles (roughly around 1000) in the system.
Hi, We are in the process of making a slight change in the Text Description of All the User Profiles in the system. The figure of All the user profiles in the system roughly goes to 1000.

Changing the Text Description of a single user, one-by-one will be a lot tedious. Request you all to let us know if the Text Description of the All the User Profiles can be Changed in one short using SQL.



Software/Hardware used:
V5R4 on i570 Power 6
ASKED: Nov 26 2009  10:25 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
15390 pts.
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • Bookmark and Share
I don't know if you can do this through SQL but you can through a simple CL program. Display all of the user profiles to an outfile, then loop through the outfile and change the text for each one.

=======================================================

Technically, you could do it with SQL, but it would be more complicated than doing it other ways. Since user profiles aren't part of the database, SQL isn't closely related. You can create stored procs or other items to execute CHGUSRPRF commands, but why?

The suggestion to write a CL "script" that reads new texts from a file and assigns them with CHGUSRPRF is the right way to go. If it must be done.

Now, whether it's a good idea... that depends on what info will be encoded in the text, I suppose.

Tom
Last Answered: Nov 27 2009  4:45 AM GMT by TomLiotta   15390 pts.
Latest Contributors: Vatchy   835 pts.
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Splat   1260 pts.  |   Nov 27 2009  4:07PM GMT

I wouldn’t bother with CHGUSRPRF. Running under a profile with the necessary authorities, I’d write a CL to do a DSPOBJD OBJ(*ALL) OBJTYPE(*USRPRF) OUTPUT(*OUTFILE) OUTFILE(library/file), then read through the outfile and execute a CHGOBJD OBJ(&ODLBNM/&ODOBNM) OBJTYPE(*USRPRF) TEXT(’New text’) on the user profile object. The original text (&ODOBTX) will be available if you’re looking to modify existing text.

 

TomLiotta   15390 pts.  |   Nov 29 2009  9:35PM GMT

Why use a generic CHGOBJD when a specific CHGUSRPRF is available? If maintenance is against a specific object type and an interface is supplied for it, I’d go with the supplied interface. Many other attributes are available with CHGUSRPRF. And the same &ODOBTX would be just as available.

Tom

 

Splat   1260 pts.  |   Dec 1 2009  3:39PM GMT

Why use a CHGUSRPRF when a CHGOBJD is specific to the job at hand? If there were changes being made to attributes of the profile object beyond just text I’d agree - as the changes are only being made to profile object’s text, I say keep it simple.

 

TomLiotta   15390 pts.  |   Dec 1 2009  7:39PM GMT

I say keep it simple.

Good point. If that’s the primary criteria:

CHGUSRPRF USRPRF(TOML)
          TEXT(&ODOBTX)

…or:

CHGOBJD OBJ(QSYS/TOML)
        OBJTYPE(*USRPRF)
        TEXT(&ODOBTX)

CHGUSRPRF is only slightly more simple. But if simplicity is paramount…?

Tom

 

TomLiotta   15390 pts.  |   Dec 1 2009  7:41PM GMT

(QSYS qualification isn’t actually needed for CHGOBJD when object type is *USRPRF.)

Tom