Contents of Article


Sample SET Edit session

Using SET to Define SPFLite Options


Syntax


SET


[  name  [  OFF  |  { = value }  ]  ]



Operands


name

Defines the name of the SET variable. A SET variable name is case-insensitive, and must be a letter followed by zero or more letters, digits and underscores. 


SET variable names may also contain dot characters. Dots may appear anywhere in the name, except for the first position which must be a letter. 


Because the command notation =X is a shortcut for the command EXIT, a SET variable with a name of X is not allowed; the name X is reserved. (This shortcut emulates a notation used in IBM ISPF to quickly exit that editor.)


SET name by itself will display the current contents of SET variable name.


SET with no operands will bring up a SET Edit session.


OFF

SET name OFF will remove the SET variable name.  Once removed, attempting to remove it again will produce the message Unknown SET variable.



= value

SET name = value will assign value to SET variable name.  If the value contains embedded blanks, it must be quoted.


If the value contains quotes, you must enclose the entire value in other quotes. For example, suppose you want to reference a number of 12345 as a string by using the SET variable name NUM in several CHANGE commands, such as:


CHANGE ABC =NUM  


If you defined this as SET NUM = '12345' this would not work, since the value would just stored as 12345 without the quotes, and the CHANGE command would effectively be


CHANGE ABC 12345


and the 12345 would look like a line number, not a string. To store the SET variable's value so that the quotes are included, you would have to “quote the quotes”. The correct command would be SET NUM = "'12345'"

Then the CHANGE command would get correctly expanded to


CHANGE ABC '12345'


NOTE:   The operands of SET must be separated by blanks.  That is, 


       SET LINE = 123


is valid, but


       SET LINE=123


is invalid syntax, and will result in Unknown SET variable: =123. This happens because SPFLite tries to expand the '=123' part of the command as if it were a SET variable. 




Description


The SET command is used to store named values, known as SET variables. A SET variable is comparable to a Windows environment variable in the way it is defined and used.


In SPFLite primary commands, you can access the value of a SET variable by putting an = equal sign followed by the name of the variable. Suppose you wanted to refer to a certain line number by name. You could say,


       SET LINE = 1234


and then use it in commands as a symbolic name for 1234:


       CHANGE ABC DEF =LINE

or

       LOC =LINE

       

Wherever you said =LINE the value of LINE, 1234, would get substituted.


Concatenation


Normally, SET substitution is done in regular 'word' mode, where the SET value replaces the =xxxxx value in the command line. It is possible to concatenate the SET value to following characters.  This uses the normal concatenation character |.  e.g. If a SET variable was SET ABC = DEF, and the command line contained =ABC|GHI the substituted value would be DEFGHI.


       

Sample SET Edit session


If you issue the SET command by itself, you will bring up a SET edit session. This is marked by a file tab of (SET Edit).



To ensure the integrity of the SET values, the SET command cannot be issued from any tab when a SET Edit session is active.


You can add, change or delete SET variables in the SET Edit session, or just browse their contents. When you issue an END command, the contents of the SET Edit session become the new values of all SET variables, and can be used immediately. It's not necessary to say SAVE in a SET Edit session. That is implied, and SPFLite takes care of that for you. However, it is possible to say CANCEL in a SET Edit session, which will discard any changes you might have made.


The SET variable values are stored in the normal SPFLite.CFG file, along with most other settings.


Note: As you observe the SET Edit display above, the name and value are separated by a single = sign with no spaces between. This is not the same format as the SET command, which requires spaces between the operands.  Yes, we know it isn't consistent - it's just the way it is.



Using SET to Define SPFLite Options


SPFLite has several options which are controlled via SET options.


Command Aliases


You can define command aliases for primary commands using the SET command. A command alias name applies to both an Edit/Browse session and to the File Manager.


You can use an alias to modify an existing command. For example, an alias could change an L command into an L TOP command in order to add TOP to any normal L command.  Or it can simply provide an alias to shorten an otherwise long command or macroname. 


You define a command alias by the following SET command:


SET ALIAS.name = command 


The name portion of the SET variable specifies the new alias name you want to define. 


The command portion of the SET command specifies the primary command to be executed when you type name on the primary command line. command may be the name of a macro or an SPFLite built-in primary command.


command may optionally contain operands. There are two types of operands:


Simple strings         There are just normal command line operands, The resulting command line will be the  name you entered, followed by the operands you entered in the SET statement, and then followed by the remaining typed operands on the command line. 


Operand Substitution        This feature allows you to selectively choose or re-arrange operands entered after the name. These are symbolic variables of the format =n, like =0, =2 etc. Valid numbers are from =0 to =9


       The Numbered operands are replaced by the original typed values, where =0 is the command name, =1 is the 1st operand, =2 the 2nd, etc.


Example        SET ALIAS.MYCMD = CHANGE =2 =1 ALL

       This would create a command (MYCMD) which performs a CHANGE command with the operands reversed. i.e. If you entered MYCMD AAA BBB, the effective command after substitution would be CHANGE BBB AAA ALL.


Note: The operand =variables can be joined (=1=2 or =2ABC), but the full variable names =ABC can only be used as separate operands. i.e. you cannot say ABC=VARDEF - where =VAR is the variable.


Aliases are normal SET names, and all rules for SET names apply to SET aliases. To delete an alias, you can issue SET ALIAS.name OFF, or enter a SET Edit session and delete the line containing the SET alias definition.


NOTE:  Alias names are only recognized as such as the first word on the command line. If an alias name appears anywhere else, it is an ordinary SPFLite command operand with no special meaning.


Macro Pending


This type of SET statement allows you to flag a particular Macro name as one which should be allowed to generate a "Pending Line Command" message. Normally, Macros would not be allowed to do this.  To activate this for a specific macro name enter


SET PENDING.macroname = Y


Macro TRACK activate


Normally Macros do not trigger the creation of TRACK saving, this SET command allows you to activate triggering TRACK support for a particular macroname.


SET TRACK.macroname = Y


AUTOFAV Control


AUTOFAV allows you to specify filenames which match a specific mask format to be automatically added to a specific FLIST. More information on AUTOFAV can be found at "AUTOFAV to add to FILELISTS" and "File Lists - FLISTS"


SET AUTOFAV.*.EXT1=EXT1FLIST

 


Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Efficiency with a Help Authoring Tool