215 pts.
 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: November 26, 2009  10:25 AM
UPDATED: December 1, 2009  7:41 PM

Answer Wiki:
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 Wiki Answer Submitted:  November 27, 2009  4:45 am  by  Vatchy   1,410 pts.
All Answer Wiki Contributors:  Vatchy   1,410 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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.

 5,670 pts.

 

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

 108,215 pts.

 

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.

 5,670 pts.

 

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

 108,215 pts.

 

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

Tom

 108,215 pts.