The following describes how to create scheduled job streams for automatic updates of expected payment deviation days for business partners. Here, we will define an update to be run monthly, Sunday night at 1:00 o’clock.
- Select the Work with batch programs menu item.
- You access Batch programs table maintenance. Click Add.
- You access the detail panel:
- Program
- Enter the batch job stream name to identify the job stream.
- Tip: It is recommended that the job stream names start with an asterisk to distinguish them from the batch program names. It is also suggested that the defined company dependent job stream names end with the company code suffix that denotes for which DC1 company the job is going to be submitted.
- In this case, enter *CFM_DAYKG.
- Description
- Enter a description of the batch job stream.
- Subset
- Enter the subset level for the job stream. The subset level should be the domain decided by the system administrator. In this case, enter *CUSTLOCAL.
- Identity
- Enter an identity for the job stream. In this case, enter CFM. This field is mandatory but it is currently not used anywhere.
- Application
- Enter the application to which the job stream belongs, i.e. CFM which must be activated.
- Batch type
- Enter batch type 2 (batch job stream).
- Execute from window
- Set to NO.
- Select the Work with job control table menu item.
- You access Job control table maintenance:
- Program
- Enter the batch job stream name, i.e. *CFM_DAYKG.
- User
- Enter *ALL.
- Note: If you enter *ALL, all error messages will be sent to the user who submits this job to the scheduler. If you enter a specific user, all error messages will be sent to that user.
- You access the Job control table maintenance overview panel. Click Add.
- You access the second level panel:
- Sq
- The sequence value is automatically assigned by the program based on the entered keyword, but can be resequenced on the Job control table maintenance detail panel by clicking Resequence line number. It may also be left blank if no resequencing is needed.
- Keyword
- The keyword JOB (Sq 2, Line 10) – is the parameter that defines the job name that will be submitted by the job stream manager. It is recommended that the job name is the same as the job stream with the initial asterisk dropped.
- The keyword JOBQ (Sq 2, Line 20) – is the parameter that defines the job queue name to which the job will be submitted by the job control manager. The job queue name must exist in the system.
- The keyword EXCBPGM (Sq 4, Line 30) – is the parameter that defines a command that sets the environment for the selected company. The proper company code must be entered between the parentheses for each customer installation. In this example, company code KG is entered.
- The keyword EXCAPGM (Sq 5, Line 40-90) – is the parameter that defines the CHGASWLDA command that defines the LDA values for the program.
- Caution: The parameters for the CHGASWLDA command must be entered exactly as described in the table below.
- The keyword EXCAPGM (Sq 5, Line 100) – is the parameter that defines the command that calls the actual update program.
- Caution: This parameter line must be entered exactly as shown in the table above.
- Business partner type determines whether the chosen selection concerns customers, suppliers, or both.
- Business partner range selection from value.
- Business partner range selection to value.
- Clear existing fixed value determines whether the fixed values manually entered as the expected payment deviation days should be cleared or copied to the new records.
- Payment document date selection from value.
- Payment document date selection to value.
- When all the program parameters are defined, the Job control table maintenance detail panel displays all the entered item sequences. You have to add the job to the OS/400 scheduler. Click Add job schedule entry.
- You access Add Job Schedule Entry:
- Job name
- This field is defaulted with the job you are working with.
- Command to run
- This field is defaulted with the proper command string parameters and must not be changed.
- Frequency
- This value must be entered to determine how often the scheduled job should be submitted for execution. Enter *MONTHLY.
- Note: There is no direct way to schedule a job that is to be run on a longer period basis than a month. When such a longer-based schedule is required multiple submission events (with the frequency *ONCE) should be scheduled for dates at which the periodical job is supposed to run.
- Schedule date
- For this job, enter *NONE.
- Schedule day
- Here, enter *SUN.
- Schedule time
- This field allows you to determine at what time during the day this job should be executed. For this job, enter 01:00:00.
- CM02202: Invalid numeric value X entered as a business partner type, where X is the value passed through the LDA.
- CM02201: Scheduled job for expected payment deviation days update ended in error. This message will be sent to the user independent of whether the CM02202 message is sent to the user or not.
Panel image
Complete the following fields:
Click OK to update. The defined job stream action sequence must now be entered into the Job control table.
Panel image
Complete the following fields:
Click OK.
Panel image
On this panel you have to enter the action sequence items for the update job stream. The following is the list of actions that must be entered for this program.
Sq | Keyword | Line | Parameter |
---|---|---|---|
2 | JOB | 10 | CFM_DAYKG |
2 | JOBQ | 20 | ASWSINGLE |
4 | EXCBPGM | 30 | CHGASWCOM COMPANY(KG) |
5 | EXCAPGM | 40 | CHGASWLDA See table below for parameters |
5 | EXCAPGM | 50 | CHGASWLDA See table below for parameters |
5 | EXCAPGM | 60 | CHGASWLDA See table below for parameters |
5 | EXCAPGM | 70 | CHGASWLDA See table below for parameters |
5 | EXCAPGM | 80 | CHGASWLDA See table below for parameters |
5 | EXCAPGM | 90 | CHGASWLDA See table below for parameters |
5 | EXCAPGM | 100 | PGM(FCMR022) PARM(N) |
Each of the lines must be entered one by one. Complete the fields one by one according to the list above. See the following comments which are connected to the fields and refer to the table below for information about the CHGASWLDA values:
The update program requires the following input parameter values for the CHGASWLDA command that must be defined for line 40-90.
All the parameter values are defined in the lines 40-90. All of them are defined with the keyword CHGASWLDA.
Tip: You can prompt the CHGASWLDA command using F4 which makes it easier to enter the parameters defined in the table below.
Parameters – CHGASWLDA
Line | Parameter | New value | Type | Rel. DD/ per/YY, str/ end of MM |
Start position | No. of positions |
---|---|---|---|---|---|---|
40 | BP type | ‘1’ – customers ‘2’ – suppliers ‘ ‘ – both |
*CHAR | Blank | 005 | 1 |
50 | BP range selection – from value | Enter the BP “from” selection value enclosed with apostrophes. The entry between the apostrophes must always be 11 characters long, padded with blanks if necessary. If the entry between the apostrophes is blank, there will be no low limit for the selection. | *CHAR | Blank | 006 | 11 |
60 | BP range selection – to value | Enter the BP “to” selection value enclosed with apostrophes. The entry between the apostrophes must always be 11 characters long, padded with blanks if necessary. If the entry between the apostrophes is blank, there will be no low limit for the selection. | *CHAR | Blank | 017 | 11 |
70 | Clear existing fixed value | “Y” – the fixed value should be cleared “N” – the fixed value should not be cleared |
*CHAR | Blank | 028 | 1 |
80 | Payment document date selection – from value | Blank | *DATDP | Enter the date shift in days related to the day the calculation will be performed to set the low limit of the payment documents that should be included.
E.g., if -180 is entered, the “from” date will be set to 180 days before the day the program will be submitted for calculation. If 0 is entered or left blank all payment documents will be included. |
029 | Blank |
90 | Payment document date selection – to value | Blank | *DATDP | Enter the date shift in days related to the day the calculation will be performed to set the high limit of the payment documents that should be accounted.
E.g., if 0 is entered or the field is left blank, the “to” date will be set to the day the program will be submitted for calculation. |
035 | Blank |
Return to the previous panel when all parameters are entered.
Panel image
The following fields are relevant:
Click OK.
If an error occurs when running the update program, the following error messages will be sent to the messages queue of the user that submitted the job.
Note: If you enter *ALL, all error messages will be sent to the user who submits this job to the scheduler. If you enter a specific user, all error messages will be sent to that user.
If the LDA value entered as a business partner type is not blank and cannot be converted to a requested numerical format, the following error message will be sent to the message queue of the job stream user or to the message queue of the user that has submitted the job to the scheduler, if the job stream user is *ALL:
If the update program cannot be properly completed due to certain validation errors, the following error message will be sent to the message queue of the job stream user or to the message queue of the user that has submitted the job to the scheduler, if the job stream user is *ALL: