Skip to content

bbenz/java-is-fun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

java-is-fun

This repo houses small Java applications that can be used to learn Java if you don't already know it, or learn new features that you haven't seen before if you do.

It is a Java port of the cobol-is-fun code patterns. Each sample was translated from IBM Enterprise COBOL into standard, modern Java so you can run it on any machine with a JDK — no z/OS, JCL, or mainframe access required. The original COBOL behavior, including its formatted output, has been preserved.

Prerequisites

json-parse

This simple Java application demonstrates how to parse JSON using the Jackson library, the Java equivalent of the COBOL JSON PARSE statement. It is written to work in a standalone fashion so it can run without any input files. The JSON strings are declared in memory, as are the objects that hold the results of the parse, and everything is printed out for clarity.

See json-parse/README.md.

my-first-program

This application shows how well Java works with data. It reads lists from three input files, merges them all together, and sorts them. The application then writes the sorted list to an output file. All this in just a few statements using the Java Collections framework.

See my-first-program/README.md.

Mapping from COBOL to Java

COBOL concept Java equivalent in this repo
JSON PARSE statement Jackson ObjectMapper.readValue
MERGE / SORT statements List.addAll + List.sort with a Comparator
Working-storage PIC clauses POJO fields plus formatting helpers
Edited PIC display formatting DecimalFormat / String.format helpers
JCL compile / bind / execute mvn package and java -jar

License

This code pattern is licensed under the Apache License, Version 2. Separate third-party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 and the Apache License, Version 2.

Apache License FAQ

About

Java port of IBM's cobol-is-fun learning samples (json-parse + fxsort)

Resources

License

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages