Go to:  Davar site entry | Site contents | Site index | Mainframe | CList | Text bottom

GETWORD  CList  Command

        

GETWORD CList is a customized shortcut to ISPF Data List utility (option 3.4).  It is not a shortcut of a command name (=3.4 is short enough itself), but a shortcut for standard prefixes which get abbreviated via the GETWORD interface.  Abbreviation — Prefix correspondence can be easily customized by updating the WHEN — SET pairs in prefix selection.

This command is particularly useful for computer consultants by providing an easy access to client's data sets some of which often have long names reflecting their business functions with which consultants are not familiar.  GETWORD command permits both to abbreviate and customize data set names' mnemonics so that they are much easier to handle and eventually to memorize.

The heart of the GETWORD command is a prefix-by-abbreviation selection block, where the WHEN — SET pairs can be easily customized (often on the fly) to serve the needs both of stable and short-term name prefix associations.  Normally it makes sense to reserve several numbers for SYSn prefixes and let all other represent the number of a ChangeMan package (ChangeMan prefix is site-specific and it can be determined by browsing a member of a package).  If specified prefix falls though all the above-mentioned tests, it is passed to the Data List utility as-is.

After associations get set, the original DSN prefix is read from the profile, saved in a variable and then new prefix is written to profile.  After that the Data List utility is called (with the new DSN prefix; GETWORD prefix entry panel get skipped).  Upon exit from the Data List utility saved original DSN prefix is restored in profile.

The GETWORD command has an easy accessible help which displays the list of preset DSN prefix abbreviations.  This is performed by viewing the Abbreviation — Prefix pairs extracted from GETWORD command text by the LISTPRF macro.  Example of help display can be found below the command text.




     /* GETWORD  Get Word at Cursor (Left/Right/Both)  11/23/1996–10/07/1998
     /* --------------------------------------------------------------------
     /* Copyright (C) 1993–1998 by Vladimir Veytsel            www.davar.net

     /* Cursor MUST point somewhere WITHIN the word to be selected
     /* If cursor points to '(', then ')' is appended to selected word

        PROC 1 DIR  /* Direction of word scanning:
                    /* L  - Scan word LEFT  from cursor pos to delimiters
                    /* R  - Scan word RIGHT from cursor pos to delimiters
                    /* B  - Scan word BOTH  Left and Right of cursor pos

        CONTROL NOCAPS
     /* CONTROL NOCAPS,SYMLIST,CONLIST,LIST,MSG

        GLOBAL LDLM,  /* Left  word scanning delimiters (* - use default) */+
               RDLM   /* Right word scanning delimiters (* - use default) */+
               WORD   /* Selected word to be returned to the caller

        SET Delim=&STR( .,:;())  /* Default word scanning delimiters

        IF (&STR(&LDLM)=) +
           THEN SET LDLM=&STR(&Delim)
        IF (&STR(&RDLM)=) +
           THEN SET RDLM=&STR(&Delim)

        ISREDIT CAPS         = OFF
        ISREDIT (First,Last) = BOUNDS
        ISREDIT (Line,Pos)   = CURSOR
        ISREDIT (String)     = LINE &Line

        IF &STR(&SUBSTR(&Pos,&STR(&String))))=&STR(() +
           THEN SET Append=)

        IF ((&STR(&DIR)=L)³ +
            (&STR(&DIR)=B)) +
           THEN DO I=&Pos-1 TO &First BY -1
                   SET Symb=&SUBSTR(&I,&STR(&String))
                   IF (&SYSINDEX(&STR(&Symb),&STR(&LDLM))>0) +
                      THEN GOTO Get_Right
                   SET Left=&STR(&Symb&Left)
                END

        Get_Right:  +
           IF ((&STR(&DIR)=R)³ +
               (&STR(&DIR)=B)) +
              THEN DO I=&Pos+1 TO &Last
                      SET Symb=&SUBSTR(&I,&STR(&String))
                      IF (&SYSINDEX(&STR(&Symb),&STR(&RDLM))>0) +
                         THEN GOTO Comb_Word
                      SET Right=&STR(&Right&Symb)
                   END

        Comb_Word:  +
           SET WORD=&STR(&Left&SUBSTR(&Pos,&STR(&String))&Right)&STR(&Append)
  


View [and save] GETWORD.CLS text   (Use [Back] button or [Alt]+[CL] to return here)
Go to:  Davar site entry | Site contents | Site index | Mainframe | CList | Text top