Professional Documents
Culture Documents
Using Synon
TABLE OF CONTENTS
PREFACE……………………………………………………………………..………… vi
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
ii
KEY FIELDS AND HEADER RECORDS ……………………………………………………………. 21
Device Structure …………………………………………………………………………………. 22
EXERCISE ..…………………………………………………………………………………………… 23
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
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