/rpg-examples

This is an IBM RPG programming language examples repository

rpg-examples

This is an IBM RPG programming language examples repository

Notes on Free RPG

If you're using SEU, keep in mind that it does not behave well when you use full free-form syntax

Some activities

Basics and iterations

  1. Show on screen the first N numbers, given an arbitrary N.
  2. Show on screen the SUM of the first N numbers, given an arbitrary N.
  3. Show on screen the factorial of an arbitrary number N.
  4. Show on screen the first N numbers of fibonacci sequence, given an arbitrary N.
  5. Given an arbitrary number (N) determine if it is even.
  6. Determine if a given number N is a multiple of another number M.
  7. Given two arbitrary numbers N and M, calculate N^M.
  8. Given an arbitrary number (N), get the binary representation of it.
  9. Given two arbitrary numbers, M and N, get the n-base representation of M
  10. Given an arbitrary number N, determine if it is a prime number.
  11. Show on screen all the even numbers from 1 to N, given an arbitrary N.
  12. Print on screen the first N prime numbers, given an arbitrary N.
  13. Given a date in YYYYMMDD format, parse it to DDMMYYYY format

File managing

Sequential access

  1. Read a file and show it's records on screen.
  2. Read a file and count the amount of records.
  3. Read a file and calculate the sum of one numeric field.
  4. Read a file and calculate the product of one numeric field.
  5. Read a file and calculate the average of one numeric field.
  6. Read a file and update one column on all the records.
  7. Read a file and update one column on one specific record, based on a given Key.
  8. Mass insert records on a file.

Indexed access

  1. TO DO

Report Generation

  1. TO DO