Entering Text Data Using TED

In this section:

While in MODIFY, TED can be used to enter text field data. When TED is used to enter text, a new temporary file is opened in memory for data input; this file is never written to disk permanently. The name of this file is the same as the name of the text field. The ddname for the text field will be TXTFLD. For example

DESCRPT TXTFLD

is the file name and file type of the file opened for the text field DESCRIPT.

All TED rules and functions apply, including the ability to edit other files. The RUN function in TED is ignored for text fields and is treated as the FILE command instead.

There are six ways to use the syntax for entering text format data using TED:

TED textfield
ON MATCH TED textfield
ON NOMATCH TED textfield
ON MATCH/NOMATCH TED textfield
ON NEXT TED textfield
ON NONEXT TED textfield

For example:

MODIFY FILE COURSES
PROMPT COURSE_CODE
MATCH COURSE_CODE
  ON NOMATCH TED DESCRIPTION
  ON NOMATCH INCLUDE
  ON MATCH TED DESCRIPTION
  ON MATCH UPDATE DESCRIPTION
DATA

TED will always edit the most recent version of the text field. The first time, this will be the current data source text field value; the next time that TED is used on the same text field, data from the previous text transaction will be available for editing.

As a rule, TED will always look for text data in the transaction area first. If no text exists there, TED looks for text present as a result of MATCH. If there is no data there, TED assumes that the field is new and brings up a new (empty) file.

After one transaction involving TED is complete, data areas are blanked out before proceeding with the next transactions (as when DEACTIVATE is used). This means that all text instances will be newly created (therefore, one course description will not carry over and accidentally be used for the next course number).

Text fields must always end with the end-of-text mark (%$). Although you may enter this mark directly in the TED file as the first two characters on the last line, TED will test for the presence of the end-of-text mark; if it is missing, TED automatically inserts it.

Note: You must supply the end-of-text mark when using PROMPT or FIXFORM.

If you wish to use TED to input data for more than one text field, specify a separate action for each field:

ON MATCH TED TXFIELD1
ON MATCH TED TXFIELD2

The size of the file is limited only by the amount of available storage space.

Entering Text Field Data

The following rules apply to text field data entry using TED, FIXFORM, FREEFORM, or PROMPT:

Defining a Text Field

The syntax for defining a text field in a Master File is:

FIELD=fieldname, ALIAS=aliasname, FORMAT=TXnn,$

or

FIELD=fieldname, ALIAS=aliasname,FORMAT=TXnnF,$

where:

fieldname

Is the name you assign the text field.

aliasname

Is an alternate name for the field name.

nn

Is the output display length in TABLE for the text field.

F

Is used to format the text field for redisplay when TED is called using ON MATCH or ON NOMATCH. When F is specified, the text field is formatted as TX80 and is displayed. When F is not specified, the field is redisplayed exactly as entered.

Displaying Text Fields

FOCUS includes a format option in the text field of the Master File. Use of this determines whether text will display in the format in which it was entered.

For example, below is a Master File and the sample data that was entered into the field TXTFLD using TED.

FILE=TEXT,SUFFIX=FOC
   SEGNAME=SEGA,SEGTYPE=S1
   FIELD=KEYFLD,,A1,$
   FIELD=TXTFLD,,TX20,$

Sample data entered:

THIS IS A TEST OF THE NEW TED OPTION 'F'.  REMEMBER THAT TED DISPLAYS 80
CHARACTERS ON THE SCREEN.  THREE LEADING BLANKS ARE USED TO INDICATE A
NEW PARAGRAPH. TEXT FIELD DATA IS ALWAYS STORED EXACTLY AS ENTERED.  WHEN
F IS INCLUDED IN THE FORMAT AND THE TEXT FIELD IS REDISPLAYED, BLANKS ARE
OMITTED AND THE FIELD IS CONDENSED.
WHEN F IS NOT INCLUDED, THE FIELD IS REDISPLAYED AS ENTERED.

Since the text field in the Master File does not include the F option, the data will be redisplayed exactly as entered using TED (ON MATCH TED TXTFLD).

For the next example, the text field includes the F option:

FILE=TEXT,SUFFIX=FOC
   SEGNAME=SEGA,SEGTYPE=S1
   FIELD=KEYFLD,,A1,$
   FIELD=TXTFLD,,TX20F,$

Note: The same data is entered as in the previous example.

In this case, since the text field does include the F option, when the field is redisplayed, blanks are omitted and the field is condensed as shown below:

THIS IS A TEST OF THE NEW TED OPTION 'F'.  REMEMBER THAT TED DISPLAYS 80
CHARACTERS ON THE SCREEN.  THREE LEADING BLANKS ARE USED TO INDICATE A
NEW PARAGRAPH.  TEXT FIELD DATA IS ALWAYS STORED EXACTLY AS ENTERED. 
WHEN F IS INCLUDED IN THE FORMAT AND THE TEXT FIELD IS REDISPLAYED,
BLANKS ARE OMITTED AND THE FIELD IS CONDENSED. WHEN F IS NOT INCLUDED,
THE FIELD IS REDISPLAYED AS ENTERED.

Specifying the Source of Data: The DATA Statement

How to:

The DATA statement marks the end of the executable statements in a request. It also specifies the source of the data.

Syntax: How to Use a DATA Statement

DATA [ON ddname|VIA program]

where:

ON ddname

Indicates that the data is in a data source allocated to ddname.

VIA program

Indicates that the data is supplied directly from another computer program.

Type the DATA statement without parameters if:

  • The data comes from the request itself.
  • The request contains only PROMPT statements to read data.
  • The request does not read any data (this occurs when you use a request to browse through a data source using the NEXT statement).

Information Builders