QCMDEXC Function


Executes an OS/400 command.


Syntax

QCMDEXC(command)

Part Description
command Required. Any valid OS/400 command.


Remarks

If an error occurs while executing the command, the function returns a numeric value of 1. If the command executes successfully, the function returns 0. The QCMDEXC function is often used to perform dynamic overrides on database files with the use of the OVRDBF command.


Example

The following IF statement uses QCMDEXC to perform a file override and tests whether that override was successful:

     C                   If        QCMDEXC('OVRDBF FILE(INPUTF) +                                                                   
     C                               TOFILE(' + %Trim(library) + '/QTXTSRC) +                                                       
     C                               MBR(' + member + ')') = 0                                                                      


See Also

RPGspRedirect


Profound Logic Software, Inc.
www.ProfoundLogic.com
(937) 439-7925