35 pts.
 Is there a way to FTP a command to an AS/400 to copy user
We are trying to automate and make the setting up of users easier. Is there a way to ftp a command to a as400 to copy user "a" user profile to "b"?

Software/Hardware used:
AS400
ASKED: January 20, 2011  5:40 PM
UPDATED: January 26, 2011  2:48 AM

Answer Wiki:
So you want to automatically create a new user profile on the AS400. Some other system is going to sent it a USER PROFILE NAME to use for the create? Is that it? * Is the source system an AS400? If not, do you have standard default values for all the parms on a CRTUSRPRF command.? * It looks like the objective is to call a program on the AS400 that will do what you want. Correct?
Last Wiki Answer Submitted:  January 20, 2011  9:11 pm  by  CharlieBrowne   32,905 pts.
All Answer Wiki Contributors:  CharlieBrowne   32,905 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

The answer is YES
But, I’m not fully understanding what you want to do.
Is the AS400 the Source, Target, or Both for the FTP process?
What do you mean when you say you want to “ftp a command”?
A command someone else needs to run?

 32,905 pts.

 

We are wanting to ftp a command to the AS400 that would have the name of the copy from user profile and tell it to copy the user profile to a new user.

 35 pts.

 

yes,

We are planning on submitting a ftp from a mainframe passing the parm of the user profile to copy from and want it to create a new one that is like the one it copied from…

Is there a copy from one userprofile to another user profile command?

 35 pts.

 

First, you need to create a program that will the parameter of USRPRF.
Then that program does a CRTUSRPRF.
You can hard code the values that you need or table drive them or retrieve the values from a different USRPRF and use those.
*
Once you have that program, then it is just a matter of how it will be called.
You can do any of the following:
1. Submit a command that will call the program
2. Using FTP write the USRPRF to a file on the AS400. (IFS or DB), then have a scheduled program with runs exery x period of time. This program would read the file and to see if any new records were wtitten. If so, it calls the program to create the USRPRF then deletes that record and goes till EOF.

 32,905 pts.

 

Remember, whatever you are doing on the AS400 must be done with a USRPRR that has the authority to create new USRPRFs.

 32,905 pts.

 

As noted, the answer is “Yes.” But it generally requires writing a program to do it on the target system and sending the CALL command through FTP. (Or wrapping the program in a *CMD on the target and sending that command.)

However, it’s probably not a good idea. FTP is intended for file transfers even though it supports remote commands. You’d be far better off using facilities that are intended for remote command handling.

Further, the general process of “copying” a user profile possibly shouldn’t be encouraged. Some procedure based on group profiles could be an example of a better way to go. Create a (group) profile that has all needed authorities or attributes, have it be the group for user “a”. Then when a ‘copy’ is needed, create user “b” with the same group assigned. That’s not intended to be complete, but it covers the fundamental principle and it’s easier than ‘copying’ a user profile.

What all needs to be “copied”?

Tom

 108,135 pts.

 

It could be as simple as executing the command (without the quotes)
quote rcmd CPYUSRPRF FROMUSRPRF(A) TOUSRPRF(B) TEXT(‘text for new profile’)
from the FTP prompt after you have connected to the remote system.
You will need the proper authority to the command and the from user profile.

 880 pts.

 

 

It could be as simple as…

The CPYUSRPRF command is a possibility, though most sites haven’t purchased those tools. (It’s a TAA Tools command.)

Still, it’s worth a try.

Tom

 108,135 pts.

 

Hi,
DSPUSRPRF has an output file option. That file can be FTP. A procedure can read the file and CRTUSRPRF on the remote. The password will not be sent. The password will need to be sent along.
To maintain the password suggest SAVOBJ *USRPRF to a save file, FTP the *SAVF and restore the *USRPRF. good luck!

 695 pts.

 

DSPUSRPRF has an output file option. and …SAVOBJ *USRPRF to a save file, FTP the *SAVF and restore the *USRPRF.

That might be a little tricky since they “…are planning on submitting a ftp from a mainframe”.

Tom

 108,135 pts.