Progress/400
Product Guide
Executing the SBMJOB Command
You can use either the Progress INSERT or CREATE statements to perform a QCMD function. The INSERT statement accesses the parameter form for the SBMJOB command. The parameter form is useful when you want to perform the SBMJOB function and are not familiar with all of the parameters. The CREATE statement is useful when you are familiar with the SBMJOB parameters or if you want to run OS/400 commands other than SBMJOB.
Accessing the QCMD Parameter Form
To access the QCMD parameter form using the INSERT statement, connect to the client schema holder and the DB2/400 database files, then follow these steps:
- Access the Progress Procedure Editor.
- Enter the following statement:
- Press GO. Progress displays the parameter form for the OS/400 Submit Job (SBMJOB) command.
- Complete the parameters that are necessary for the job you are submitting, then press GO. Progress/400 submits the job to the queue that you specify for the JOBQ parameter.
Running SBMJOB Without the QCMD Parameter Form
To issue an OS/400 command using the CREATE statement, connect to the client schema holder and the DB2/400 database, then follow these steps:
- Access the Progress Procedure Editor.
- Enter the following statement:
In this statement, the QCMD function is one of the two special Progress commands, or a valid OS/400 CL command optionally prefixed by an exclamation point or an asterisk and followed by a space. MYJOBNAME and QBATCH are the job name and job queue, respectively, that were selected for submitting the command.
- Press GO. The DataServer performs the QCMD function.
NOTE: If you are connected to multiple databases and the command you want to execute is specific to a database (for example, you want to close all PRODEMO files), you must qualify the QCMD file with the database name when you perform the INSERT or CREATE statement. For example, CREATE PRODEMO.QCMD.QCMD can be useful when you use the Override Database File (OVRDBF) command for a file in your Progress/400 database with multiple members. All members must share the same physical file format. If you override the database member to a file format that is different from the default file member, the DataServer generates unpredictable results at run time.
Feedback Information
When the DataServer executes a native CL command using the QCMD function, the job number of the OS/400 job that executes the QCMD command can be returned by the Progress record ID (RECID). The following example demonstrates how to display the returned job number:
When you execute the QCMD command with the leading exclamation point or asterisk followed by the space on the cmd field, the DataServer job executes the command directly. If the leading special character is a plus (+), the value that is returned to the variable crecid is the job number of the DataServer. If you do not specify a leading special character on the cmd field, the DataServer submits a job to the operating system to perform the command. In this case, the value returned to the variable crecid corresponds to the job number of the submitted job. A return value of zero in crecid indicates that the DataServer failed to execute or submit the command request.
Error Handling
If there is an error on the command that you submit and you are using the Native 4GL Client, the error message is in the user’s job log. If you are on a remote client, the error message is in the server’s job log.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |