You are on page 1of 7

RAPID APPLICATION DEVELOPMENT

Using Synon

CYRUS AZARBOD, PH.D.

TABLE OF CONTENTS

PREFACE……………………………………………………………………..………… vi

CHAPTER ONE – INTRODUCTION……………………………………………… 1


AS/400 BACKGROUND ………………………………………………………………………………. 1
COURSE SCHEDULING SYSTEM (CSS) ……………………………………………………………. 1
OVERVIEW OF SYNON CASE TOOL ……………………………………………………………….. 2
OVERVIEW OF THE BASIC FEATURES OF SYNON ……………………………………………… 2
SOME USEFUL FUNCTIONS/COMMAND KEYS ………………………………………………….. 2
ENTERING AND EXITING THE SYNON MODEL …………………………………………………. 3
EXERCISE ….……………………..……………………………………………………………………. 6

CHAPTER TWO – RELATIONS, FIELDS, AND ACCESS PATHS ………….. 1

OBJECTIVES ………………………………………………………………………………………….. 1
Adding Relations and Defining Objects ………………………………………………………… 1
Overriding Default Field Details ……………………………………………………………….. 7
CHANGING THE DATA MODEL …………………………………………………………………… 10
Changing Existing Relations …………………………………………………………………… 10
Delete Fields ……………………………………………………………………………………. 11
Deleting Relations ……………………………………………………………………………… 11
An Example for Deleting a File ………………………………………………………………… 11
To Delete a File From the Model ………………………………………………………………. 12
FIELD CONDITIONS ………………………………………………………………………………… 12
EXERCISE ………………………………………..…………………………………………………… 16
Extending Synon Relations (“For Text” and “Sharing”) ………………………………………. 17
VIRTUAL FIELDS ……………………………………………………………………………………. 22
EXERCISE ……..……………………………………………………………………………………… 24
ACCESS PATHS ………………………………………………………………………………………. 25
Generate and Compile Default Access Paths …………………………………………………… 25
SUMMARY – FUNDAMENTAL CONCEPTS OF SYNON ………………………………………… 30
SYNON RELATIONS …………………………………………………………………………………. 30
Synon Relation Types …………………………………………………………………………… 30
KNOWN BY …………………………………………………………………………….. 30
HAS ……………………………………………………………………………………… 30
OWNED BY …………………………………………………………………………….. 30
REFERS TO …………………………………………………………………………….. 31
EXTENDED BY ………………………………………………………………………… 31
INCLUDES ……………………………………………………………………………… 31
QUALIFIED BY ………………………………………………………………………… 32
DEFINED AS ……………………………………………………………………………. 32

i
FIELDS …….…………………………………………………………………………………………… 32
FIELD CONDITIONS …………………………………………………………………………………. 33
FILE TYPES ….………………………………………………………………………………………… 33
RCD (Record Format) Files ……………………………………………………………………... 34
EXTENDING RELATIONS WITH “SHARING” AND “FOR TEXT” PARAMETERS …………….. 34
ACCESS PATH ………………………………………………………………………………………… 35
Access Path Types ………………………………………………………………………………. 36
PHY (Physical) …………………………………………………………………………… 36
UPD (Update) …………………………………………………………………………….. 36
RTV (Retrieval) …………………………………………………………………………… 36
SPN (Span Access Path) ………………………………………………………………….. 36
RSQ (Resequence) …………………………………………………………………………36
QRY (Query) ……………………………………………………………………………… 36
Major Features of the Access Path Types ……………………………………………………….. 37
Access Path Relations …………………………………………………………………………… 37
VIRTUAL FIELDS …………………………………………………………………………………….. 38
ACCESS PATH SELECT/OMIT CRITERIA ………………………………………………………….. 39

CHAPTER THREE - FUNCTIONS ………………………………………………. 1


OBJECTIVE ……………………………………………………………………………………………. 1
EDIT FILE (EDTFIL) FUNCTION …………………………………………………………………….. 2
Device Design ……………………………………………………………………………………. 3
Other Things to Try ……………………………………………………………………………… 10
Generate and Compile the Function …………………………………………………………….. 11
Diagnosing Errors ……………………………………………………………………………….. 13
Select Record Function (SELRCD) ……………………………………………………………… 13
EXERCISE ….……….…………………………………………………………………………………. 14
Specifying NO CHECK for an “Extended by” Relation ………………………………………… 15
CONVERTING CONDITION VALUES TO A DATABASE FILE ………………………………….. 16
Executing a Program ……………………………………………………………………………. 17
EXERCISE ………………..…………………………………………………………………………… 18
Edit Record Function ……………………………………………………………………………. 19
EDIT TRANSACTION (EDTTRN) FUNCTION ……………………………………………………… 21
Span (SPN) Access Path ………………………………………………………………………… 21
Defining the Edit Transaction Function ………………………………………………………… 25
EXERCISE …..………………………………………………………………………………………… 28
ASSIMILATION ………………………………………………………………………………………. 29
Link the Assimilated Tables to the Existing Synon Tables …………………………………….. 38
Expanding the Assimilated Table ………………………………………………………………. 39
EXERCISE ……..……………….……………………………………………………………………… 40

CHAPTER FOUR – A BASIC REPORT FUNCTION ………………………………… 1


RESEQUENCE (RSQ) ACCESS PATH ………………………………………………………………. 2
DESIGNING THE REPORT LAYOUT ……………………………………………………………….. 5
EXERCISE …..………………………………………………………………………………… 8
QUERY FACILITIES …………………………………………………………………………………. 9
Synon Query Facilities …………………………………………………………………………. 9
Generate & Compile the Function ………………………………………………………………. 14
Selection of Records with Conditions ………………………………………………………….. 15
Query (Query/400) ………………………………………………………………………………. 21
CONCEPTS OF REPORT FUNCTIONS ……………………………………………………………… 21

ii
KEY FIELDS AND HEADER RECORDS ……………………………………………………………. 21
Device Structure …………………………………………………………………………………. 22
EXERCISE ..…………………………………………………………………………………………… 23

CHAPTER FIVE – MENUS (SYNON/1E) ………………………………………………… 1


SCREEN DESIGN AIDE …………………………………………………………………………….. 4
EXERCISE …………….……………………………………………………………………………….. 5
CONCEPTS OF MENU DEVELOPMENT USING Synon/1E ……...………………………………… 6
Creating a Menu Design File ……………………………………………………………………. 6
Editing the Menu Designs in the File……………..……………………………………………… 7
Displaying Menus ……..………………………………………………………………………… 10
AUTOMATIC GENERATION OF CURRENT DATE ………………………………………………. 13
INCREMENTING A DATE WITH A FIXED NUMBER OF DAYS ………………………………… 15

CHAPTER SIX – ACTION DIAGRAMMING …………………………………………… 1


SIMPLE ACTION DIAGRAMMING ………………………………………………………………….. 1
Overview of Action Diagram Components ……………………………………………………… 1
Field Validation and Error Message Function …………………………………………………… 4
USER EXIT POINTS…………………………………………………………………….. 5
ACTION DIAGRAM CONSTRUCTS …………………………………………………… 6
SEND ERROR MESSAGE (SNDERRMSG) FUNCTION ……………………………… 8
CONCEPT OF ACTION DIAGRAMMING …………………………………………………………… 20
Action Diagram Constructs ……………………………………………………………………… 20
Default Action Diagrams ….…………………………………………………………………….. 22
Action Diagram Editor …………………………………………………………………………… 23
COMMANDS …………………………………………………………………………….. 23
Using the Action Diagram Editor ……………………………………………………………….. 24
INSERTING CONSTRUCTS …………………………………………………………… 24
DELETING CONSTRUCTS……………………………………………………………… 25
COPYING AND MOVING CONSTRUCTS …………………………………………… 25
ENTERING CONSTRUCT DETAILS …………………………………………………… 26
COMMANDS WHICH AFFECT THE DISPLAY ……………………………………… 27
EDITING FUNCTION PARAMETERS ………………………………………………… 27
Action Diagram Contexts ………………………………………………………………………… 28
HARDCOPY DOCUMENTATION …………………………………………………………………… 38

CHAPTER SEVEN- LINKING FUNCTIONS ……………………………………. 1


OBJECTIVE …………………………………………………………………………………………….. 1
LINKING FUNCTIONS USING THE SUBFILE SELECTOR ……………………………………….. 1
*Move Built-In Function and Defer Confirm ……………………………………………………. 10
Amending the Command Key and Subfile Selection Text ………………………………………. 11
Function Options ………………………………………………………………………………… 14
EXERCISE ……………………………………………………………………………………………… 16
LINKING FUNCTIONS USING A COMMAND KEY ………………………………………………. 17
Steps Involved in Linking Functions ……………………………………………………………. 18
DEFER UPDATE ………………………………………………………………………… 24
Linking Function Using Option Key …………………………………………………………….. 27
Steps in Developing Linking Functions Using Options …………………………………………. 27

iii
DEFER UPDATE ………………………………………………………………………… 34
FUNDAMENTAL CONCEPTS OF FUNCTION PARAMETERS …………………………………… 35
MAP ……………………………………………………………………………………………… 36
Restrictor ………………………………………….……………………………………… 37
Positioner ………………………………………………………………………………… 38
Vary ……………………………………………………………………………………… 38
Practical …………………………………………………………………………………………. 39
Function Options ………………………………………………………………………………... 39
DATABASE CHANGES ………………………………………………………………… 40
DISPLAY FEATURES ………………………………………………………………….. 40
EXIT CONTROL ………………………………………………………………………… 41
COMMIT CONTROL AND ERROR HANDLING ……………………………………… 41
STANDARD FUNCTION TYPES ………………………………………………………………………41
Database Functions ………………………………………………………………………………. 42
CREATE OBJECT (CRTOBJ) FUNCTION …………………………………………… 42
RETRIEVE OBJECT (RTVOBJ) FUNCTION …………………………………………. 46
DELETE OBJECT (DLTOBJ) FUNCTION ………………………………………………47
CHANGE OBJECT (CHGOBJ) FUNCTION …………………………………………… 49
Record Functions ……………………………………………………………………………….. 51
EDTRCDn ………………………………………………………………………………… 51
DSPRCDn ……………………………………………………………………………….. 52
SELRCD …………………………………………………………………………………. 52
PMTRCD ………………………………………………………………………………… 52
File Functions …………………………………………………………………………………… 53
EDTFIL ………………………………………………………………………………….. 53
DSPFIL …………………………………………………………………………………… 54
SELRCD ………………………………………………………………………………….. 55
Transaction Functions …………………………………………………………………………… 56
EDTTRN …………………………………………………………………………………. 56
DSPTRN …………………………………………………………………………………. 56
Report Functions ………………………………………………………………………………… 57
USER-DEFINED FUNCTIONS …………………………………………………………………………58
Execute External Function (EXCEXTFUN) …………………………………………………….. 58
Execute Internal Function (EXCINTFUN) ……………………………………………………… 59
Execute User Program (EXCUSRPGM) ………………………………………………………… 59
Execute User Source (EXCUSRSRC) …………………………………………………………… 61
BUILT-IN FUNCTIONS ……………………………………………………………………………….. 61
Arithmetic Functions …………………………………………………………………………… 61
Move Functions …………………………………………………………………………………. 62
Program Control Functions ……………………………………………………………………… 63
FUNCTION FIELDS …………………………………………………………………………………… 64
MESSAGE FUNCTIONS ……………………………………………………………………………… 66
Sending Messages to a User …………………………………………………………………….. 66
CMP (COMPLETION MESSAGES) …………………………………………………… 67
INF/STS (INFORMATION/STATUS MESSAGES) …………………………………… 67
ERR (ERROR MESSAGES) ………………………………………………………………67
Executing Commands from a Message ………………………………………………………… 67
Retrieving Message Text into a Field …………………………………………………………… 67
Creating Message Functions ……………………………………………………………………. 68

CHAPTER EIGHT – MORE FEATURES OF REPORT FUNCTIONS ……….. 1


OBJECTIVE ……………………………………………………………………………………………. 1
COUNT (CNT) FUNCTION FIELDS …………………………………………………………………. 1
CUR/NXT ACTION DIAGRAM CONTEXTS ………………………………………………………… 6

iv
PRINT OBJECT FUNCTION ………………………………………………………………………….. 8
QUERY (QRY) ACCESS PATH ………………………………………………………………………. 8
PRTOBJ DEVICE DESIGN ……………………………………………………………………………. 12
SUM FUNCTION FIELD ………………………………………………………………………………. 14
EXERCISE ……………………………………………………………………………………………… 17
EMBEDDING THE PRTOBJ IN THE DEVICE STRUCTURE OF THE PRTFIL …………………… 18
MODIFYING THE COMBINED REPORT DEVICE DESIGN ……………………………………… 20
DEFINING PARAMETERS FOR THE PRTOBJ FUNCTION ……………………………………… 21
CONFIRM PARAMETERS FOR THE PRTOBJ FUNCTION ….…………………………………… 22
AN EXAMPLE OF THE FINAL REPORT …………………………………………………………… 25
IMPLEMENTING THE SAME REPORT WITH A SELECT/OMIT CONDITION ………………… 26
EXERCISE …………………………………………………………………………………………….. 33
Continuing with Report Functions …..………………………………………………………… 34
ADDING A USER INTERFACE TO THE REPORT FUNCTION USING PROMPT & VALIDATE 36
Setting Function Parameters . ………………………………………………………………….. 36
Creating the PMTRCD Function ……………………………………………………………….. 37
Editing the Action Diagram ……………………………………………………………………… 39
Change “Repeat Prompt” Function Option to “Y” ……………………………………………… 43
EXERCISE ……………………………………………………………………………………………… 44

Appendix A
Data Model Diagram for the Course Scheduling System – Version 1
Data Model Diagram for the Course Scheduling System – Version 2
Data Model Diagram for the Course Scheduling System – Version 3

Appendix B
Use of Semantic Data Modeling in Design of Databases

Appendix C
Over view of Database Models

Appendix D
Conversion of SDM to Relational Database

Appendix E
Query 400

Appendix F
Synon Map

Appendix G
Query Manager

Appendix H
AS/400 Menu Using SDA

References

Index

v
PREFACE
In today’s highly competitive business environment, increasing productivity is a major goal and
concern of any enterprise. More and more IS managers are turning to low end CASE tools or fourth
generation languages (4GLs) as a means of Rapid Application Development (RAD). Working knowledge
of RAD tools is considered a very important competitive edge for students, employees and information
technology/system organizations. Rapid Application Development in AS/400 with Synon offers a hands-
on tutorial in the use of Synon as well as building major block concepts of this tool. Synon is one of the
leading 4GL tools for the AS/400 environment in industry today. This books is ideally suited for people
wishing to learn the basic components of Synon while building a comprehensive project dealing with an
academic course scheduling system. The text assumes some familiarity with the system analysis and
design development process and also some knowledge of AS/400. In this book, every chapter has tutorials
and concepts. A summary of important concepts is presented in the form of concept diagrams. Concept
diagrams are easily distinguished by their border and font. As you use this book, every instruction needed
to develop your CSS application is provided.
Chapter one briefly introduces the Synon CASE tool and AS/400. Chapter two addresses the
process of defining data model files, field types, and access paths. Chapter three is assigned to develop and
compile default functions and assimilate existing data files in AS/400 into a Synon model. Chapter four
provides an introduction on report functions and query facilities in Synon and AS/400. In chapter five, the
process of designing menus in Synon is introduced. Chapter six introduces the procedural language of
Synon which is called Action Diagram. Some simple examples are presented in a step by step process to
demonstrate how action diagram codes can be developed. Chapter seven deals with linking functions using
several methodologies. Every step needed to develop a method is demonstrated. In chapter eight, more
complex reports, interactive program development, and other features are presented. Several
comprehensive appendices are provided to support a variety of topics such as various versions of the CSS
model, Semantic Data Modeling (SDM), a relational database, conversion of a SDM into a Synon data
model, and AS/400 utilities such as Query 400, Query Manager and SDA.
This book is intended to be a self study guide with Synon/2E so that the reader can develop a
working application as they familiarize themselves with Synon.
Please fill out the detachable form at the end of the book and register with us to receive
information about future publications and analysis on Synon’s future releases. I would appreciate any
feedback concerning the material covered and any other enhancements that you would like to see for future
publications.

Cyrus Azarbod
301 Madison Avenue, Suite 111
Mankato, MN 56001
Tel : (507) 345-4636
Fax : (507) 387-7472
Info@infogem.com
www.infogem.com

ACKNOWLEDGEMENTS
It is a great pleasure to thank the many people involved, directly or indirectly, in the creation of
this book. The comments and tireless efforts of my students were most helpful in shaping the text.
Especially helpful were Mr. Yank Kho, who graduated in 1993, for his significant contribution for the very

vi
first document that we put together for students in 1992. Others from Mankato State University are David
Korman, Srininan, Hassan, Yanto, Boby Islam, Tony Malarz, Vinita, Sriram, and Nick Morales.
I also appreciate the work of those at Paragon Graphics for their support and efforts in helping to
bring this book to publication.
Finally, a special thanks go to my wife, Cheryl, who tirelessly put up with my long hours, and
helped me with editing, organizing, typing, and managing this project.

vii

You might also like