Friday, June 9, 2017

Executing AS400 CL Command from Windows

Hello Friends,

If you have IBM System I Access for Windows then it would have given you a DOS command called ‘RMTCMD’. Using this you can directly run the CL commands from your Windows command prompt.

Syntax:

RMTCMD supports two formats

RMTCMD “CL COMMAND” [/Q] //AS400SERVER [/Z]

RMTCMD /I <filename> [/Q] //AS400SERVER [/Z]

RMTCMD à command name (CL commands can be given in double quotes)
AS400SERVER will be your server name

/Q à It specifies that command will display the error and end the command (if any error encountered in CL command). If we didn’t give then it will ask for options from you to continue or end

/Z à Specifies to display only required messages on your workstation

E.g.: I want to clear a file DEVYUS1/TEMP



It will prompt you for user name & password. And the commands will execute directly on your AS400.

E.g.: Output 

We can see using /Z option the extra details (version and copyright info) were not displayed.


What if we have multiple commands to execute? 

We can have it in a file and use our 2nd command.




What if we want to execute a DOS command from AS400?

STRPCO & STRPCCMD

You have to start PC Organizer (STRPCO) first then using STRPCCMD we can execute any DOS command.


Hope you might have learnt something useful. I shall come back with another interesting topic later. Until then… Have Fun..!!! Happy Coding…!!!


No comments:

Post a Comment