Running a little later on this second post because I had to write a 5250 green screen version of our timeclock punch program. Like most new things I do, I try to actually learn something new when I go forward with a new project. ALWAYS! So there is rarely any same ol, same ol when I write code. If you are writing the same code over and over for every application you create you are just a programmer. If you try a new approach or a new language feature every time you write an application then you are a developer. If you try new approaches and new language features and wholly new languages every time you develop an application, well, you are a nutcase like I am. But I thrive on new stuff so…..
OK! So here is what the application does:
When you run the app you see a screen with a Punch In, Punch Out, and Exit button (Using MOUBTN was the “new” thing for me). The screen displays the time, the date and the last punch on the clock. If you click on the ‘Punch IN’ button OR Press F6, an IN punch is recorded and the program exits. If you click on the ‘Punch OUT’ button OR press F7, an OUT punch is recorded and the program exits. If you click on the ‘Exit’ button OR press F3, the program exits.
The application screen looks like this:
MOUBTN may not be supported on your 5250 emulator and that is why I include the function keys as well. Also, you may say, “Where is the security here? Anyone who can run the program can punch in as employee 55”! Yep. You didn’t think I was going to do ALL the work for you did you? Besides that is a trivial plumbing job and would have to be adapted to your employee master file anyway.
So, where is the code? You can download the zip that contains the save file here:
The source is included in the save file and it was saved at V5R4M0 ( I am running 6.1 and 7.1 in two partitions). The text version of the program source can be found here and the text version of the DDS can be found here. It ain’t the prettiest code but the FBU (functional but ugly) approach always works for me.
Go ahead and run the program a few times to get the gist of it. It’s pretty simple and I plan to follow the KISS pattern for the remaining steps that take that 5250 stuff to the web and then mobile web world.
So you are still chomping at the bit to write some Mobile app code? Ok, Ok, I hear you. The next installment will be a web version of our 5250 Punch Clock program and from then on it just gets easier and easier….(honest).