Preface to the Second Edition... xi A Note About Source Entry... xi

Similar documents
About the Authors. Preface

Procedures and Parameters

[CHAPTER] 1 INTRODUCTION 1

544 Programming in RPG IV, Fourth Edition

Chapter 3 EXPRESSIONS

Vendor: IBM. Exam Code: Exam Name: ILE RPG Programmer. Version: Demo

BASIC ELEMENTS OF A COMPUTER PROGRAM

Table of Contents at a Glance

APPLICATION MODERNIZATION. Brian May IBM i Modernization Specialist

JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1)

CS313D: ADVANCED PROGRAMMING LANGUAGE

QUESTION BANK: INTRODUCTION TO PROGRAMMING (HCS102) a. Compare and contrast unboxing and widening using code snippets [10]

Externally Described SQL -- An SQL iquery API

Exam Code: Exam Name: ILE RPG Programmer. Vendor: IBM. Version: DEMO

This course is designed for web developers that want to learn HTML5, CSS3, JavaScript and jquery.

C Programming for Electronic Engineers

Understanding the Concepts and Features of Macro Programming 1

Contents. part 1: ILE Basics...7. Acknowledgments...iv

Practical C++ Programming

ENGINEERING PROBLEM SOLVING WITH C++

Introduction to C++ Introduction. Structure of a C++ Program. Structure of a C++ Program. C++ widely-used general-purpose programming language

Getting Session Started A58 with APIs. from RPG

INDEX. A Absolute Value of Expression (%ABS), 26, 27 activation groups for database triggers, 257, 267, 279

CERTIFICATE IN WEB PROGRAMMING

Introduction to C++ with content from

Fundamental Data Types. CSE 130: Introduction to Programming in C Stony Brook University

5/23/2015. Core Java Syllabus. VikRam ShaRma

EVALUATION ONLY. Table of Contents. iv Labyrinth Learning

Computer Programming C++ (wg) CCOs

This is a sample chapter from Brad Stone s training e-rpg Powertools Stone on CGIDEV2 Get your copy of this important training now.

Name :. Roll No. :... Invigilator s Signature : INTRODUCTION TO PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70

INDEX

C Refresher, Advance C, Coding Standard, Misra C Compliance & Real-time Programming

HUDSONVILLE HIGH SCHOOL COURSE FRAMEWORK

Contents. Acknowledgments

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p.

Control Flow. COMS W1007 Introduction to Computer Science. Christopher Conway 3 June 2003

CvtRPGIV S. 160 th St. Ste. #401 Omaha, NE Telephone: (402) Toll free: (800)

Intrinsic Numeric Operations

Contents. Preface. Introduction. Introduction to C Programming

Microsoft. Microsoft Visual C# Step by Step. John Sharp

C: How to Program. Week /Mar/05

c++ keywords: ( all lowercase ) Note: cin and cout are NOT keywords.

Django with Python Course Catalog

Exceptions! Users can t live with em Programmers can t live without em. i want stress-free IT. i want control. i want an i IBM Corporation

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

Jim Buck Phone Twitter

PYTHON PROGRAMMING. John M.Zelle. Wartburg College AN INTRODUCTION TO COMPUTER SCIENCE SECOND EDITION

Language. f SQL. Larry Rockoff COURSE TECHNOLOGY. Kingdom United States. Course Technology PTR. A part ofcenqaqe Learninq

Accuplacer Arithmetic Study Guide

Chapter 2 - Introduction to C Programming

Externally Described SQL -- An SQL iquery API

С and the Programming for Multitasking. Thomas W. Schultz. Purdue University West Lafayette, Indiana

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS

Today s Webinar is being recorded You ll receive a follow-up with the recording Q&A after the presentation Ask questions throughout the Webinar

Programming. C++ Basics

Programming in Python 3

Ordinary Differential Equation Solver Language (ODESL) Reference Manual

Chapter 2 Basic Elements of C++

YOLOP Language Reference Manual

Pace University. Fundamental Concepts of CS121 1

Welcome to Teach Yourself Acknowledgments Fundamental C++ Programming p. 2 An Introduction to C++ p. 4 A Brief History of C++ p.

Organization of Programming Languages (CSE452) Why are there so many programming languages? What makes a language successful?

CHAD Language Reference Manual

Contents. Acknowledgments Introduction

IBM ILE RPG Programmer. Download Full Version :

Full file at

An Introduction to MATLAB

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal

CSCI 131, Midterm Exam 1 Review Questions This sheet is intended to help you prepare for the first exam in this course. The following topics have

Oracle BPM 10g R3 Programming 1 Essentials

MATLIP: MATLAB-Like Language for Image Processing

Essential MATLAB for Engineers and Scientists

Data Science with Python Course Catalog

JME Language Reference Manual

Introduction to Programming Using Java (98-388)

Preface to the Second Edition Preface to the First Edition Brief Contents Introduction to C++ p. 1 A Review of Structures p.

Introduction to C Programming. Chih-Wei Tang ( 唐之瑋 ) Department of Communication Engineering National Central University JhongLi, Taiwan

Contents I Introduction 1 Introduction to PL/SQL iii

Murach s Beginning Java with Eclipse

Conditionals and Loops

Live Tweet. Getting Started. My Twitter. Company Twitter. Hashtag for #AppMod4i

Introduction to JavaScript p. 1 JavaScript Myths p. 2 Versions of JavaScript p. 2 Client-Side JavaScript p. 3 JavaScript in Other Contexts p.

Contents. Introduction

CS61C Machine Structures. Lecture 4 C Pointers and Arrays. 1/25/2006 John Wawrzynek. www-inst.eecs.berkeley.edu/~cs61c/

Ryan Stephens. Ron Plew Arie D. Jones. Sams Teach Yourself FIFTH EDITION. 800 East 96th Street, Indianapolis, Indiana, 46240

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17

Introduction. C provides two styles of flow control:


System i CGI Toolkits

Programming II (CS300)

Course Syllabus. Course Title. Who should attend? Course Description. PHP ( Level 1 (

Absolute C++ Walter Savitch

Chapter 4: Conditionals and Loops

"Charting the Course to Your Success!" MOC B Programming in C# Course Summary

Error Code. GO Software Pty Limited Map: 27 Tacoma Blvd, Pasadena SA 5042 ABN: ACN:

Fundamental of Programming (C)

Learning C# 3.0. Jesse Liberty and Brian MacDonald O'REILLY. Beijing Cambridge Farnham Köln Sebastopol Taipei Tokyo

A Web-Based Introduction

Lecture 2: Variables and Operators. AITI Nigeria Summer 2012 University of Lagos.

Transcription:

Contents Preface to the Second Edition... xi A Note About Source Entry... xi Chapter 1: Pre Free-Format RPG IV... 1 RPG IV... 1 Extended Factor 2... 2 Built-in Functions... 2 Subprocedures... 3 Other Changes... 3 Some Baggage That Came Along... 4 The Future... 4 Chapter 2: The Case for Free-Format RPG... 7 Easier to Read and Maintain... 7 Good Field Naming... 8 Indenting... 10 Use of Comments... 10 No Goto Operations... 11 Conclusions... 11 A Modern Programming Style... 12 Free-Format RPG IV and C... 12 Free-Format RPG IV and Java... 13 Conclusions... 14 Being Current... 14 The Programmer s Perspective... 14 Management s Perspective... 15 Conclusions... 15 Check It Out... 15 Chapter 3: Free-Format H, F, D, and P Specifications... 17 The H (Control) Specification... 17 The F (File) Specifications... 18

vi Free-Format RPG IV The D (Definition) Specifications... 20 The P (Procedure) Specification... 24 Conclusions... 25 Chapter 4: Introducing Free-Format RPG IV... 27 Coding Free-Format Calculations... 28 Naming Variables... 29 Programming Style... 30 A Note About Case... 30 Free-Format Operation Codes... 31 Evaluate... 34 If... 35 Controlled Looping... 37 Mathematics... 38 Character Strings... 38 Programming Style Issues... 39 Mixing Formats... 39 Keyed Access... 42 Named Indicators... 43 Naming File Indicators... 43 Summing Up... 44 Chapter 5: Input/Output Using Free Format... 47 Database Input... 47 %Eof... 48 %Found... 49 %Error... 50 %Equal... 51 Data Area Input... 52 Database Output... 52 Write... 52 Update... 53 Delete... 53

Contents vii Except... 53 Workstation I/O... 54 Write/Read... 54 Write... 55 Read... 55 ICF I/O... 55 Dsply... 55 Printer Output... 57 Overflow Indicator... 57 Write... 57 Except... 57 Chapter 6: Program Flow Using Free Format... 59 The If Group... 59 If... 59 Else... 62 Elseif... 62 Endif... 62 The Do Operations... 63 Do While... 63 Do Until... 64 Dow and Dou Differences... 64 For... 65 Loop Interrupt... 66 Leave... 66 Iter... 67 The Select Group... 68 Select... 68 Operations Absent in Free Format... 69 Chapter 7: Embedded SQL Operations Using Free Format... 71 Database and Embedded SQL... 71

viii Free-Format RPG IV Fixed-Format Method... 71 Free-Format Method... 73 Chapter 8: Data-Manipulation Operations Using Free Format... 75 Assignment Statements... 75 Eval Operation: Numeric... 76 Eval Operation: Character... 77 Evaluate Right (EvalR) Operation... 78 Eval Operation: IS,OC... 78 Evaluate vs. Move... 79 Built-in Functions... 79 Converting Decimal to Character... 80 Converting Character to Packed Decimal... 81 Substringing... 82 Replace... 83 Scan and Replace... 84 Concatenation and Trim... 85 Converting Character to Integer... 86 Extracting Size, Length, and Decimal Positions... 87 Number of Elements... 88 Looking for Something?... 89 String Translation... 90 Combining Built-in Functions... 91 Date and Time Operations... 92 Converting Numbers to Date and Time... 92 Converting Date and Time to Character or Decimal... 93 Date and Time Arithmetic... 94 Chapter 9: Math Operations in Free Format... 97 Expressions in Assignment Statements and Elsewhere... 97 Four-Function Math... 98 Short-Form Math... 98 Exponentiation... 100

Contents ix Precedence... 101 Mathematical Expressions Elsewhere... 102 Eval Differences in Fixed and Free Format... 102 Naming Variables... 103 Semicolon... 104 Free-Format Math in RPG IV... 104 Numeric Data Types... 105 Changing Data Type... 105 Chapter 10: Call and Return in Free Format... 107 Call Prototyped (CallP) Operation... 107 Dynamic Call... 108 Bound Call... 109 Parameter-Passing Options... 110 Value... 110 Const... 111 Options(*NoPass)... 111 Options(*Omit)... 111 Options(*Varsize)... 111 Options(*String)... 112 Options(*RightAdj)... 112 Options(*Trim)... 112 The Return Operation... 114 Subprocedures... 114 Accessing APIs... 115 API Examples... 116 Chapter 11: Solutions for Problem Situations... 119 Solution for the Fixed-Format MoveA Operation... 119 History... 119 The Free-Format Solution... 120 The %Subarr Built-in Function... 122 Solution for the Fixed-Format Move Operation... 123

x Free-Format RPG IV Breaking It Down... 123 When Both Fields Are Character... 123 Data Type Differences... 125 Solution for the Fixed-Format MoveL Operation... 125 Breaking It Down... 125 When Both Fields Are Character... 125 Solution for the Case Operation... 126 Solution for the Do Operation... 128 The Do Syntax... 128 The Free-Format Solution... 128 Error-Handling Techniques... 129 The Monitor Solution... 130 ILE Exception Handler... 131 Chapter 12: Sample Programs... 133 An Investment and Loan Utility Program... 133 A Customer Inquiry Program... 138 A Customer Data Entry Program... 140 A Sales Report Program... 145 Appendix A: Free-Format Operations... 151 Expression Operators... 151 Operation Extenders... 153 Free-Format Operations... 153 Appendix B: Example Screens, DDS, and Programs... 185 Investment and Loan Utility Program... 185 Customer Inquiry Program... 189 Customer Data Entry Program... 192 Sales Report Program... 199 Appendix C: Free-Format Alternatives for Fixed-Format Operations... 207 Index... 213