WEBSITE FOR SYNON DEVELOPERS
Synon Mainframe Refresher
 

Synon FAQs

1. Type of Access Path.
Ans total 6 types of Access path. PHY, RTV, RSQ, UPD,SPN,QRY.
2. Why we will use Span Access path.
Ans Span Access path will be used to create Edit and Display Transaction functions. Using this we can populate and we can update two files at a time. (For ex:Join logical file.)
3. Difference between Internal Function and External Function.
Ans Internal functions are not independent programs these are kind of subroutines. We cannot generate (compile) internal functions independently; if we want we can include this in external functions or any other functions. External Functions are stand alone functions which can be compiled independently.
4. How many parameters we can pass in synon program.
Ans: We can pass 9 parmeters at a time. If we want to pass more than then we can use arrays, or whole access paths.
5. How many types of files we have in synon.
Ans : Reference file, capture file and Structure file these are important files.
6. Difference between these files.
Ans : Whenever you create Reference file. 5 functions will be created automatically. 3 internal functions (those are Create object, change object, delete object) and 2 external functions will be created(Edit file and select file).
7. Types of file to file relations.
Ans : Refers to, Owned by, includes.
8. Types of File to field relations.
Ans : Known by, has, qualified by.
9. How many function options we have it for Retrieve object.
Ans : Only one i.e. Share Sub routine (Yes or No)
10. What is the use of Share Sub routine.
Ans : If we make it as Yes, then if we are calling this retrieve obj in one program and in many places, instead of creating different different subroutines it will create only one subroutine.
11. How many user points we have it in retrieve object.
Ans :four user points.
12. How we can call external programs (outside cbl or cl pgms) in synon functions.
Ans : Using Execute User programs.
13. What are function options and what is the use.
Ans :we have many function options. For ex: Create object, change object, delete object, confirm prompt, commitment control. In Edit file function you want to disable delete functionality you can achieve this making "Delete object" as "No" in function options.
14. Different between LCL and WRK variables.
Ans : Local variables never holds any junk values if you are not initializing also. But WRK variables always holds the values. WRK are kind of Global variables.
15. How you will insert print object in printer file.
Ans : Using Option "T" on the printer file function.
16. In Printer file function what all are the Context you can see.
Ans : CUR, NXT, WRK, LCL etc. The important are CUR and NXT.
17. If you have retrieve object their you have two output variables in parameter list and in you functionality you do not want second output variable. What will you do, you will create one more retrieve object or any other solution.
Ans: Instead of creating new retrieve object you can use the same one, the one output variable which you do not want make it as NLL.

Some more Interview Questions on Synon.

Questions on File Types

1. Name the different File object attributes

File Name and File type:
ie. Name:Company Type:REF; Name:Order Type:CPT; Name:Audit Type: STR

REF – Database Reference File
CPT – Database Capture File
STR – Structure File (data structure)

2. What is a STR file used for?

A STR file is used for implementing a data structure of fields that are not logically included in a physical data file. An example would be audit information or job run type information (program name, user id, run time, etc.). It can also be used for passing parameters between functions.

3. What is a REF file?

A REF is a master file like customer or company. It contains static information that rarely changes and is typically referred to rather than appended to with additional records.

4. What are the pragmatic DDS differences between REF and CPT files?

CPT files will have CRTOBJ, DLTOBJ, and CHGOBJ functions automatically generated by Synon, all associasted with UPD access paths. REF files will also have SELRCD and EDTFIL functions automatically generated associated with RTV access paths. As a result, REF files will have additional DDS generated to accommodate the RTV access paths.

5. What is the definition of a CPT file?

A CPT (Capture file) is a transaction file like Order or Order Detail. It also contains static information but is dynamic in the sense that records are often appended to it and modified within it.

6. When you create a REF type file, what are the 5 functions that are automatically created by SYNON?

CHGOBJ – Change object
CRTOBJ – Create object
DLTOBJ – Delete object
EDTFIL – Edit File
SELRCD – Select Record

7. What is the difference between logical and physical files?

A physical file is where the data resides. A logical file provides a different view of the physical file allowing for different keys and sequencing.

8. What is an assimilated file?

An existing physical file that has been retrieved into a SYNON data model.

9. Name 2 object types.

FIL File
FLD Field

10. Name 5 relation types and their relation type level

DEFINED AS – FIL Declares that the file exists (Automatically created by Synon for each file)
EXTENDED BY – ATR Declares the file to have a one-to-one or one-to-none relationship with another file
HAS – ATR Declares the field as a data field on the file
INCLUDES – ATR Causes fields of the referenced file or included structures to be included as attributes in the referencing file
KNOWN BY – KEY Declares the field to be present as a key field on the file
OWNED BY – KEY Specifies that the keys of the owning file are to become major keys of the owned by file
QUALIFIED BY – KEY Declares a field to be present on file as a key field; is used with continuous variables
REFERS TO – ATR Causes the key fields of the referenced to be included as non-key fields on the referring file.

11. What are the types of SYNON Primary Key relations? Write them down in the order they should be sequenced.

Owned by
Known by
Qualified by
Has
Refers to
Includes

12. What are the types of foreign key SYNON relations (or file to file relations)?

Owned by
Refers to

13. What is the effect on a SYNON entity that has a File to File relationship with another entity?

Referential integrity between the entities is built into the functions built over the entities. Select Record functions are automatically built to provide F4 or ? lookups against the entities.

14. What are the benefits proved by File to File relations in a SYNON generated application?

You do not have to perform the validations in your action diagram. SYNON builds them in.

15. What is the data type that is most frequently used?

This will probably vary by data model but it should be the REF type so that field attributes and domains are inherited.

16. What data types do we NOT create REF data types for? Why?

DTE and TIM data types because the data type itself defines it is set of allowable values or domain.

17. How can multiple Refers To relationships be uniquely identified on an entity?

Use the FOR text or replace the field entries with correctly named fields.

18. How in SYNON is the term ‘SHARING’ used?

When you have relationships that have keys in common and you do not want to have additional occurrences of the key field, you may say that the 2 relationships should Share the key. Sharing *ALL is defaulted by SYNON so different versions of the same key field are not added to the entity.
When you do not want multiple versions of the same field as in the example ‘Employee refers to Employee for Supervisor and For Manager’, and Employee is KNOWN by Employee User ID, we want 3 of the Employee User ID field. You should specify *NONE for sharing to make this occur and use FOR text to differentiate each of the 3 occurrences.

19. In data modeling, what does SHARING *NONE mean?

The keys of the file being referred to are not shared by keys on the file has the ‘REFERS TO’ relation.

20. What is the impact of designating a file as a Capture or Reference file?

If you do not designate a file as a Capture or Reference file correctly, you are not describing the entity as well as you could. The only real impact is than an Edit File and Select Record function will get created automatically for a Reference File and in a Capture File, they will NOT get created automatically but you may do so manually.


Questions on Field Types

21. Name 8 field types.

Numeric
NBR – Number
PCT – Percentage
PRC – Price
QTY – Quantity
VAL – Value
DTE – Date
TME – Time
SGT – Surrogate
Alphanumeric
CDE – Code
DT# – *ISO Date
IGC – Ideographic
NAR – Narrative Text
TM# – Time
TS# – Time Share
TXT – Text
VNM – Valid System Name
Special Fields
REF – Reference
STS – Status

22. Name 4 field usages.

ATR – Attribute database file
CDE – Code
CNT – Count function field
DRV – Derived function field
MAX – Maximum function field
MIN – Minimum function field
SUM – Sum Function field
USR – User function field

23. What is a Derived field?

Any field that calculated from other fields rather than physically stored in the database.


24. How is a Derived field implemented in RPG?

Using a CALC specification.

25. How many output parameters can a derived function field have?

One the derived field itself.

26. What are ATR type fields?

ATR type fields are data attribute, non–key fields associated with a file. ie. Company Address in Company file.

27. What are CDE type fields?

CDE type fields are key fields associated with a file defined by a ‘Known By’ relation. Ie. Company Code in a Company file.

28. What are USR type fields?

Fields made by a programmer for a function that are not typically classified elsewhere and hold special values.

29. What are virtual fields and what are they used for?

A field, which is physically present on one file but logically, used on another file. These fields are most commonly used when a relationship is going to be checked numerous times.

30. Where can virtual fields be specified?

Virtual fields can only be specified on the ‘Owned by’, ‘Refers To’ and ‘Extended by’ relation types. Ie. Division is Owned by Company. Company fields can be virtualized to Division but Division fields cannot be virtualized to Company.

Questions on Access Paths
31. Name 4 types of access paths.

PHY Physical
QRY Query
RSQ Resequence
RTV Retrieval
SPN Spanned
UPD Update

32. What is the difference in the DDS between RTV, RSQ, and UPD?
• RTV – is in the physical file key sequence, includes virtual fields, can be edited to drop some or all non–key fields, and can define select or omit logic
• RSQ – includes all the functionality of RTV and allows for an alternative key sequence that does not need to be unique
• UPD – is in the physical file key sequence and includes all fields from related files except virtual fields

33. What OS/400 objects does the QRY access path create?

A physical file, a logical file and a CL Program.

34. Describe when a QRY access path can be used, and when it cannot?

QRY access paths can only be used with the following function types:
Display File
Select Record
Retrieve Object
Print Object
Print File
Cannot be used with a Create, Change or Delete Object.

35. When would an OS/400 Query be preferable to a SYNON QRY ACP?

When you want to create, change or delete records based on a QRY.

36. How is a SPAN access path implemented in DDS?

The generated names of the fields will be prefixed with the applicable file name to uniquely distinguish the common fields.

37. What would a span access path be used for?

A SPN access path specifies a keyed, multi–format access path. It is used to describe to Edit and Display Transaction functions, how records are to be retrieved from a pair of related files that possess a common foreign key. The files must be related by an ‘Owned By’ or ‘Refers To’ relation, with the SPN access path created over the ‘owning’ or ‘referred to’ file.
Note: The SPN access path must be created explicitly initially defaults to the keys defined by the key relations of the based on files but can be overridden to an alternative key sequence is associated with RTV access path that points to an associated UPD access path that is used to carry out any updates to the based on file allows virtual fields to be specified on the access path relations and defaults to the virtual fields of the based on files relations allows specific selection of multiple access path relations.

38. How do the files need to be related to correctly implement a SPAN?

The files must be related by an ‘Owned By’ or ‘Refers To’ relation.

39. What are 2 ways to define a Select/Omit access path?

Static – Only those records that satisfy the select logic are included in the access path. Records are filtered as they are added or changed, the system determines if it should be included in the access path. As data is read, no filtering is required as it has already been performed by the access path maintenance.
Dynamic – All records that satisfy the select logic are included in the access path. Records are filtered as they are read by the program.

40. Describe the difference between Static and Dynamic access paths.

Static processing is where the records are selected at generation time. It requires a separate index and should be used for master files and tables. Static is the most commonly used select/omit processing option and is the fastest.
Dynamic processing is where the records are selected at run time. It allows for the sharing of active indexes and is the only option that can be used to include virtual fields.

41. What is the primary purpose of a RSQ access path?

To provide an alternate sort of the entity by physical fields.

42. What is a QRY type access path?

It allows for the use of an Open Query file within SYNON.


Built–in Functions
*Add *Commit *Compute *Concat
*Cvtvar *Date Details *Date Increment *Div
*Div with Remainder *Duration *Elapsed Time *Exit Program
*Modulo (Mod 10/11) *Move *Move All *Mult
*Quit *Rollback *RTVCND *Set Cursor
*Sub *Substring *Time Details *Time Increment


Message Functions
•Send Error Message (SNDERRMSG)
•Send Informational Message (SNDINFMSG)
•Send Complete Message (SNDCMPMSG)
•Send Status Message (SNDSTSMSG)
•Retrieve Message (RTVMSG)
•Execute Message (EXCMSG)

43. Describe the difference between an ‘Edit Transaction’ function and an ‘Edit File’ function.

The Edit Transaction function allows the user to update 2 different file formats, which can be linked together, such as an Order Header and Order Detail file. The 2 files must be joined using a SPAN access path. The Edit File function allows the user to update multiple records with the same format simultaneously.

44. What is the difference between an internal and an external function?

An internal function generates code within a given function as where an external function generates a CALL to another function.


45. Describe the difference between an ‘Edit Transaction’ function and an ‘Edit File’ function.

The Edit Transaction function allows the user to update 2 different file formats, which can be linked together, such as an Order Header and Order Detail file. The 2 files must be joined using a SPAN access path. The Edit File function allows the user to update multiple records with the same format simultaneously.

46. What is the difference between an internal and an external function?

An internal function generates code within a given function as where an external function generates a CALL to another function.

CALL to another function.
47. Does a Prompt and Validate (PMTRCD) automatically read records from the database file that it is built over?

No.

48. You only wish to get the first record in a file, How?

Do not pass any key parameters (a blank key) to a RTVOBJ function and, at the User Point ‘Process Data Record’, do NOT code any user logic.

49. How would you design a batch function for updating records?

Use an Execute External function type which has a Retrieve Object in it then, once a record is read, use a Change Object to update the record.
(The Retrieve Object can be omitted if the Change Object is to handle reading and updating the same file.)

50. How would you design a batch function to print a report for a given range of dates?

Call a CL program which will call a Prompt and Validate function to fill in the record selection parameters. Then the CL program will process the SBMJOB command to submit the Print File program with the appropriate parameters.

51. What are the ‘important’ function options for an EDTRCD function type?

Exit after Add
Bypass Key Screen

52. List all the alternative ways for putting several variables into one field.

RTV Message
Concatenate built in function

53. List the contexts available in a PRTFIL function?

CUR NXT PAR
JOB PGM CON
CND WRK


54. What are the different kinds of Synon message functions available and how are they used?

• SNDERRMSG – an error message sent to a calling function used to provide diagnostic messages arising from user validation
• SNDINFMSG – an informational message sent to the message queue of a calling program
• SNDCMPMSG – a message sent to the function that called a standard function to indicate that a process has completed successfully
• SNDSTSMSG – a message sent to a calling function to provide information about the progress of a long running process
• RTVMSG – a function that specifies that the messages text is to be retrieved from the message file into a function
• EXCMSG – a function that specifies that allows for a command string to be executed from with a Synon function via a request message that is to be executed by the calling function (usually a CL command like SBMJOB)
Note: You should use SBMJOB with EXCEXTFUN or EXTUSRPGM and PRTFIL functions for batch execution from within an action diagram so that you can pass numeric parameters. Also, references to submitted functions are visible to the Synon/2E impact analysis facilities

Questions on Conditions

55. What types of Conditions are there?

CMP (Compare) – used for conditions that specify a scope of values that a field can receive. The scope is defined as a fixed value and an operator.ie. X *GE Y or A *LT B. CMP conditions cannot be used with STS fields.
RNG (Range) – used for conditions that specify a range of values that a field can receive. ie. ‘Order Quantity is 10 and 100’ or ‘Transaction Value is GT 25 and LE 250’. RNG conditions cannot be used with STS fields.
VAL (Values) – used for conditions that specify a value that a field can receive and can only be used with STS fields. You need to specify 2 related values for a value condition: an internal which will be held in the database and against which the condition will be checked, and an external value which the user enters on the external function application panel. Synon generates the necessary code to interpret the values. The internal and external values can have different lengths but you will need to use value mapping facility to translate between them. To do this, you must specify Y on the Translate field on the Edit Field panel.
LST (Values List) – Similar to the VAL condition in that it can only be used with STS fields. Provides a list of valid values that a field can receive and allows the user to prompt for the list by entering a ? in the field or pressing F4.

56. What is QUIT?

Quit is a built–in function that exits from an action diagram sequence construct. It has no parameters and returns control to the calling sequence construct.

a. When would you use it?

When you want to quit processing if a certain condition exists ie. Do not perform update processing if errors occurs on the validate processing.

57. What is EXITPGM?

EXIT Program is a built–in function that specifies an exit from a program that returns processing control to the calling program. A return code parameter is passed to the calling program stating the reason and circumstances under which the program is exiting.

58. What happens when processing comes to a *QUIT within an Execute Internal Function?

Processing in the program will proceed to the exit point of the function that called the Execute Internal Function.


Questions on Parameters

59. Where may POS type parameter be used?

60. How can you pass more than 9 parameter fields into a function?

Specify a file name with the access path of *NONE and context of FLD, create a STR file type specifically for the use of passing parameters, or use *ARRAYS (rel 4.0 and greater) to define a structure for the use of passing parameters.

61. Why would you want to define a parameter as *NEITHER?

To allow mapping of the field to the screen.

62. What is the difference between FLD, RCD and KEY contexts when passing parameters?

FLD – One parameter is passed for each field specified.
RCD – One parameter is passed for all fields specified in the structure.
KEY – One parameter is passed for all key fields specified in the structure.

63. If the business requirements necessitate that more than just the key fields need to be passed from a Select Record function, what would have to be done to meet this requirement?

Use a Display File in place of the Select Record function.


64. Is it preferable to pass parameters as *FIELDS or *FILES? Why?

It is usually preferable to use *FILES because you will be able to select multiple fields from the list of fields on the file selected. If you use *FIELDS, you will only have 9 parameters available.


65. What does ELM mean and where is it used?

ELM is the element context of an array that contains the fields defined for the last–accessed element of a specified array. It is only valid in the *CVTVAR built–in function and may be specified for either the input or output parameter.

66. Which fields in an Edit File will be positioner fields and which will be selector fields?

Key fields in an Edit File will be positioners. Non–key fields will be selector fields.


67. How do you create a new *Standard Header/Footer to be used for a report?

Display all functions over the *Standard Header/Footer entity. Select one to copy and copy it to a new name which accurately describes the purpose you are using if for. Next, review the screen design and make the changes to the function required for your task through normal screen design techniques.

68. How do you change the *Standard Header/Footer on a screen report?

From Function Options, press F5 to Select a new *Standard Header/Footer. You cannot create a new standard header/footer when you are in the process of selecting one.


Journaling / Commitment Control Processing:

69. What is Journaling and Commitment Control Processing?

Journaling and Commitment Control processing is a means of automatically grouping a number of database updates into a single transaction for the purpose of recovery: either all or none of the updates will take place.

70. What are the commands to perform journaling within a SYNON function?

*COMMIT and *ROLLBACK

71. Where would a programmer control whether or not a program is run under commitment control?

In the Edit Function Options section.

72. What are the values for controlling whether or not a program is run under commitment control?

M (Master ) – Program is run under commitment control, program is controlling program and contains commit points.
S (Slave) – Program is run under commitment control; however, the commit points are in another program.
N (None) – Commitment control does not exist in this program.


73. What is a ‘CPF4131’?

It is an IBM code for a ‘level check&rsquo condition.