Please select a topic

Change record size

CICS

Copy files

CSV files

DB2 / SQL

Delete Files

Dynamic Allocation

File Allocation

GDGs

General

Hardware

ISPF

JavaScript

PDS(E)

Print files

Python

RACF

Rename files

SDSF

SORT

TSO/E

Utilities

VSAM

WEB

z/OS UNIX

Commercial arithmetic in various languages



This is not actually a tutorial, but is a set of program examples which perform the same function in different programming languages. The task is to read a file of 80-byte images containing details of a number of model railway engines and do the following:

  1. Calculate the Gross Cost of all the models
  2. Calculate the Net Cost (by deducting 20% tax)
  3. Calculate the average price of each model, including tax.

Program source

 

Invoking Job Control Language


 

The results may vary due to differences in how the languages handle rounding when producing the two digits following the decimal place.

HTML 4.01 | CSS 2