Preparing the payroll jobs
About this task
- The PAYWEEK job can process data from many departments. Each department produces its own transaction data set, which must be concatenated with the head office data set, which is always present.
- The PAYWEEK job uses the date of the Friday of the week in which the job is run. The job is usually run on Thursday, but if Thursday is a holiday, the job runs on the previous work day.
- Use the JCL VARIABLE TABLE panel (1.9.2 from the main menu) to create a variable table called PAY.
- Specify a variable DEPT, as shown in Creating a variable.
- Code the JCL for PAYWEEK like the following example:
//PAYWEEK JOB … //*%OPC SCAN 1 //* PAYMORE PAYROLL SAMPLE -- PAYWEEK //* THIS JOB RUNS PAY07, PAY10, AND PAY16 //*%OPC SETFORM OCDATE=(MM/DD/CCYY) 2 //*%OPC BEGIN ACTION=INCLUDE,COMP=(&ODAY..EQ.1) 3 //*%OPC SETVAR TFRIDAY=(OCDATE+4CD) 4 //*%OPC END ACTION=INCLUDE ⋮ //*%OPC BEGIN ACTION=INCLUDE,COMP=(&ODAY..EQ.7) //*%OPC SETVAR TFRIDAY=(OCDATE-2CD) //*%OPC END ACTION=INCLUDE //PAY07 EXEC PGM=PAY07,PARM='&TFRIDAY.' 5 //STEPLIB DD DSN=XRAYNER.OPC.LOADLIB,DISP=SHR //PAYFILE DD DSN=XRAYNER.HEAD.PAYTRANS,DISP=SHR //*%OPC BEGIN PHASE=SUBMIT,ACTION=INCLUDE,COMP=(&DEPT..NE.N) 6 // DD DSN=XRAYNER.&DEPT..PAYTRANS,DISP=SHR 7 //*%OPC END ACTION=INCLUDE 8 //PAYDB DD DSN=XRAYNER.PAYROLL.DATABASE,DISP=SHR //SYSPRINT DD SYSOUT=*
This is an explanation of the marked lines:
1 is a statement that tells HCL Workload Automation for Z to perform variable substitution on the following lines. You need this unless you have VARSUB set to YES on the OPCOPTS initialization statement.
2 tells HCL Workload Automation for Z to use the format MM/DD/CCYY for OCDATE. If the input arrival date is 16 March 2003, for example, HCL Workload Automation for Z substitutes 03/16/2003 for &OCDATE.
3 tests the day of the week. If the input arrival day is Monday (ODAY=1), it includes a SETVAR statement 4 to add 4 calendar days, giving Friday's date. This is repeated for the other days of the week. OCDATE and ODAY do not have to be in your variable table because they are predefined by HCL Workload Automation for Z.
5 passes Friday's date to the PAY07 program.
6 tests whether the variable DEPT has its default value N, and if not, it adds the extra line of JCL 7, which is the extra data set for another department.
8 marks the end of the lines to be included.
- Put the JCL into the partitioned data set that is allocated to the ddname EQQJBLIB. HCL Workload Automation for Z never updates this JCL. It always makes a copy and stores the modified copy in the job repository (a group of VSAM clusters used cyclically with DD names in the format EQQJSnDS). HCL Workload Automation for Z takes a fresh copy of the JCL from EQQJBLIB for each occurrence, but once the JCL is changed, the changed copy in the job repository is used.
- When you set up the JCL for an operation. You use the READY LIST to perform setup and complete the operation on the job setup workstation.
- On request from the MODIFY CURRENT PLAN (MCP) panel. This is independent of the job setup operation. If you change the JCL for an occurrence, HCL Workload Automation for Z puts your edited job in the repository, where it will be picked up by any subsequent setup operation using the Ready list.
- On request from the LONG-TERM PLAN panel. This is how you change the JCL for an individual occurrence that is not yet in the current plan, without affecting the JCL for other occurrences of the job.
- When a job or started task completes successfully. HCL Workload Automation for Z removes the JCL for the previous occurrence from the job repository.
- When you specify automatic recovery. HCL Workload Automation for Z checks the JCL for HCL Workload Automation for Z recovery statements. If there are recovery statements, HCL Workload Automation for Z changes the JCL and stores it in the job repository.
See Job tailoring for more details of variable substitution.