*instructions, (Includes *init, *term)
XTAB Documentation

The *instructions section contains the following commands:

 Command  Abbreviation  Description
     
ALTERATION:    
 var eq     Replaces the value of a variable with a stringlist.
 trim  tr   Trims the leading and trailing spaces of a variable(s).
 ucase  uc   Converts a variable(s) value to upper case.
 lcase  lc   Converts a variable(s) value to lower case.
     
CONDITIONAL:    
 select  se   Continues processing if condition is true, else reads next record, does not pass record to tables.
 if     If condition.
 elseif  ef   Else if condition.
 else  el   Else statement.
 endif  nf   End if statement.
     
DIRECTIVES:    
 print  pr   print a stringlist.
 write  wr   write a stringlist to an output file.
     
     


Command: var eq
Usage  : var eq stringlist
         var eq var,string,'string',nx ...

Replaces the value of var with specified string list. Use 'string' if the string contains leading or trailing spaces or commas. Use nx to represent n spaces.

Examples:

v1 eq v2
name eq last,',',first
phonenum eq 1-(,areacode,)-,ddd,-,dddd
entry eq lastname,', ',firstname,20x,phonenum
top
Command: trim (tr) Usage : trim var(,var ...)

Removes leading and trailing spaces from variable list.

Examples:

trim company,title,description

 

top
Command: ucase (uc) Usage : ucase var(,var ...)

Converts values in variable list to uppercase.

Examples:

ucase company,title,description
top
Command: lcase (lc) Usage : lcase var(,var ...)

Converts values in variable list to lowercase.

Examples:

lcase company,title,description
top
Command: select (se) Usage : select condition

Continue processing if condition is true.

Examples:

select sex eq M
select class eq A,C,P
select value > 20000
se     number numeric
se letter eq a-m
se letter ne a,e,i,o,u
top
Command: if Usage : if condition if var cond var, string, string - string ...

Continue processing if condition is true.

Examples:

if sex eq M
if class eq A,C,P
if value > 20000
if number numeric
if letter eq a-m
if letter ne a,e,i,o,u
top
Command: elseif (ef) Usage : elseif condition

Continue processing if previous if/elseif condition is false.

Examples:

elseif sex eq M
elseif class eq A,C,P
elseif value > 20000
ef     number numeric
ef letter ne a,e,i,o,u
top
Command: else (el) Usage : else

Continue processing if previous if/elseif condition was false.

Examples:

else
top
Command: endif (nf) Usage : nf

Terminates last if block.

Examples:

endif
nf

 

top
Command: print (pr) Usage : print stringlist print var, nx, string, ' string ' ...

Prints a line.

Examples:

print name,rank,serialnumber
print name,5x,rank,5x,serialnumber

pr name,1x,is employed at:,company,1x,and makes,1x,salary
pr name,' is employed at:',company,' and makes ',salary

 

top
Command: write (wr) Usage : write handle stringlist

Writes a line to a file. The file must have been previously defined in the *files section, output command.

Examples:

output f1 nrs.log
output f2 nrs.txt

output sallist1 /data/namecompany.log
output sallist2 /data/namecompany.txt
...
write f1 name,rank,serialnumber
write f2 name,5x,rank,5x,serialnumber

wr sallist1 name,1x,is employed at:,company,1x,and makes,1x,salary
wr sallist2 name,' is employed at:',company,' and makes ',salary
top