GithubHelp home page GithubHelp logo

raven300 / cobol-challenge-2---unemp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mlo8/cobol-challenge-2---unemp

0.0 0.0 0.0 36 KB

Unemployment Stats Challenge - Programs, JCL, Data

COBOL 100.00%

cobol-challenge-2---unemp's Introduction

Cobol-Challenge-2---UNEMP

Unemployment Stats Challenge - Programs, JCL, Data I love ☕.

My initial approach to Challenge #2, Unemployment Stats:

Step 1 • Created JCLUSTER.jcl to create KSDS VSAM file • Created JCLUSDEL.jcl to delete it • Because I don't appear to have a utility to view the VSAM file, I created a COBOL program UNEMPDB to read and view the contents of it • Downloaded 5 stat files from www.data.gov (in CSV format for now) and created 5 separate datasets for input • Created UNEMP.cbl program to process the 5 input files and populate the VSAM file • NOTES: ○ I used the UNSTRING function to extract the distinct fields from the CSV file and move them to the record elements. ○ I used STRING to swap the order of the Record Key from MMDDYYYY to YYYYMMDD so that it would sort properly. ○ Each of the 5 input files populate a portion of the records so… ○ When processing the first input file (claims by age) I used WRITE to populate the VSAM file because the written records are new ○ When processing subsequent input files I used REWRITE because by then the records exist and need to be updated... this was tedious, not sure if there is a better/easier way to do all of this.

Step 2 • Created simple dataset "UNEMPIN" to contain the user input selections of a Record Key and/or an All Records indicator (in the absence of an online app) • Created the main program (UNEMPMN) which reads UNEMPIN and passes these two user input data items to the first subroutine (UNEMPSB) which returns either a table (if All Records indicator is Y), or a single record (if All Records indicator is N and a valid record key is provided). • The first subroutine (UNEMPSB) calls one of two other subroutines (RTALLREC, or RTONEREC) depending on the AllRecords indicator.
• This is because if AllRecords is selected, I need to access the VSAM file sequentially in order to read through and retrieve all of the records (RTALLREC), but I need to access the VSAM file randomly in order to retrieve a single record based on the record key provided by the user (RTONEREC)… also tedious, not sure if there is a better/easier way to do all of this.

Step 3 • Main program (UNEMPMN) produces the output report in CSV format with headers and it is displayed through PRTLINE as well as printed to a dataset (UNEMPOUT) which can be brought into Excel for better formatting • Some very basic error handling is included.

Note: I created UNMPEXEC.jcl to execute the final program without having to compile it (to play with the input data)… UNMPSBMN.jcl compiles and runs the main program and subroutines.

cobol-challenge-2---unemp's People

Contributors

mlo8 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.