M!INTOUCH® 4GL Y

INTOUCH® 4GL
A Guide to the INTOUCH Language

A
Previous page... 6Table of Contents
9

16.4.6 Field length



NEnter the length of this field. The length should be the number of character Opositions this field will contain. Fields can be any length. The length must be given as an integer number. 

HYou can also enter the ending position for the field length. You enter 7"P" followed by the ending position. For example: P5 

Variable Length Fields

LIf a CH or UN data type field has a first position that starts at or before Kthe end of a logical record, that field will have its length adjusted upon Nreference. The new length will reflect the actual end of the logical record. 

MFor example, a field could start in position one, and have its length set to Mthe maximum record length. When the field is referenced, its length will be Fadjusted to the actual record length. This field is variable length. 

B

16.4.7 Number of occurrences



EEnter the number of times that this field occurs in the data record. *The default number of occurrences is "1". 

EIf the field being defined is an array, enter the number of elements in the array. 

6

16.4.8 Semantics



JEnter the semantics (attributes) that apply to this field. The semantics Jdescribe what type of data will be in the field. For example, if this is Ha dollar amount field you would select NUM:2 which means that this is a 'numeric field with two decimal places. 

HThe semantics are entered as a list of descriptors separated by commas. OWhen you have completed your list, enter GOLD/F (i.e. press PF1 and then the F key). 

The valid semantics are: 

   š     ‹     ;     Ž     *     6     >     ¹          ì  
NUM Indicates a numeric field which allows only numbers. The semantic RJ, right-justified, is automatically appended when NUM is selected.
NUM:scale SCALE specifies the scale factor---how many decimal places to use. Scale factors can be positive or negative (from -99 to 99).
RJ The data will be right-justified in the field.
UC All letters will be stored in upper-case format. Additionally, field comparison data will be upper-cased prior to any comparison.
ZF The data will be zero filled.
ZS Causes all leading zeros to be suppressed
DATE[:YMD|MDY] This field contains a date. The field must be six or eight digits long. The default date format is YMD. You can enter DATE or optionally, specify the date format. The date format is currently only used by applications. INTOUCH does NOT automatically switch date values into or out of the format specified.
FULLTIME Indicates that the field contains a date-time stamp and the time value is to be preserved. By default, INTOUCH stores/retrieves only the date portion of a date stamp field.
APPLICATION:name This is a user defined semantic and is not used by INTOUCH. A user can assign a name to indicate that the field is related to a specific application (i.e. accounting). Application programs can then ask for the application name and perform some action based on the data.
DBFLD:fieldname This is a special semantic for augmented definition files only. The DBFLD semantic is used to associate an augmented field definition with an actual database field. Fieldname is the actual name of the field in the database.


=If you do not want any of the semantics, you can enter NONE. 

JIf you are modifying an existing field, the default will be the semantics you have previously specified. 

8

16.4.9 Prompt text



IEnter the prompt text for this field. The prompt text will be used when 2data is entered for this field. The prompt text: 





HIf you are adding this field, the default will be the descriptionyou entered for this field. 

=

16.4.10 Report heading



KEnter the heading you want to appear on reports. This heading will appear Jat the top of the report column containing this field's data. If you are Hadding a new record, the default report heading is the field name you entered. 

-The heading can be up to 30 characters long. 

HTo make a multi-line heading, separate the heading for each line with a comma (i.e. Cust,No). 

9

16.4.11 Print mask



FEnter a print mask for this field. The print mask is used to display Kinformation entered into this field. The print mask will be used whenever Hyou use INTOUCH's PRINT statement to print this field's information, or Hwhen you use one of the INTOUCH programs such as Guided Query Language. 

DPrint masks are created with the #, @ and % characters. SETUP will Lautomatically provide the tilde (~) character for any literal (non-masking) 6characters found in the entered mask. Some examples: 

B                                Example 1               Example 2 F                                ----------------        ------------- A        Data to be masked:      AB1234XY                AB1234XY C        Data to print as :      (AB-1234-XY)            AB 1234 XY C        Mask you enter   :      (##-####-##)            ## #### ## E        SETUP displays   :      (##~-####~-##~)         ##~ ####~ ## 


EYou can refer to the chapter "Printing and Displaying Data" for more information on print masks. 

:

16.4.12 Screen mask



HThe screen mask is used by applications to enter data into this field. DA program can ask for the screen mask and use it in whatever manner Gthat is desired. The format should be the same as for the print mask. 

8

16.4.13 Help text



IHELP text can be entered for this field. The help text can be displayed Nduring data entry if the user types "HELP" or presses the Help key Cat this field prompt when in MAINTAIN. Custom applications !can also display this help text. 

The help text: 





;

16.4.14 Access rules



GEnter the access rules for this field. The access rules determine who Fwill have access to this field. NORMAL allows users to read, add and change field information. 

)Access rules have the following formats: 



:where read_access and write_access are each +represented by a single letter from (A-Z). 

'NORMAL denotes READ:N, WRITE:N. 

7A is the most restricted access level. Z'is the least restricted access level. 

EThe access_rules are used in conjunction with the structure security ?level to determine whether or not a user can access the field. 

HWhen a user attempts to access a field, the structure security level is Jcompared to the read or write access level defined for the field. If the Hfield's access level is lower than the structure security level, access is allowed. For example: 




FIf the structure READ access is J and the field READ access is T, the Efield data CAN be read. However, if the structure WRITE access is J Cand the field WRITE access is E, the field CANNOT be written to or changed. 



?

16.4.15 Validation rules



JYou can enter validation rules for this field. The validation rules will :be used to validate data entered by a data entry program. 

FThe data entry program can access these validation rules to make sure Ithat the data entered is valid prior to storing the data into the field. 

JAny rule that is valid to the INTOUCH VALID function can be entered here. 

MThe validation rules are entered as a list of items separated by semicolons. For example: 

/                required; digits; minlength 10 


OWhen you have completed your list, enter GOLD/F (i.e. press PF1 and then the F key). 

JPlease refer to Appendix A of this manual for detailed information on the VALID function. 

KWhen you have answered all the field prompts, the field definition will be Hadded to the data dictionary. The screen will clear and you can define Nthe next field or enter "\" or "EXIT" to return to the SETUP procedures menu. 

g

16.4.16 Field Definitions and Key Fields --- General Information



KNormally, when you define the record fields, each defined field represents Ka single piece of data in the record. This allows your programs access to all of the record data. 

GThere are times when you want to process two or more adjoining fields. IFor example, if you have a last name field, first name field and initial Ifield and you want to sort the records by name, you would sort the three 4separate fields--last name, first name and initial. 

GTo simply this process, you can define an additional field, FULL_NAME, Fwhich can consist of the three fields. When you define the FULL_NAME Jfield, the starting position would be the first position of the last name Land the length would be the total number of characters in the three fields. HThen, when you want to sort or print the full name, you need only refer #to one field, the FULL_NAME field. 

IRedefining fields becomes very useful when you need to set up unique key fields for RMS indexed files. 



Key Fields



HIf you are creating an RMS indexed file, you will be designating one or Fmore fields as key fields. RMS indexed files require at least one key field. JWhen you use the CREATE procedure to create an RMS indexed file, you will Cbe prompted for a primary key field and alternate keyfields. 

@Key fields contain unique data which enables programs to locate Mrecords very quickly. For example, the customer number field could be a key Nfield because all the customer numbers in all the records would be different. <This type of key field is called a unique key field. 

FDuplicate key fields contain unique types of data but the data 4might be found in more than one record in the file. 

KAny defined or redefined field can be designated as a key field. However, Oit is best to use fields that normally will contain unique data as key fields. =Common practice is to set up the first field as a key field. 

IA key field can be defined which consists of two or more fields. If the Jfields which make up this key field are not adjoining (i.e. one after the Aother), this is called a segmented key field. Key fields Hconsisting of two or more fields, whether segmented or not, must have a Ilength that equals the total length of all the segments that make up the key field. 

7

16.5 SHOW Procedure



HThe SHOW procedure displays information about the fields defined in the 9data dictionary and also displays structure information. 

?You can use the arrow keys to select the Show procedure from the SETUP procedures menu. 




WSETUP V4.2 Set Up INTOUCH 4GL Data Structures  Structure name : CUSTOMER.STR Database engine: RMS Dataset : CUSTOMER.DAT Data dictionary: CUSTOMER.DEF     7 +---Setup Procedure---+ N | Define fields +------Show Option-------+ N | Show | Brief field display | G | Modify structure | Full field display | G |-------------------| List fields | G | Create data file | Structure | G | EXIT +------------------------+ 0 +---------------------+   WEXIT = Exit \ = Back HELP = Help



%The SHOW procedure has four options: 





HSETUP creates the listings in report format so that you can display the Ifield and structure information on your screen, print a hardcopy or save the information on disk. 

DAfter a report is created, you can select an output option from the 9Output Options menu. The default is Screen which Kwill display the report to your screen. The line under the Output Options Gmenu tells you the name of the temporary report file that was created. 




 M +--------------------- Output Options ---------------------+ M | Screen | System Printer | Laser Printer | F | Printer Port | Save to Disk | EXIT | F +----------------------------------------------------------+  F Ready to print user:[tester]setup_show_definition_210006.tmp  



HIf you are in the middle of displaying a report and want to exit out of Nthe display, enter CTL/Z and you will return to the Output Options menu. 

MTo return to the SETUP procedures menu, you can use the arrow keys to select .the EXIT option or press "\" (backslash key). 

@

16.5.1 Brief Field Display



JThe Brief Field Display shows the field name, description, first position Hof the field, field length, number of occurrences, last field position, %data type, print mask and semantics. 

0Example 16-7 SHOW - Brief Field Display Example


Q08-Mar-1995 Definitions for: CUSTOMER.DEF Page: 1  QField Name Description First Length Occurs Last Dtype Print Mask Q--------------- ----------------- ----- ------ ------ ----- ----- ---------- KCUSTNBR Customer number 1 5 1 5 CH none  Semantics : none  KNAME Customer name 6 25 1 30 CH none  Semantics : none  KADDR1 Address line 1 31 25 1 55 CH none  Semantics : none  KADDRESS Address array 31 25 1 55 CH none  Semantics : none 



?

16.5.2 Full Field Display



@The Full Field Display shows all of the definition information. /Example 16-8 SHOW - Full Field Display Example


Q08-Mar-1995 Definitions for: CUSTOMER.DEF Page: 1  QField Name Description First Length Occurs Last Dtype Print Mask Q--------------- ----------------- ----- ------ ------ ----- ----- ---------- KCUSTNBR Customer number 1 5 1 5 CH none  Semantics : none # Prompt text: Customer number  Heading : Cust#  Help : none  Screen mask: none  Validations: none  KNAME Customer name 6 25 1 30 CH none  Semantics : none ! Prompt text: Customer name ! Heading : Customer name  Help : none  Screen mask: none  Validations: none 

@

16.5.3 List Fields Display



JThe List Fields Display shows the field name, description, first position *of the field, field length and data type. 0Example 16-9 SHOW - Fields List Display Example


P08-Mar-1995 CUSTOMER.DEF - FIELDS Page: 1  QField Name Description First Length DT Q-------------------------------- ------------------------------ ----- ------ -- QCUSTNBR Customer number 1 5 CH QNAME Customer name 6 25 CH QADDR1 Address line 1 31 25 CH QADDRESS Address array 31 25 CH QADDR2 Address line 2 56 25 CH QCITY City 81 20 CH QSTATE State 101 2 CH QZIP Zip 103 5 CH 

>

16.5.4 Structure Display



JThe Structure option of SHOW displays information about the structure and security access levels. 

/Example 16-10 SHOW - Structure Display Example


P08-Mar-1995 Structure: CUSTOMER.STR Page: 1  Structure name : CUSTOMER.STR Dataset : CUSTOMER.DAT Record system : RMS Data dictionary: CUSTOMER.DEF AAccess levels : SECURITY:N, READ:N, WRITE:N, UPDATE:N, DELETE:N  



C

16.6 MODIFY STRUCTURE Procedure



.The MODIFY STRUCTURE procedures allow you to: 








WSETUP V4.2 Set Up INTOUCH 4GL Data Structures  Structure name : CUSTOMER.STR Database engine: RMS Dataset : CUSTOMER.DAT Data dictionary: CUSTOMER.DEF    7 +---Setup Procedure---+ 0 | Define fields | O | Show +----Modify structure-----+ O | Modify structure | General information | H |-------------------| Security information | H | Create data file +-------------------------+ 0 | EXIT | 0 +---------------------+   WEXIT = Exit \ = Back HELP = Help



@You can use the arrow keys to select the Modify structureOprocedure from the SETUP procedures menu and then select one of the two modify structure options. 

Q

16.6.1 Modify Structure General Information



?When you select the modify structure General information>option, SETUP will display the current structure information. 




WSETUP V4.2 Set Up INTOUCH 4GL Data Structures  Structure name : CUSTOMER.STR Database engine: RMS Dataset : CUSTOMER.DAT Data dictionary: CUSTOMER.DEF 1 +Database Engine+ 1 | RMS | * | RDB | * | DBMS | * | USERBASE | * | POISE | * | FASTFILE | * | S1032 | * | INGRES | * | DBASE3 | * | ADABAS | * | ORACLE | * |---------------| * | EXIT | * +---------------+   WEXIT = Exit \ = Back HELP = Help



You will be prompted for: 





JYou can either press Return at the prompts to keep the current Hinformation or enter new information. If you need clarification on any ?of the prompts, you can refer back to the SETUP Prompts section in this chapter. 

?After the last prompt is answered, the STR file will be "updated with the new information. 

GYou will be returned to the SETUP procedures menu where you can select another option or exit SETUP. 

R

16.6.2 Modify Structure Security Information



@When you select the modify structure Security information=option, SETUP will display the current security information. 




WSETUP V4.2 Structure Security and Access Levels  Structure security level: N Read access level : N Update access level : N Write access level : N Delete access level : N       Structure security level? N  6 Security levels are A to Z WEXIT = Exit \ = Back HELP = Help



You will be prompted for: 





JYou can either press Return at the prompts to keep the current &information or enter new information. 

!

Structure security level



9Enter the security level associated with this structure. 

>The security level is a single letter in the range of A to Z. 

:Security level A is the highest level of security. 9Security level Z is the lowest level of security. 



Read access level



EEnter the access level required to read a data record in this structure. 

=The read access level is a single letter in the range A to Z. 7A is the most restricted access level. Zis the least restricted. 

KWhen an attempt is made to read a record from this structure, INTOUCH will Lcompare the structure security level to the read access level. If the read Jaccess level is lower than the structure security level, the read request will be allowed. 

For example: 

?        Structure level         Read access level       Access ?        ---------------         -----------------       ------ @              K                         R               Allowed  ?              K                         E               Denied  @              K                         K               Allowed 


,

Update, Write, Delete access levels



FEnter the access levels required to update, write, delete data Jrecords in this structure. Answer each of the prompts with a letter from A to Z. 

?After the last prompt is answered, the STR file will be +updated with the new security information. 

GYou will be returned to the SETUP procedures menu where you can select another option or exit SETUP. 

9

16.7 CREATE Procedure






WSETUP V4.2 Set Up INTOUCH 4GL Data Structures  Structure name : CUSTOMER.STR Database engine: RMS Dataset : CUSTOMER.DAT Data dictionary: CUSTOMER.DEF     7 +---Setup Procedure---+ 0 | Define fields | 3 | Show [>| 3 | Modify structure [>| 0 |---------------------| 7 | Create data file | 0 | EXIT | 0 +---------------------+   WEXIT = Exit \ = Back HELP = Help



<Selecting the Create data file option from the SETUP 6procedures menu will allow you to create a data file. 

OAfter the CREATE option has been selected, the create screen will be displayed /and you will be prompted for some information. 




,

Note

JIf the database engine is RMS, the following screen is displayed. If the Ldatabase engine is not RMS, a similar screen will be displayed. The screen Mheading shows the database engine and name of the file that will be created. 



0Example 16-11 CREATE Procedure RMS Input Screen


WSETUP V4.2 Creating RMS data file: CUSTOMER.DAT  File organization: Recordsize :      7 +RMS File Organization+ 0 | Indexed | 0 | Sequential | 0 +---------------------+   WEXIT = Exit \ = Back HELP = Help



7

RMS File Organization



4


Next page... | 6Table of Contents