Q
Problem solve Get help with specific problems with your technologies, process and projects.

Change a dtaara on another server

I want to change a dtaara on another server with RUNRMTCMD in a CL program. Is it possible to use variables in the RUNRMTCMD to do this? For instance: RUNRMTCMD CMD('CHGDTAARA DTAARA(LIB/DTAARA (10 14)) VALUE(&MONTH)') RMTLOCNAME('123.45.678.253' *IP)


Why don't you try doing just that? That's what I would do, to answer your question. Then you would know a lot more about the messages that could be obtained, and the sort of pitfalls there might be.

If it works (and I think that it will), then in production you should be aware that it might not work if a user is not authorized to the object involved, or the command. So if necessary you should create the CL program to adopt the owner's authority, and make sure the program's owner is authorized correctly.

If it does NOT work, then you can put the whole command into a variable, using CATs to include your parameter value, and then use QCMDEXC to execute the command. Or else, use the same approach from an RPG program. In either case, authority adoption may be required for normal users.

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your programming questions--or help out your peers by answering them--in our live discussion forums.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.


This was last published in September 2004

Dig Deeper on RPG iSeries programming

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close