Transferring Text

This document covers the following topics:


Selecting Text From Another Source Within Predict

Note:
The options you have for positioning the text from another Predict source depends on the editor you are using.

Sources

Text can be selected from the following Predict sources:

  • extended description

  • default extended description

  • abstract

  • rule of a verification

  • SQL subquery expression

  • SQL procedure code

  • derived field expression

  • trigger code

Targets

Text can be copied to the following attributes of Predict objects:

  • extended description of any Predict object

  • subquery of a file

  • rule of a verification

  • field expression

  • trigger code

Note:
With the IMPORT command you can also import text from a variety of external sources. See Importing Text from an External Source.

Calling the Select Function

Selecting text from another Predict source is a process of up to 5 steps.

Step 1: Enter SEL Command

Enter "SEL" in the command line of your editor. The following screen is displayed.

    13:07:29             *****  P R E D I C T  *****              2007-05-31
    Plan   0                      - Select Text -
   
       Type of source                               Type of source
   
       E  Extended description                      V  SQL subquery expression
       D  Default extended description              C  SQL procedure code
       A  Abstract                                  F  Derived field expression
       P  Processing rule                           G  Trigger code
   
   
    Type of source .. E
   
    Object type ....*                                  Type of SQL code .*
    Object ID .......
    Belongs to FI ...
   
   
    Restriction ....*   Profile USR,used
   
   
    Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
          Help        Exit
  

Step 2: Specify Type of Source

Enter one of the codes from the menu to select text from the corresponding source. The selection criteria that can/must be specified depend on the type of source.

Step 3: Enter Selection Criteria

Parameter Description
Object type This parameter must be specified for source types E, D and A. The other source types apply to one particular object type. This object type is added automatically.
Object ID The scope of the function can be limited by a fully qualified object ID or ID with asterisk notation. If this field is left blank, all objects that meet the other selection criteria are listed for selection.
Belongs to FI Only valid for object type field. The scope of the function can be limited by a fully qualified file ID or ID with asterisk notation. If no file ID is specified, fields in all files are listed for selection.
Type of SQL code Only valid for source types V and C.

Possible values for source type SQL subquery expression:

L : SQL view subquery
T1 : SQL code for table check constraint

Possible value for source type SQL procedure code:

T2 : SQL code for procedure

Restrictions Additional restrictions can be specified to further limit the selection. See Restrictions in the section Predict User Interface in the Introduction to Predict documentation.

A list of all Predict objects that meet the selection criteria is displayed for selection. See example below.

    13:05:44             *****  P R E D I C T  *****       2007-05-31
    Plan   0               - Select Description Of File -
   
    Cmd  File ID                            Type   Fnr    DDM Impl Other
   
     __  ABC-BT                              BT      0
     __  ABC-FI-S-1                          S       0
     __  ABC-FI1                             A     123
     __  ABC-OT                              OT      0
     __  ABC-OV                              OV      0
   
  

Step 4: Mark objects to be selected

You have two options:

  • Enter "A" in the Cmd column to import the entire object.

  • Enter "S" in the Cmd column to display the object. Select the lines you wish to import by marking them with a non-blank character

Step 5: Mark lines of object to be selected

Only applicable if you entered "S" in step 4. Mark lines of object to be copied with any non-blank character.

      > Mark line to be selected from: File,JCA-BT                                  <
           ....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
      _  line 1 of description
      X  line 2 of description
      _  line 3 of description
      X  line 4 of description
      _  line 5 of description

Press ENTER to return to the Select Text menu and PF3 to return to your editor session.

Importing Text from an External Source

Sources

With this version of Predict you can import text from the following external sources:

Note:
With the SELECT command you can also import text from a variety of sources within Predict. See Selecting Text from another source within Predict.

Targets

The text from the above sources can be imported to the following targets:

  • extended description of any Predict object

  • subquery of a file

  • rule of a verification

  • field expression

  • trigger code

Positioning the Imported Text

The following rules apply to imported text from any of the sources listed above. Depending on the editor you are using, you can position the imported text as follows:

Natural Editor

If you are using a Natural-based editor, the position of the imported text depends on the value in the indicator field highlighted below.

 >                     > + FI: USR-FI1                     L: 1    S: 12 All
   ....+....1....+.... Extended description ...+....5....+....6....+....7
   

Plus (+) Text is added to the bottom of the current object

Minus(-) Text is added to the top of the current object

Software AG Editor

If you are using the Software AG Editor, the text is added to the end of the current object as standard. You can also mark any line with H in the prefix area of the editor to import the text to a specific position. The text is imported after the marked line.

    13:04:43                      - File : USR-FI1 -              2007-05-31
          --------------- < Extended description > ---------------
    ***** ******************* top of data ************************
    00001           t===================================
    H0002           =e==================================
    00003           ==s=================================
    00004           ===t================================

Note:
It is possible that your Software AG Editor environment has been set up differently. If in doubt, contact your system administrator.

Calling the Import Function

To import the text from one of the sources listed on above, enter command IMPORT in the command line of the respective editor. The following screen appears.

The prerequisites and options for the various external environments are described below.

    > import              > + FI: USR-FI1                          L: 1    S: 5
     All  ....+....1....+.... Extended description ...+....5....+....6....+....7..
                    ====================================
                       File additional description
                    ====================================
          This is the exte +------ Import Text -------+ I1.
          This is the seco !                          !
                           !     Type of source       !
                           !                          !
                           !   N Natural source       !
                           !   C Connect document     !
                           !   U User defined source  !
                           !   P PC ascii file        !
                           !                          !
                           !    Type of source .. N   !
                           +--------------------------+
   
   
   
   
    Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
          Help        Exit
  

Natural Source

Calling the Function

Enter one of the following in the Editor command line

  • Command IMPORT to display the Import Text selection window, then source type "N"

  • or IMPORT N

The following screen appears:

    > imp                 > + FI: USR-FI1                          L: 1    S: 5
     All  ....+....1....+.... Extended description ...+....5....+....6....+....7..
                    ====================================
                       File additional description
                    ====================================
          This is the +- Import Source Into PREDICT Description -+
          This is the !                                          !
                      !                        source .. Natural !
                      !      Member ............                 !
                      !      Library ...........                 !
                      !      User system Fnr ... 54              !
                      !      User system DBnr .. 180             !
                      !      Cipher ............                 !
                      !      Password ..........                 !
                      !                                          !
  

The following parameters are available:

Parameter Description
Member, Library These parameters identify the member(s) to be imported. Leave blank or use asterisk notation to display a list of members for selection.
User system Fnr/DBnr The database and file number of the file containing the member(s) to be imported. These values must be specified.
Cipher, Password Only required if the file containing the members to be imported is protected by password or cipher.

A list of members that meet the parameters specified is then displayed for selection. See example below.

    13:03:24             *****  P R E D I C T  *****             2007-05-31
                                Import Natural Source
   
    Cmd    T Member       Library         Program
   
     __    M:DEMAP        ABC
     __    P:FUNCT1       ABC
     __    P:FUNCT3       ABC
     __    P:MENU         ABC             AB-DYN
     __    P:FUNCT2       ABCSTEP
     __
  

You have two options:

  • Enter "A" in the Cmd column to import the entire member.

  • Enter "S" in the Cmd column to display the member. Select the lines you wish to import by marking them with a non-blank character

Either all of the member or selected lines will be appended to the current object.

Note:
For UNIX users: Only programs and subprograms can be imported.

Importing Natural Maps

It is possible to import Natural maps into the extended description of a Predict object. When a member of type Map is selected for import, an additional window appears in which you must define the filler characters to be used in the Predict extended description for modifiable and read-only fields.

    13:06:20             *****  P R E D I C T  *****             2007-05-31
                                Import Natural Source
                                                    +All--Possible functions------
    Cmd    T Member       Library         Program   ! _ A   Insert All
                                                    ! _ S   Select
     __    P:ZBOE1        AAM                       ! _ ' ' No command
     __     +-------------------------------------------------+
     __     !     Please enter filler characters setting !    !
     __     !                                                 !
     __     !   Filler char. for INP/MOD fields ...           !
     __     !   Filler char. for OUTPUT fields ....           !
     __     !                                                 !
     __     !                                                 !
     __     +-------------------------------------------------+
     X_    M:ARHM2        ARH                       !
     __    P:ARH1         ARH             ARH-PR-OT !
   
  

Specify parameters Filler char. for INP/MOD fields and Filler char. for OUTPUT fields as required. The map is displayed in the extended description fully formatted in long lines of 250 characters.

13:24:55                      - File : USR-FI1 -                    2007-05-31
          --------------- < Extended description > ---------------
    00001           ====================================
    00002              File additional description
    00003           ====================================
    00004
    00005 This is a sample map imported from a Natural member. Filler character for
    00006 output is +, input filler character is &.
    00007
    =long  ++++++++          ++++++++++++++++++++++++++++++++++++++++            +
    =long                    ++++++++++++++++++++++++++++++++++++++++
    =long                                                     ++++++++++++++++++++
    =long  Profile ......... ++++++++                         ++++++++++++++++++++
    =long
    =long  File for select .......................... &&&&&&&&&&&&&&&&&&&&&&&&&&&&
    =long  Current virtual machine .................* &&&&&&&&&&&&&&&&&&&&&&&&&&&&
   

Con-nect Document

Prerequisites

Con-nect must be installed.

Calling the Function

Enter one of the following in the Editor command line

  • Command IMPORT to display the Import Text selection window, then source type "C"

  • or IMPORT C

The following screen appears:

     > imp                 > + FI: USR-FI1                          L: 1    S: 13
     All  ....+....1....+.... Extended description ...+....5....+....6....+....7..
                    ====================================
                       File additional description
                    ====================================
          This  +---- Import Document into Predict Description -----+
          This  !                                                   !
          DEFIN !                                 source .. Connect !
          END-D !                                                   !
          DECID ! Specification of Connect document                 !
              F !                                                   !
              F ! Cabinet ....                                      !
              F ! Password ...                                      !
              I ! Folder .....
          END   ! Document ...                                      !
                !                                                   !
                +---------------------------------------------------+
   
  

The following parameters are available:

Parameter Description
Cabinet Cabinet of the user from which the text is to be imported. If you are importing text from the cabinet of another user, this user must have granted you permission to his/her cabinet in Con-nect.
Password Only required if you are importing from the cabinet of another user.
Folder Enter the name of a folder that exists in the cabinet specified or leave blank. If a valid folder is specified, all documents contained in this folder are listed for selection; parameter Document is not evaluated.
Document If Folder is left blank, you can enter a value for document. For example: If you you enter "test" for Document, all documents in the specified cabinet starting from "test" are displayed for selection.

 A list of documents that meet the selection criteria above is displayed for selection. See example below.

    13:28:27             *****  P R E D I C T  *****             2007-05-31
                               Import Connect Document
   
    Cmd   Document name                   Date       Description
   
     __   test                            21-04-2002 test
     __   to_pc                           01-02-2002
     __   todo                            20-02-2002
     __   tran                            19-03-2002
     __   vmsgl                           23-04-2002 VMS-GLOSSARY
     __   who's who                       04-03-2002 (Who is who / Feb. 2002)
     __   xxx                             11-08-2002

You have two options:

  • Enter "A" in the Cmd column to import the entire Con-nect document.

  • Enter "S" in the Cmd column to display the Con-nect document. Select the lines you wish to import by marking them with a non-blank character.

Either all of the member or selected lines will be appended to the current object.

User-defined Source

With this version of Predict you can import text from the sources listed on to any user-defined subsystem.

Prerequisites

User exits U-IMPSC and U-IMPSRP which are delivered in source form with this version of Predict must still exist and must have been adapted to meet your site requirements.

This functionality is described on the documentation file delivered with Predict. See description of the following Program objects for more information.

  • SAG-PRD-U-IMPSRC

  • SAG-PRD-U-IMPSRP

Modify this program to suit your site-specific requirements.

Calling the Function

Enter one of the following in the Editor command line

  • Command IMPORT to display the Import Text selection window, then source type "U"

  • or IMPORT U

PC ASCII File

Prerequisites

  • Your Predict session must be running under terminal emulation in a PC environment.

  • Entire Connection for Windows must be installed (Version 4.3.1 or above).

  • Workfile 7 must be defined as PC workfile on the mainframe.

  • The Natural parameter PC must be set to ON, either by

    • specifying PC=ON when starting Natural or

    • entering %+ in the command line of your Predict session.

Note:
In Windows and UNIX environments, Workfile 7 must be set to type "Transfer".

Calling the Function

  • Enter one of the following in the Editor command line to call the Upload Data dialog box

    • Command IMPORT to display the Import Text selection window, then source type "P"

    • or IMPORT P

  • Specify source file in the Upload Data dialog box. The file must be in ASCII format.

  • Click the OK button in this window to import the text Predict.

Exporting Text to an External Target

Targets

With this version of Predict you can export text to the following target environments:

  • Natural source,

  • Con-nect document,

  • User-defined target,

  • PC ASCII file,

Sources

The text can come from one of the following sources in Predict

  • extended description of any Predict object

  • subquery of a file

  • rule of a verification

  • field expression

  • trigger code

  • the output of a display-oriented function from one of the following functional groups:

    • retrieval

    • active retrieval

    • administration (of external objects)

    • Display function from a maintenance menu.

Calling the EXPORT Function

To export the text, enter command EXPORT in the command line of the respective editor or output screen. The following screen appears. The prerequisites and options for the various external environments are described below.

    > export              > + FI: USR-FI1                          L: 1    S: 4
     All  ....+....1....+.... Extended description ...+....5....+....6....+....7..
                    ====================================
                       File additional description
                    ====================================
          This is the exte +------- Export Data ------+ I1.
                           !                          !
                           !     Type of target       !
                           !                          !
                           !   N Natural source       !
                           !   C Connect document     !
                           !   U User defined target  !
                           !   P PC ascii file        !
                           !                          !
                           !    Type of target .. N   !
                           +--------------------------+
   
   
   
   
   
    Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
          Help        Exit

Natural Source

Calling the Function

Enter one of the following in the Editor command line

  • Command EXPORT to display the Export Text selection window, then target type "N"

  • or EXPORT N

The following screen appears:

   > export              > + FI: USR-FI1                          L: 1    S: 4
     All  ....+....1....+.... Extended description ...+....5....+....6....+....7..
                    ====================================
                       File additional description
                    ====================================
          This is the +-------------- Export Data ---------------+
                      !                                          !
                      !                        target .. Natural !
                      !      Member ............                 !
                      !      Library ...........                 !
                      !      User system Fnr ... 54              !
                      !      User system DBnr .. 180             !
                      !      Cipher ............                 !
                      !      Password ..........                 !
                      !                                          !
                      !      Replace object .... N (Y/N)         !
                      !                                          !
                      +------------------------------------------+
   
  

The following parameters are available

Parameter Description
Member Name of the member to which the extended description is to be exported.
Library Name of the library containing the member.
User system Fnr/DBnr File and database number of user system file.
Replace object Y: If the member already exists in the specified library it will be overwritten.
N: Text will not be exported and an error message is given.

Con-nect Document

Prerequisites

Con-nect must be installed.

Calling the Function

Enter one of the following in the Editor command line

  • Command EXPORT to display the Export Text selection window, then target type "C"

  • or EXPORT C

The following screen appears:

    > exp                 > + FI: USR-FI1                          L: 1    S: 5
     All  ....+....1....+.... Extended description ...+....5....+....6....+....7..
                    ====================================
                       File additional description
                    ====================================
          This  +------------------ Export Data --------------------+
          This  !                                                   !
                !                                 Target .. Connect !
                !                                 Folder .. Work    !
                !                                                   !
                ! Specification of Connect document                 !
                !                                                   !
                ! Cabinet .... usr                                  !
                ! Password ...                                      !
                ! Document ...                                      !
                ! Replace .... N  (Y/N)                             !
                +---------------------------------------------------+
  

The following parameters are available

Parameter Description
Folder Text is always transferred to folder Work in Con-nect.
Cabinet Cabinet of the user to which the text is to be exported. If you are exporting text to the cabinet of another user, this user must have granted you permission to his/her cabinet in Con-nect.
Password Only required if you are exporting to the cabinet of another user.
Document Enter name to be assigned to document in Con-nect. Documents exported from Predict automatically receive the description Document added via Predict.
Replace Y: If the document name already exists in Con-nect it will be replaced.
N: If the document name already exists in Con-nect, the text will not be transferred and an error message is given.

User-defined Target

With this version of Predict you can export text from the sources listed on to any user-defined subsystem.

This functionality is described on the documentation file delivered with Predict. See description of the following Program objects for more information.

  • SAG-PRD-U-EXPSRC

  • SAG-PRD-U-EXPSRP

Modify this program to suit your site-specific requirements.

Prerequisites

User exits U-EXPSC and U-EXPSRP which are delivered in source form with this version of Predict must still exist and must have been adapted to meet your site requirements.

Calling the Function

Enter one of the following in the Editor command line

  • Command EXPORT to display the Export Text selection window, then target type "U"

  • or EXPORT U

PC ASCII File

Prerequisites

  • Your Predict session must be running under terminal emulation in a PC environment.

  • Entire Connection for Windows must be installed (Version 4.3.1 or above).

  • Workfile 5 must be defined as PC workfile on the mainframe.

  • The Natural parameter PC must be set to ON, either by

    • specifying PC=ON when starting Natural or

    • entering %+ in the command line of your Predict session.

Note:
In Windows and UNIX environments, Workfile 5 must be set to type "Transfer".

Steps

  1. Enter one of the following in the Editor command line to call the Download Data dialog box: - Command EXPORT to display the Export Text selection window, then target type "P" - or EXPORT P

  2. Specify target file in the Download Data dialog box. If the file exists in the target environment, a window will appear to warn you.

  3. If the text to be exported contains accented characters such as "ä" or "à" click on the OEM transformation button. These characters will then be converted correctly in your PC environment.

  4. Click on the OK button in this window to export the text from Predict to the PC file.

Maintaining Extended Descriptions with Word for Windows

This section covers the following topics:

Extended descriptions of Predict objects can be edited with Word for Windows (Version 6, 7 or 97). Storing this Word for Windows document together with the dictionary object means that all Predict users have access to the fully formatted PC text.

If an extended description is edited with Word for Windows, the PC document containing full formatting instructions is stored in binary format together with the object on the Predict file. An ASCII version of the description containing only text is also stored together with the object.

Prerequisites

Predict

Natural

  • Workfiles 6 and 7 must be defined as PC workfiles.

  • Natural parameter PC must be set to ON, either by

    • specifying PC=ON when starting Natural or

    • entering %+ in the command line of your Predict session.

Entire Connection for Windows

  • Entire Connection for Windows must be installed (Version 2.1.1 or above).

  • Patch level 25 must be installed.

PC Environment

  • Terminal emulation for Predict session.

  • Word for Windows Version 6, 7 or 97 must be installed.

  • The installation drive must not be write-protected (the drive specified under Predict profile parameter Predict Word for Windows directory).

  • The following items are created automatically when the Predict - Word for Windows Interface is installed.  These items may not be deleted or renamed: - installation directory, - document template PRD.DOT in the installation directory.

Installing the Predict - Word for Windows Interface

Step 1 - Define User Task in Entire Connection to Start Word for Windows

See your Entire Connection documentation for detailed information on how to define tasks.

Step 2 - Specify Predict Settings

Now perform the following in your Predict environment (which must be running under terminal emulation on your PC).

  • If Entire Connection is not active, activate it by entering %+.

  • Enter command PROFILE in a Predict command line; enter function code H to display the Handling screen.

  • Enter W (Word for Windows) as first choice editor. This value will be rejected if you are not working in a PC environment.

  • Set Download PC part to Y.

  • Enter the Entire Connection task name defined in Step 1. This task will call Word for Windows. Note: that this name is case-sensitive with Entire Connection version 3.1 and above.

  • Specify a target drive and directory for the Predict document and template file. This entry must end with a backslash!

  • Press ENTER.

The document template PRD.DOT is downloaded to the specified drive and directory on your PC. The Predict-Word for Windows Interface is now installed.

Functional Scope

The following functions are available when the Predict Interface for Word for Windows has been installed and the prerequisites on are met:

  • Add Extended Description, see below

  • Modify Extended Description

  • Add / Modify Extended Description Skeleton

Add Extended Description

The system behavior depends on how your Predict / PC environment is set up: Software AG or Natural Editor as First Choice

If Word for Windows is not defined as first-choice editor (see Step 2 Specify Predict Settings), this function behaves as in Predict version 3.2.

Word for Windows as First Choice Editor

If Word for Windows is defined as first-choice editor, Predict only checks whether the connection from host to PC is active (see Natural Prerequisites).

  • If the connection is not active, no PC session is called and the description is edited with the Software AG or Natural editor.

  • If Word for Windows cannot be called for any other reason, for example the user task defined for Entire Connection for Windows is not executable, or workfiles 6 and 7 are not defined correctly, then the function is terminated. No second or third choice editor is called.

If all the prerequisites are met, a Word for Windows session is started and document PRD.DOC is opened for editing.

Uploading the description to Predict

  • From the Predict menu, choose "Upload to Predict",  or

  • Close your document or exit Word.  A window appears in which you are asked whether you wish to upload the document to Predict.

If you confirm, the following files are uploaded to Predict:

  • PRDULD.DOC. This file contains full formatting information. It is stored as a Word for Windows document together with the corresponding object on the Predict file.

  • PRDULD.TXT. This is a text version without formatting information.

These files are deleted on the PC after they have been successfully transferred to Predict.

Modify Extended Description

The system behavior depends on how your Predict/PC environment is set up: Software AG or Natural Editor as First Choice

If Word for Windows is not defined as first-choice editor (see Step 2 Specify Predict Settings), the system checks whether a Word for Windows document exists in Predict for the object to be processed. If a Word for Windows document exists, the system behavior depends on the setting of the following parameter in the Defaults > General Defaults > Protection screen. This setting is checked when the Editor is called.

PC text modif. on Mainframe A warning is given and the Word for Windows document is deleted in Predict. Description is edited with either the Software AG or Natural Editor
N The description cannot be edited.

Word for Windows as First Choice Editor

If Word for Windows is defined as first-choice editor, Predict only checks whether the connection from host to PC is active (see Natural Prerequisites):

  • If the connection is not active, no PC session is called and the description is edited with the Software AG or Natural editor.

  • If Word for Windows cannot be called for any other reason, for example the Entire Connection user task is not executable, or workfiles 6 and 7 are not defined correctly, then the function is terminated. No second or third choice editor is called.

If all prerequisites are met, the Word document file is downloaded from Predict; a Word for Windows session is started on your PC and the downloaded document is opened for editing.

Uploading the description back to Predict is described above.

Add / Modify Extended Description Skeleton

The system behavior depends on how your Predict/PC environment is set up and whether the skeleton exists additionally as a Word for Windows document. Software AG or Natural Editor as First Choice

If Word for Windows is not defined as first-choice editor (see Step 2 Specify Predict Settings), this function behaves as in Predict version 3.2. Word for Windows as First Choice Editor

If Word for Windows is defined as first-choice editor, Predict only checks whether the connection from host to PC is active (see Natural Prerequisites):

  • If the connection from Host to PC is not active, no PC session is called and the description skeleton is edited with the Software AG or Natural editor.

  • If Word for Windows cannot be called for any other reason, for example the Entire Connection user task is not executable or workfile 7 is not defined correctly, then the function is terminated. No second or third choice editor is called.

If all prerequisites are met, the system checks whether the skeleton exists additionally as a Word for Windows document:

  • If the extended description skeleton exists additionally as Word for Windows document, this document is downloaded to PC.

  • If no Word for Windows document exists for the extended description skeleton, the mainframe version is downloaded to PC.

  • A Word for Windows session is started and the downloaded skeleton is opened for editing.

Uploading the description skeleton to Predict is described under Uploading the description to Predict.