Showing posts with label Mainframe projects. Show all posts
Showing posts with label Mainframe projects. Show all posts

Tuesday, December 4, 2012

IBM Mainframe Payroll Project

Are you looking for mainframe projects?, then this is the right place for you. Right now I have 2  Projects  ( Mainframe projects with Source code ) coded with COBOL, have utilized LE xml service and GDGs. you might be able to tune these projects, so please post your valuable comments and snippets.

This is just a starting a series of mainframe projects, I’ll be uploading more projects in coming days. Also if you need a project or you have some suggestions please write to me at shibuthannikkunnath@gmail.com.

You might face few issues while uploading and running the applications and may think that the provided documentation is not enough. In those situations please drop me a mail at shibuthannikkunnath@gmail.com and I can help you to clear all the doubts regarding the projects.

1. MAINFRAME PAYROLL PROJECT.

This project is for generating calculating employee's salary and generate pay slip. This application will also generate xml log for the pay slips generated and can be used to monitor in future by feeding to xml log monitoring application or you can even send it to a web service!.

I have coded these applications in my machine and xmitted and downloaded them.

Step 1. Download the binary format source and and dependent files.

download link

http://www.mediafire.com/?6th6w35ns4lk182

The above zipped file contains a couple of binary files, download zip file and unzip it and keep the binary files in your local drive.

Step 2. Upload files to mainframe.

At this point of time I’m assuming that you have IBM personal communications installed in your machine, I mean any emulator is fine. Since I’m using PCOMM the I’m gonna explain from the PCOMM point of view ;).

Login to mainframe TSO session

image

Chose option 6 (command).

image

Now choose Actions from the Menu bar and select send file to host.

image

Click on browse and chose the first file from the zipped folder. and chose Binary as the transfer type for all files and click on update in list or add to list then click on send. Do not forget to put quotes before and after the server file name, this to avoid the automatic padding of your RACFID by zOS.

use the bellow server file name for all the respective files.

PAYROLL.CLAIMFLE
PAYROLL.EMPFILE
PAYROLL.JCLS
PAYROLL.PAYFILE
PAYROLL.SOURCE
PAYROLL.FLECPYBK

Step 3. Inflate the binary files.

Here we are expanding all the binary files to their original format, go to ISPF main option 6 (Command) and type

receive indsn(‘<binary filenames>’) , don’t forget the quotes

eg: receive indsn('PAYROLL.CLAIMFLE')

you will get a message like below one, just press Enter key

INMR901I Dataset TSHRCI.PAYROLL.CLAIMFLE from R0318B on N1
INMR906A Enter restore parameters or 'DELETE' or 'END' + 

You will get a successful message like below. if not try again “ watch for the quotes”

INMR001I Restore successful to dataset 'TSHRCI.PAYROLL.CLAIMFLE'

repeat the step 3 for all the 6 files there in the downloaded zip file.

Step 4. we are almost there, verify the files

go to ISPF option 3.4, and type “TSHRCI.PAYROLL” in dsname level and press enter you will get a screen almost like below. except TSHRCI.PAYROLL.PAYSLIP.GROUP  and TSHRCI.PAYROLL.XMLLOG.GROUP.

image

Step 5. Build the supporting GDGs

Go to TSHRCI.PAYROLL.JCLS and put an “e” in front of GDG and hit enter key.

right now this is the pay slip GDG JCL, so submit it to create pay slip GDGs

Now modify the JCL to below JCL (Changes are marked in red color) and submit it.

//R0318BJ  JOB 'SHIBU THANIKKUNNATTH',NOTIFY=&SYSUID
//GROUP    EXEC PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//SYSIN    DD   *
DEFINE GDG(NAME(TSHRCI.PAYROLL.XMLLOG.GROUP)-
LIMIT(3)                -
NOEMPTY                 -
SCRATCH)
/*
//MODEL    EXEC PGM=IEFBR14
//GDGMODEL DD   DSN=TSHRCI.PAYROLL.XMLLOG.MODEL,
//         DISP=(NEW,CATLG,DELETE),
//         UNIT=SYSDA,
//         SPACE=(TRK,0),
//*        VOL=SER=EUTDSD,
//         DCB=(LRECL=80,RECFM=FB,BLKSIZE=800,DSORG=PS)
//SYSPRINT DD   SYSOUT=*
//SYSIN    DD DUMMY
//GDS      EXEC PGM=IEBGENER
//SYSPRINT DD   SYSOUT=*
//SYSIN    DD   DUMMY
//SYSUT1   DD *
RECORD-100001
RECORD-100002
/*

//SYSUT2   DD   DSN=TSHRCI.PAYROLL.XMLLOG.GROUP(+1),
//         DISP=(NEW,CATLG,DELETE),
//         SPACE=(TRK,5),
//         DCB=TSHRCI.PAYROLL.XMLLOG.MODEL,
//*        VOL=SER=EUTDSD,
//         UNIT=SYSDA
//SYSIN    DD DUMMY
//


Line marked in PINK color is the DASD volume, if your site is not SMS managed you have to provide the volume serial number, if you don’t know the vol ser, you can contact z box system admin.

Now if you go back to ISPF main option 3.4 and TSHRCI.PAYROLL.* you can see your screen as below.

image

Step 6. Time to review contents of all the datasets.

go to First file (TSHRCI.PAYROLL.CLAIMFLE) and you can see the below screen

image

This is the file which employees will claim their billed hours for a whole month. The structure is as given below

FD-CF-MONTH               PIC X(03).
FD-CF-WEEK                PIC X(01).
FD-CF-EMPID                PIC X(10).
FD-CF-BILL-CDE            PIC X(02).
FD-CF-SUN                    PIC X(03).
FD-CF-MON                   PIC X(03).
FD-CF-TUE                    PIC X(03).
FD-CF-WED                   PIC X(03).
FD-CF-THU                     PIC X(03).
FD-CF-FRI                      PIC X(03).
FD-CF-SAT                     PIC X(03).
First 3 chars for the month, Next 1 char for the week(1,2,3,4), next 10chars for employee id, entered ID should have an entry in TSHRCI.PAYROLL.EMPFILE, next 02 chars are for bill codes we can use bill code for claiming over time valid values( 01 for basic claiming, 02 for leave hours, 03 for week day overtime, and 04 for weekend over time) these bill codes should have matching entry in TSHRCI.PAYROLL.PAYFILE  with band code of the employee. Next 7 fields of 3 characters are for daily hour claiming.

e.g. JAN1100000000101000008008008008008000

says: its for Jan First week, for employee ID 1000000001, basic hrs, and 0hrs  for Sunday, 8 hrs each for Monday, Tuesday, Wednesday, Thursday, Friday and 0hr for Saturday.

Now go to TSHRCI.PAYROLL.EMPFILE, File structure is given below.

05  FD-EF-EMPID              PIC X(10).
05  FD-EF-FNAME             PIC X(10).
05  FD-EF-LNAME             PIC X(10).
05  FD-EF-ADD1                PIC X(10).
05  FD-EF-ADD2                PIC X(10).
05  FD-EF-PH                    PIC X(13).
05  FD-EF-DOJ                  PIC X(10).
05  FD-EF-DOB                  PIC X(10).
05  FD-EF-LASTPAYED      PIC X(10).
05  FD-EF-EMPMODE        PIC X(03).
05  FD-EF-STATUS            PIC X(03).
05  FD-EF-PAYMODE        PIC X(01).
05  FD-EF-BAND               PIC X(02).

First 10 bytes for employee id, next 10 for first name and next 10 for last name, next 10 for address line1 and next 10 for address line2, next 13 bytes for phone number, next 10 bytes for date of birth,, next 10 bytes for last paid month its for future enhancement. next 3 bytes for employment mode valid values are per for permanent and con for contract. next 3 bytes for status 001 is active and 002 is resigned, next 2 bytes for band can have any value but the band value should have a matching entry in TSHRCI.PAYROLL.PAYFILE.

image

Now go to TSHRCI.PAYROLL.FLECPYBK

This data set contains the file structures of all data sets, It has been created to refer the files at any point of time if you do not access to our web sites, and to avoid to messing up our code B)

Now go to TSHRCI.PAYROLL.JCLS

This PDS contains the JCL’s for compiling our code, running our application, creating GDG’s and deleting GDG’s. GDG operations has been explained in Step 5.

BATCHBOB.

This JCL can used to compile the cobol application, if the IGYWCL proc is in the 'SYS1.ADMIN.PROCLIB' and IGYWCL has been undergone some tweaks to accept member name, srce lib and load lib parms. right now this is the only cause in IBM internal training machines.

COBCPL.

I believe this JCL must work in almost all the mainframes that has IBM Cobol version 4.1.  this job directly call the IGYWCl which is the part of COBOL ver 4.1 so  it should work without making any noises.

“If you have any issues with writing compile JCL for our project please write back to  me at shibu@hotmail.co.in  I can always help you to get a fully functional compile JCL"

Execpgm

This JCL is for executing our application. If you go to this JCL you can see that I have commented out a couple of lines (//*           VOL=SER=EUTDSD,) these are the volume serial numbers, since my machine is SMS managed I do not have to worry about the vol ser numbers, SMS will take care of it.

If your site is not SMS managed you have to un comment these line and change the volume serial number to the volume where GDGs resides. If you go to ISPF 3.4 option you can see volume at the right side of your dsn, see the below screen shot, for TSHRCI.PAYROLL.JCLS the vol ser is ETRU03.

image

GDG and GDGDEL

These are the JCLS for creating and deleting GDGs. PLease refer to Step 5 for more information.

Now go to TSHRCI.PAYROLL.PAYFILE

“Soon you opened the dataset please enter num off command in order to avoid any data lose"

This file is all about the MONEY, we have to declare the hourly charge for different bands.

File structure is

05  FD-PF-BAND                 PIC X(02).
05  FD-PF-HOURLY             PIC X(04).
05  FD-PF-DAILY                 PIC X(04).
05  FD-PF-MONTHLY           PIC X(06).
05  FD-PF-OVERTIME          PIC X(03).
05  FD-PF-LEAVE                PIC X(04).
05  FD-PF-WEEKENDOT     PIC X(03).

First 2 bytes are for Ban number, next 04 bytes are for per hour charge for normal (8hrs per day) work hours if the guy is working as per hour plan, next 4 bytes are for per hour charge normal (8hrs per day) work hours if the employee is working in daily wage plan, and next 4 bytes are for per hour charge for normal work hours(8hrs per day) if the employee is working in monthly wage plan. next 3 bytes are the amount needs to bill if the employee worked week day over time. Next 4 bytes are the amount needs to charge if the employee went on vacation ( normally no company will reduce any amount from salary, so we) . next 3 bytes are for the amount needs to charge if the employee worked on weekend over time.

e.g. 05020010000300003000200100

The above line says band is 05, 200 for hourly wage, 1000 for daily wage, 3000 for monthly wage, 300 if employee was on week day over time, 200 if employee was on leave/vacation, and 100 if employee worked on weekend over time.

Now go to TSHRCI.PAYROLL.SOURCE

PDS contains the source code, you have all the freedom to work on the source code.

Please do not change the Author name!

Step 7 Most important: create load lib

Load lib is the pds where our compile and exec pgm JCL are pointing to. So let create it. This PDS will be same for all our projects so don’t be a miser, allocate few cylinders.

Go to ISPF 3.2 screen fill the screen as below

image

press enter

Ignore the management class, storage class, volume serial, device type, data class and fill out the remaining fields as in below screenshots

image

Press enter to finish it up.

image

We are done with the setups. now lets go and run the code!.

Step 8. Run the code

If you want you can edit claim file, if you want to claim your own billed hrs. but don't forget to add your own employees and band details also. Other wise app will abend!. :D. PLease be aware the code will work fine with the provided data.

Now go to TSHRCI.PAYROLL.JCLS and submit compile JCL

image

compile JCL should return MAXCC 0

after that submit EXECPGM jcl.

image

our program will return maxx cc 0, almost in all the cases, please review the data sets again if you have made any changes (Refer 5 and 6 to know the file structures and GDGs)

Go to spool and verify the claims processed  flow and the data (if needed)

image

Now, its the time review the GDGs

Pay slip

Go to ISPF 3.4, DSNAME level TSHRCI.PAY* and open the latest TSHRCI.PAYROLL.PAYSLIP.GROUP.* gdg.

and you can see the pay slips generated for our employees, of the inputted month.

image

XMLLOG

go to ISPF 3.4, DSname level TSHRCI.PAY* and open the latest version of TSHRCI.PAYROLL.XMLLOG.GROUP

image

That' is it. keep exploring the project, do tweaking, but do not forget to write to me your experiences and your doubts or what ever related to mainframes at shibuthannikkunnath@gmail.com

 

Wednesday, May 25, 2011

Online project with COBOL and Rexx

Hi guys, I got one real-time processing project with COBOL and Rexx. This project is using ISPF services to invoke the load module. we say this is an ultra mini project, since we do not have any complicated code or operations in it. Since we are invoking the load module dynamically (using ispf services), we cannot use jcl to allocate the data set for our program; so I have use “PUTENV” to allocate the vsam file for our program.

Bullet points of Project.

1. using Dynamic vsam file allocation.

2. Dynamically invoking load module using rexx.

Step 1 Download source and dependent data sets

I have xmitted the binary files of the project from my mainframe and uploaded to some file sharing service, you can download the zipped files from the below link.

http://www.mediafire.com/?zlozknvj77z5vmd

The Project source codes are free of cost and there is nothing will stop you from downloading the code.

Step 2 Upload binary files to mainframe and expand them

Download the zip file from the above link, unzip into your local folder. then you can upload them using a mainframe emulator or FTP service of windows or Linux. Please read the Step 2. Uploading files and Step 3 Inflating binary files of our first project from the below link.

http://mainframegeek.wordpress.com/2011/04/25/mainframe-projects/

Files contained in the Zip file

INDEXFLE.SRCE
INDEXFLE.JCLS
INDEXFLE.EXECPGM

Once you did Step 3. inflating binary files, by default the files will be stored in the below names.

TSHRCI.INDEXFLE.EXECPGM
TSHRCI.INDEXFLE.JCLS
TSHRCI.INDEXFLE.SRCE

Step 3 lets have a look on data sets.

TSHRCI.INDEXFLE.EXECPGM is a ps and it is a Rexx code which is used to invoke the load module from TSHRCI.LOAD.LIB .

Following code is the heart of our program, which is invoking indxfle (load module) from TSHRCI.LOAD.LIB pds.

address ispexec
"libdef ispllib dataset id('TSHRCI.LOAD.LIB')"
pgm=indxfle
"select pgm("pgm")"

TSHRCI.INDEXFLE.JCLS is a pds and contained fillowing members

BATCHCOB
COBCPL
VSAMGEN

Batchcob and COBCPL are two different compile JCL’s for Cobol compiler. BATCHCOB Since I’ve been working on a internal mainframe connection the proc was different So I had to use a customized JCL to compile my code, they have modified IGYWCL proc according to their needs. COBCPL   This should work on almost all mainframes with Cobol ver 4.1, since its making use of default IGYWCL.

VSAMGEN. Is used to generate the Vsam file which we are using in our project. Once you executed the JCL, you can see that the following files has been generated. which is a must before executing our program.

TSHRCI.INDXFLE.FILE1
TSHRCI.INDXFLE.FILE1.DATA
TSHRCI.INDXFLE.FILE1.INDEX

/* DELETE KSDS CLUSTER, IF IT EXISTS                      */
DELETE TSHRCI.INDXFLE.FILE1 CLUSTER PURGE
/* DEFINE KSDS CLUSTER                                    */
DEFINE CLUSTER (                                          -
NAME(TSHRCI.INDXFLE.FILE1)                   -
VOLUMES(ETRU06)                              -
RECORDSIZE(80 80)                            -
RECORDS(50 10)                               -
KEYS(02 0)                                   -
INDEXED )                                    -
DATA (                                             -
NAME(TSHRCI.INDXFLE.FILE1.DATA) )            -
INDEX (                                            -
NAME(TSHRCI.INDXFLE.FILE1.INDEX) )
IF LASTCC = 0 THEN                                        -
LISTCAT ALL LEVEL(TSHRCI.INDXFLE)

Above code is the important part of VSAMGEN, It will delete vsam cluster if existing, create new cluster, index and data data sets.If you are running the JCL for the first time you will get Maxcc 8, since cluster is not existing in system. The line which marked in red color is not mandatory if your mainframe is  SMS managed. “ETRU06” is the DASD vol ser# where we need our vsam file. Read Redbook on below link to know more about SMS.

http://www.redbooks.ibm.com/abstracts/sg245484.html

TSHRCI.INDEXFLE.SRCE, is a pds and contained “INDXFLE” which is source code of our project. As I said this project is very small and does not have any complicated logics or functionalities in it. The advantages are we are using Dynamic vsam file allocation and invoking load module dynamically using ispexec service.

Step 4 Key parts of Program

.

Dynamic File allocation.

01  FILE-DATA.
05  FILE-PTR                POINTER.
05  FILE-NAME.
10                      PIC X(12)
VALUE 'DYNVSAM=DSN('.
10  dsname              PIC X(60).
10                      PIC XX VALUE Z' '.
05  RC                      PIC S9(9) BINARY VALUE 0.
05  in-name                 pic x(40).

In order to allocate file, we need to tell which file we need to allocate and how we need to do it (Disp) So we need to have the above code in working storage section. once the allocation is done the return code (from PUTENV) will be stores in RC. 10                      PIC XX VALUE Z' '. is filler and says that it null terminated string.

move 'TSHRCI.INDXFLE.FILE1'
to in-name.
string in-name delimited by space
') SHR' delimited by size into dsname.

Above code will concatenate vsam cluster dsn with disposition and other data and move to fFILE-NAME data name.

set file-ptr                to address of file-name.
CALL 'PUTENV'
USING BY VALUE FILE-PTR
RETURNING RC.

Above line sets the address pointer of file name to FILE-PTR and calls PUTENV using FILE-PTR. PUTENV will allocate the file wich FILE-PTR points and  return the status of allocation, which will be stored in RC, if RC is –1 then allocation was failure, 0 means allocation was success.

Step 5. Compile and execute the program

Compile

Run BATCHCOB and JCL should return MAXCC 0, and will happen with the provided source code.

Create TSHRCI.LOAD.LIB if not existing before you compile the project.

Executing project

Execute TSHRCI.INDEXFLE.EXECPGM rexx code by putting an “EX” before the file name.

image

and Press Enter which will invoke INDXFLE from TSHRCI.LOAD.LIB, if the compilation was failure then which will give you an error. Please verify that you have created TSHRCI.,LOAD.LIB before compiling the source code and the compilation was successful.

image

Its the fist line in our Project which is to bring up the options in a brand new screen, press enter to continue.

image

Chose any of the options by entering the number and hit enter.

image

image

image

image

image

press enter to come out of this screen. When ever we are performing some actions on data set, our program will set the return code of our Project based on the file status. And the rexx code will evaluate the return code of the project.

image

Monday, April 25, 2011

IBM Mainframe–Payroll Project

Are you looking for mainframe projects?, then this is the right place for you. Right now I have 2  Projects  ( Mainframe projects with Source code ) coded with COBOL, have utilized LE xml service and GDGs. you might be able to tune these projects, so please post your valuable comments and snippets.

This is just a starting a series of mainframe projects, I’ll be uploading more projects in coming days. Also if you need a project or you have some suggestions please write to me at shibu@hotmail.co.in .

You might face few issues while uploading and running the applications and may think that the provided documentation is not enough. In those situations please drop me a mail at shibu@hotmail.co.in and I can help you to clear all the doubts regarding the projects.

1. MAINFRAME PAYROLL PROJECT.

This project is for generating calculating employee's salary and generate pay slip. This application will also generate xml log for the pay slips generated and can be used to monitor in future by feeding to xml log monitoring application or you can even send it to a web service!.

I have coded these applications in my machine and xmitted and downloaded them.

Step 1. Download the binary format source and and dependent files.

We are no longer providing the download link in this page, the download link will be emailed everyone once they do the following steps.

1. Follow us on facebook

Click on the Like button on the facebook plugin.

image

2. Follow the blog.

Enter your email ID on the textbox and signup for the mainframegeek.me updates. Your email id will be stored in a secured area and it will not be visible to anyone. By signing up you  will be updated whenever new posts /projects are added to the website.

image

Once these two steps are done, you will be receiving and automated email with the Project download links. The Project source codes are free of cost and there is nothing will stop you from downloading the code.

The  zipped file contains a couple of binary files, download zip file and unzip it and keep the binary files in your local drive.

Step 2. Upload files to mainframe.

At this point of time I’m assuming that you have IBM personal communications installed in your machine, I mean any emulator is fine. Since I’m using PCOMM the I’m gonna explain from the PCOMM point of view ;).

Login to mainframe TSO session

image

Chose option 6 (command).

image

Now choose Actions from the Menu bar and select send file to host.

image

Click on browse and chose the first file from the zipped folder. and chose Binary as the transfer type for all files and click on update in list or add to list then click on send. Do not forget to put quotes before and after the server file name, this to avoid the automatic padding of your RACFID by zOS.

use the bellow server file name for all the respective files.

PAYROLL.CLAIMFLE
PAYROLL.EMPFILE
PAYROLL.JCLS
PAYROLL.PAYFILE
PAYROLL.SOURCE
PAYROLL.FLECPYBK

Step 3. Inflate the binary files.

Here we are expanding all the binary files to their original format, go to ISPF main option 6 (Command) and type

receive indsn(‘<binary filenames>’) , don’t forget the quotes

eg: receive indsn('PAYROLL.CLAIMFLE')

you will get a message like below one, just press Enter key

INMR901I Dataset TSHRCI.PAYROLL.CLAIMFLE from R0318B on N1
INMR906A Enter restore parameters or 'DELETE' or 'END' + 

You will get a successful message like below. if not try again “ watch for the quotes”

INMR001I Restore successful to dataset 'TSHRCI.PAYROLL.CLAIMFLE'

repeat the step 3 for all the 6 files there in the downloaded zip file.

Step 4. we are almost there, verify the files

go to ISPF option 3.4, and type “TSHRCI.PAYROLL” in dsname level and press enter you will get a screen almost like below. except TSHRCI.PAYROLL.PAYSLIP.GROUP  and TSHRCI.PAYROLL.XMLLOG.GROUP.

image

Step 5. Build the supporting GDGs

Go to TSHRCI.PAYROLL.JCLS and put an “e” in front of GDG and hit enter key.

right now this is the pay slip GDG JCL, so submit it to create pay slip GDGs

Now modify the JCL to below JCL (Changes are marked in red color) and submit it.

//R0318BJ  JOB 'SHIBU THANIKKUNNATTH',NOTIFY=&SYSUID
//GROUP    EXEC PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//SYSIN    DD   *
DEFINE GDG(NAME(TSHRCI.PAYROLL.XMLLOG.GROUP)-
LIMIT(3)                -
NOEMPTY                 -
SCRATCH)
/*
//MODEL    EXEC PGM=IEFBR14
//GDGMODEL DD   DSN=TSHRCI.PAYROLL.XMLLOG.MODEL,
//         DISP=(NEW,CATLG,DELETE),
//         UNIT=SYSDA,
//         SPACE=(TRK,0),
//*        VOL=SER=EUTDSD,
//         DCB=(LRECL=80,RECFM=FB,BLKSIZE=800,DSORG=PS)
//SYSPRINT DD   SYSOUT=*
//SYSIN    DD DUMMY
//GDS      EXEC PGM=IEBGENER
//SYSPRINT DD   SYSOUT=*
//SYSIN    DD   DUMMY
//SYSUT1   DD *
RECORD-100001
RECORD-100002
/*

//SYSUT2   DD   DSN=TSHRCI.PAYROLL.XMLLOG.GROUP(+1),
//         DISP=(NEW,CATLG,DELETE),
//         SPACE=(TRK,5),
//         DCB=TSHRCI.PAYROLL.XMLLOG.MODEL,
//*        VOL=SER=EUTDSD,
//         UNIT=SYSDA
//SYSIN    DD DUMMY
//


Line marked in PINK color is the DASD volume, if your site is not SMS managed you have to provide the volume serial number, if you don’t know the vol ser, you can contact z box system admin.

Now if you go back to ISPF main option 3.4 and TSHRCI.PAYROLL.* you can see your screen as below.

image

Step 6. Time to review contents of all the datasets.

go to First file (TSHRCI.PAYROLL.CLAIMFLE) and you can see the below screen

image

This is the file which employees will claim their billed hours for a whole month. The structure is as given below

FD-CF-MONTH               PIC X(03).
FD-CF-WEEK                PIC X(01).
FD-CF-EMPID                PIC X(10).
FD-CF-BILL-CDE            PIC X(02).
FD-CF-SUN                    PIC X(03).
FD-CF-MON                   PIC X(03).
FD-CF-TUE                    PIC X(03).
FD-CF-WED                   PIC X(03).
FD-CF-THU                     PIC X(03).
FD-CF-FRI                      PIC X(03).
FD-CF-SAT                     PIC X(03).
First 3 chars for the month, Next 1 char for the week(1,2,3,4), next 10chars for employee id, entered ID should have an entry in TSHRCI.PAYROLL.EMPFILE, next 02 chars are for bill codes we can use bill code for claiming over time valid values( 01 for basic claiming, 02 for leave hours, 03 for week day overtime, and 04 for weekend over time) these bill codes should have matching entry in TSHRCI.PAYROLL.PAYFILE  with band code of the employee. Next 7 fields of 3 characters are for daily hour claiming.

e.g. JAN1100000000101000008008008008008000

says: its for Jan First week, for employee ID 1000000001, basic hrs, and 0hrs  for Sunday, 8 hrs each for Monday, Tuesday, Wednesday, Thursday, Friday and 0hr for Saturday.

Now go to TSHRCI.PAYROLL.EMPFILE, File structure is given below.

05  FD-EF-EMPID              PIC X(10).
05  FD-EF-FNAME             PIC X(10).
05  FD-EF-LNAME             PIC X(10).
05  FD-EF-ADD1                PIC X(10).
05  FD-EF-ADD2                PIC X(10).
05  FD-EF-PH                    PIC X(13).
05  FD-EF-DOJ                  PIC X(10).
05  FD-EF-DOB                  PIC X(10).
05  FD-EF-LASTPAYED      PIC X(10).
05  FD-EF-EMPMODE        PIC X(03).
05  FD-EF-STATUS            PIC X(03).
05  FD-EF-PAYMODE        PIC X(01).
05  FD-EF-BAND               PIC X(02).

First 10 bytes for employee id, next 10 for first name and next 10 for last name, next 10 for address line1 and next 10 for address line2, next 13 bytes for phone number, next 10 bytes for date of birth,, next 10 bytes for last paid month its for future enhancement. next 3 bytes for employment mode valid values are per for permanent and con for contract. next 3 bytes for status 001 is active and 002 is resigned, next 2 bytes for band can have any value but the band value should have a matching entry in TSHRCI.PAYROLL.PAYFILE.

image

Now go to TSHRCI.PAYROLL.FLECPYBK

This data set contains the file structures of all data sets, It has been created to refer the files at any point of time if you do not access to our web sites, and to avoid to messing up our code B)

Now go to TSHRCI.PAYROLL.JCLS

This PDS contains the JCL’s for compiling our code, running our application, creating GDG’s and deleting GDG’s. GDG operations has been explained in Step 5.

BATCHBOB.

This JCL can used to compile the cobol application, if the IGYWCL proc is in the 'SYS1.ADMIN.PROCLIB' and IGYWCL has been undergone some tweaks to accept member name, srce lib and load lib parms. right now this is the only cause in IBM internal training machines.

COBCPL.

I believe this JCL must work in almost all the mainframes that has IBM Cobol version 4.1.  this job directly call the IGYWCl which is the part of COBOL ver 4.1 so  it should work without making any noises.

“If you have any issues with writing compile JCL for our project please write back to  me at shibu@hotmail.co.in  I can always help you to get a fully functional compile JCL"

Execpgm

This JCL is for executing our application. If you go to this JCL you can see that I have commented out a couple of lines (//*           VOL=SER=EUTDSD,) these are the volume serial numbers, since my machine is SMS managed I do not have to worry about the vol ser numbers, SMS will take care of it.

If your site is not SMS managed you have to un comment these line and change the volume serial number to the volume where GDGs resides. If you go to ISPF 3.4 option you can see volume at the right side of your dsn, see the below screen shot, for TSHRCI.PAYROLL.JCLS the vol ser is ETRU03.

image

GDG and GDGDEL

These are the JCLS for creating and deleting GDGs. PLease refer to Step 5 for more information.

Now go to TSHRCI.PAYROLL.PAYFILE

“Soon you opened the dataset please enter num off command in order to avoid any data lose"

This file is all about the MONEY, we have to declare the hourly charge for different bands.

File structure is

05  FD-PF-BAND                 PIC X(02).
05  FD-PF-HOURLY             PIC X(04).
05  FD-PF-DAILY                 PIC X(04).
05  FD-PF-MONTHLY           PIC X(06).
05  FD-PF-OVERTIME          PIC X(03).
05  FD-PF-LEAVE                PIC X(04).
05  FD-PF-WEEKENDOT     PIC X(03).

First 2 bytes are for Ban number, next 04 bytes are for per hour charge for normal (8hrs per day) work hours if the guy is working as per hour plan, next 4 bytes are for per hour charge normal (8hrs per day) work hours if the employee is working in daily wage plan, and next 4 bytes are for per hour charge for normal work hours(8hrs per day) if the employee is working in monthly wage plan. next 3 bytes are the amount needs to bill if the employee worked week day over time. Next 4 bytes are the amount needs to charge if the employee went on vacation ( normally no company will reduce any amount from salary, so we) . next 3 bytes are for the amount needs to charge if the employee worked on weekend over time.

e.g. 05020010000300003000200100

The above line says band is 05, 200 for hourly wage, 1000 for daily wage, 3000 for monthly wage, 300 if employee was on week day over time, 200 if employee was on leave/vacation, and 100 if employee worked on weekend over time.

Now go to TSHRCI.PAYROLL.SOURCE

PDS contains the source code, you have all the freedom to work on the source code.

Please do not change the Author name!

Step 7 Most important: create load lib

Load lib is the pds where our compile and exec pgm JCL are pointing to. So let create it. This PDS will be same for all our projects so don’t be a miser, allocate few cylinders.

Go to ISPF 3.2 screen fill the screen as below

image

press enter

Ignore the management class, storage class, volume serial, device type, data class and fill out the remaining fields as in below screenshots

image

Press enter to finish it up.

image

We are done with the setups. now lets go and run the code!.

Step 8. Run the code

If you want you can edit claim file, if you want to claim your own billed hrs. but don't forget to add your own employees and band details also. Other wise app will abend!. :D. PLease be aware the code will work fine with the provided data.

Now go to TSHRCI.PAYROLL.JCLS and submit compile JCL

image

compile JCL should return MAXCC 0

after that submit EXECPGM jcl.

image

our program will return maxx cc 0, almost in all the cases, please review the data sets again if you have made any changes (Refer 5 and 6 to know the file structures and GDGs)

Go to spool and verify the claims processed  flow and the data (if needed)

image

Now, its the time review the GDGs

Pay slip

Go to ISPF 3.4, DSNAME level TSHRCI.PAY* and open the latest TSHRCI.PAYROLL.PAYSLIP.GROUP.* gdg.

and you can see the pay slips generated for our employees, of the inputted month.

image

XMLLOG

go to ISPF 3.4, DSname level TSHRCI.PAY* and open the latest version of TSHRCI.PAYROLL.XMLLOG.GROUP

image

That' is it. keep exploring the project, do tweaking, but do not forget to write to me your experiences and your doubts or what ever related to mainframes at shibu@hotmail.co.in