TANDEM Help file

 

Index

 

TANDEM Help file. 1

TAL. 3

Data Types: 3

Control statements: 6

Standard Functions. 8

Compiler Directives. 8

Procedures and Subprocedures. 9

Multitasking & Multithreading. 9

Types of registers: 9

Addressing mode: 9

INSPECT: 10

DDL: 11

BIND.. 12

ENSCRIBE. 14

Comparison of Structured files. 14

Record Management Functions Summary. 14

NonStop SQL/MP. 18

Access Options. 18

Lock Modes. 18

Views. 18

Indexes. 18

Partitions. 19

SQL Catalogs. 19

what are audited and non-audited tables?. 19

Remote Database Facility (RDF) 19

Safeguard security management facility. 19

ENFORM: 19

COBOL. 22

Program Organization. 22

Description of records: 22

Procedure Division. 23

Program Compilation and Execution. 23

Pathway. 25

Pathway System Components: 25

PATHCOM Commands. 25

Configuring the PATHMON Environment 25

TACL. 26

TACL Variables. 26

Few Functions and Commands: 27

Enabling TACL Debugger: 27

?SECTION Directive. 27

OSS (Open System Services) 27

gtacl Utility. 27

Compilation Tools. 28

Summary of VI commands. 29

Cutting and Pasting/Deleting text 29

Inserting New Text 29

Moving the Cursor Within the File. 29

Moving the Cursor Around the Screen. 31

Replacing Text 31

Searching for Text or Characters. 31

Manipulating Character/Line Formatting. 32

Saving and Quitting. 32

Miscellany. 32

My additions: 33

EX Commands. 33

FAQ: 35

GUARDIAN Help: 37

G-Series Highlights and Migration Planning Guide. 39

Tandem NonStop TCP/IP. 40

Layering. 40

Socket Library Routines. 40

Internet Addresses. 41

Port Numbers. 41

TCP/IP Basic Steps. 42

 


TAL

 

TAL is single pass, high level, block structured language that works efficiently

with the system hardware to provide optimal object program performance.

 

Data Types:

 

Data Type

Description

STRING

8-bit integer byte

INT, INT(16)

16-bit integer word

INT(32)

32-bit integer double word

FIXED, INT(64)

64-bit fixed point quadruple word

REAL, REAL(32)

32-bit floating point double word

REAL(64)

64-bit floating point quadruple word

UNSIGNED(n)

n-bit field, where 1 <= n <= 31

 

To convert word address to byte address use left shift e.g.

int var;

string .var_ptr := @var '<<' 1;

 

When you initialize int with string  then compiler allocated byte in the left and keep right vacant but when you assign it does reverse.

 

REAL has E while REAL(64) has L. e.g.

REAL  -17.2E-1

REAL(64) -17.2L-1

 

when you specify the unsigned variable you must do it as below

UNSIGNED(5) bit_var;

You cannot initialize UNSIGNED variable when you declare it.

 

Compare Literals and Defines:

 

Literal declaration associated identifier with constant values while define

Associates identifier with text.

No Storage for literals and defines.

 

e.g.

Literal a,         here a is assigned 0, b assigned 1and c 2.

        b,

        c;

 

DEFINE increment (x) = x := x +1 #;

 

Define declarations are not invoked when

1.       Within comment

2.       Within char string constant.

3.       On the left side of declaration.

 

For e.g. following DEFINE y will invoke but not x

  int x:= y;

 

Thus Literal is named CONSTANT and define is named TEXT.

 

ARRAY:

You cannot initialize extended indirect local arrays or UNSIGNED arrays.

 

ReadOnlyArray: Allocates storage in user code segment. They are sometimes

Referred as P-relative array because they are addressed using program counter

(P-register). As code segment have no primary & secondary areas, read only

array must be direct. You must initialize read-only arrays. UNSIGNED read-only

arrays are not allowed because they cannot be initialized.

STRING prompt = 'P' := ["Enter Character: ",0];

INT error = 'P':= ["INCORRECT INPUT"];

 

Declaration of array:

INT b_array[0:19]; UNSIGNED (1) flags[0:15]

We declare extended array as INT .ext

Global primary area: 256 words

Local primary area: 128 words

Total of primary & secondary area = 32K words.

When you use . symbol then variable is stored in secondary area.

Sub-local area has no secondary area; so sub-local array cannot be indirect.

 

Initialize array:

int .numbers[0:6] := [1,2,3,4,5,6,7];

Local extended arrays cannot be initialized.

 

When you declare Standard Indirect Array, compiler allocates

1.       Word of storage in global (local) primary area of user data segment for implicit pointer.

2.       Then allocates space for array in global (local) secondary area.

3.       Initialize pointer in step 1 with 16-bit address of array.

 

When you declare Extended Indirect Array, compiler allocates

 1. Double-word of storage in global (local) primary area of user data segment

    for implicit pointer.

 2. Then allocates space for array in automatic extended segment.

 3. Initialize pointer in step 1 with 32-bit address of array.

 

Copying from one array to another:

new_Array[0] ':=' old_array[0] FOR byte_count BYTES.

 

Compiler does standard move and returns 16 bit next address if

both arrays have byte address or both arrays have word address.

It returns 32 bit address if one array has byte and other has word or

either array has extended address.

 

Comparisons are unsigned whether u use signed or unsigned.

signed = < > <= >= <>

unsigned '='. '<', '>'. '<='. '>='. '<>'

 

 

***IMP** The move statement treats negative number as UNSIGNED so make sure that

no negative number is there. Number such as -1 is treated as 65535.

 

 

STRUCTURES:

Definition: Describes structure layout and allocated storage.

Template: Describes structure layout but no storage.

Referral: allocated storage for previously declared structure.

 

Structure declared in subproc must be direct. Large structure should be used

with .ext, e.g.

 

struct .ext inventory[0:1999]

begin

int item;

int quantity;

fixed(2) price;

end;

 

Template should be defined as below

struct inventory(*);

BEGIN

 int item;

 int price;

END;

 

Referral:

struct .customer(inventory) [1:49];

 

Structure elements:

You cannot initialize array when declared as structure element.

 

INDEX of standard indirect structures must be a signed INT exp. while

index of extended indirect structures must be a signed INT or INT(32)

depending upon offset.

 

To copy structures use

d_struct ':=' s_struct FOR elements

 

If you use BLOCK declaration then u must NAME the compilation unit.

If the current compilation unit has private block declaration , then NAME

identifier has global scope among all the compilation units. No other

compilation unit in the target file can use the same identifier at the global

level. If the current compilation unit has no private block, then identifier has

global scope within current compilation only.

NAME - UNBLOCKED GLOBAL DATA--- BLOCKED GLOBAL DATA -PROC DEC.

 

Statements:

ASSERT : conditionally invokes the procs defined in ASSERTION directive.

?ASSERTION 5, PROCESS_DEBUG

ASSERT 10 :$CARRY

 

Move statement:

array[0] ':=' num * [" "] -> @next_addr;

 

SCAN statement:

SCAN byte_ptr[0] UNTIL "," ;

IF $CARRY is true after SCAN UNTIL then test char doesn't found. IF $CARRY

is true after SCAN WHILE then char other than test char not found.

 

STACK statement:

loads values into the register stack.

STORE statement:

removes values from the register stack.

 

PRIVILEGED PROCEDURES:

The following types of procs executes in privileged mode.

CALLABLE or PRIV proc:

A nonpriv procedure that is called by a CALLABLE or PRIV procedures.

 

proc submain CALLABLE;

begin

end;

Only procedures that operates in privileged mode, can access system global data.

 

Control statements:

 

IF ... then

ELSE

 

CASE area_code OF

 BEGIN

  408,415->

  location := bay_area;

  213,308->

  location := los_angeles;

  OTHERWISE->

  location := elsewhere;

 END;

 

While loop tests condition for each iteration, if condition is false

it stops executing.

 

WHILE item < len DO

BEGIN

  array[item] := 0;

  item := item +1;

END;

 

DO loop executes till condition is false.

DO

BEGIN

 i:= i+1;

END

UNTIL i>6;

 

FOR index := 0 TO limit DO

 array[index] := o;

 

FOR index := 0 TO limit BY 5 DO

...

 

Sharing data in mixed language programming:

 

To share C global data with TAL routine:

 

1.       In C declare global data compatible with TAL type.

2.       In TAL module declare pointers to the above data using C compatible type.

3.       In TAL, write module to which C can pass address of the shared data.

4.       In TAL module, initialize pointers with the address send by C.

5.       Use pointers to access C data.

 

C code

#include <stdio.h>

short arr[5];    /* data to be shared */

char charr[5];  /* data to be shared */

 

_tal void INIT_TAL_PTR(exptr short *, exptr char *);

 

main()

{

 INIT_TAL_PTR( &arr[0], &charr[0]);

}

 

 

TAL code

INT .ext tal_int_ptr;         -- pointers to above data

STRING .ext tal_string_ptr;   -- pointers to above data

 

PROC INTI_TAL_PTR(c_addr1, c_addr2);

INT.ext c_addr1 ;

STRING .ext c_addr2;

BEGIN

@tal_int_ptr := c_addr1;

@tal_string_ptr := c_addr2;

END;

 

To share TAL global data with C routine:

 

1.       In TAL declare global data compatible with TAL type.

2.       In C module declare pointers to the above data using TAL compatible type.

3.       In C, write module to which TAL can pass address of the shared data.

4.       In C module, initialize pointers with the address send by TAL.

5.       Use pointers to access TAL data.

 

TAL Code:

 

INT .EXT tal_inti_array[0:4];  ! tal data to be shared with C

STRUCT .EXT tal_struct(rec);

 

INT PROC init_c_ptrs(tal_intptr, tal_charptr) language C;

 INT .EXT tal_intptr;

 Struct .ext tal_strptr;

EXTERNAL;

 

C Code:

 

short *c_int_ptr;

char *c_char_ptr;

 

short INIT_C_PTRS( short *tal_intptr, char *tal_charptr)

{

  c_int_ptr = tal_intptr;

  c_char_ptr = tal_charptr;

  return 1;

}

 

Guidelines to use TAL with CRE:

1.       Specify ENV COMMON directive. SET any heap red by ?HEAP directive.

2.       Include CRELIB, TALLIB lib files.

3.       USE CRE_INITILISER, CRE_TERMINATOR etc.

4.       Do not write data to upper 32k word area directly.

5.       When error occurs CRE routine returns to TAL without doing any action so TAL routine must handle error conditions.

 

 

Standard Functions

 

Type Transfer:

$DBL : converts INT to INT(32)

$DBLL : INT to INT(32)

$INT : converts INT(32), REAL to INT

$DFIX : INT(32) to FIX.

$FIXD : FIX to INT(32)

$FIXI : FIX to INT

$EFLT : INT to REAL

$SCALE: Used to moves the decimal point in FIXED(fpoint) expression.

 

Address transfer:

$XADR : standard to extended

$LADR : extended to standard

 

Character test:

$ALPHA, $NUMERIC, $SPECIAL

 

Minimum, max:

$LMIN, $LMAX : unsigned

$MIN, $MAX : signed

 

Carry & overflow:

$CARRY, $OVERFLOW

 

Variable:

$LEN,$OCCURS,$TYPE

 

Compiler Directives

 

Compiler Input:

?ABORT, ?SECTION,

?SOURCE: sources in code from the another input source file

 

Compiler Listing:

?CODE, ?LIST, ?PAGE, ?SUPPRESS

 

Diagnostic:

?ERRORFILE: logs compilation errors & warning to an error file so that u can

fix the errors using TACL FIXERRS macro. Errorfile is of code 106.

?ERRORS, ?RELOCATE ?WARN

 

Object File Content:

?SQL: Prepares for NonStop SQL statements

 

Conditional Compilation:

?DEFINETOG, ?ENDIF, ?IF, ?SETTOG, ?RESETTOG

 

Runtime Environment:

?DATAPAGES: Sets the size of the data area in the user data segment.

?EXTENDSTACK: Increases the size of data stack in the user data segment,

?HEAP: Sets the size of CRE user heap.

?HIGHPIN, ?SYMBOLS, ?SAVEABEND, ?INSPECT ,

 

Following directives accept filename as argument.

?ERRORFILE, ?LIBRARY, ?SAVEGLOBALS, ?SEARCH, ?SOURCE, ?USEGLOBALS

 

 

·         Error 57: symbol table overflow.

·         To remove symbols from object use STRIP <objname>.

 

Procedures and Subprocedures

 

Difference between proc & subproc:

·         Proc scope is global in program, subproc scope is local.

·         Proc can contain another subprocs, but subproc cannot contain other subproc.

·         Procs are callable from anywhere in program, subprocs are callable from proc only.

·         127 words for primary storage of procs, for subproc its 27 words.

·         Subproc don't have any secondary area.

 

To convert variable proc into extensible use keyword EXTENSIBLE and specify the

number of parameters in variable procs. e.g.

proc msg ( a, b,c, new_param) EXTENSIBLE (3)

This specifies new_param has new param and 3 in original variable proc.

 

Use $OPTIONAL for parameter checking.

 

Multitasking & Multithreading

 

·         Multitasking doing multiple tasks at a time in foreground and background. Types are Context multitasking, time slicing, and co-operative.

·         During single tasking only one process is active at a time and other are suspending but in multitasking all are active none is suspending state.

·         Multitasking is a parallel processing where program makes use of multiple CPUS built into hardware.

·         Multithreading: Internet explorer. Task divided into threads.

 

Types of registers:

 

Program register: contains address of next instruction.

instruction register: contains currently executing instruction.

local: beginning address of local data area.

stack: address of last word allocated.

register stack: contains registers(RO-R7) that compiler uses.

Environment: info about current process, RP

 

Addressing mode:

 

Direct: It uses 16-bit addressing. Requires only one reference. It’s not absolute. It’s relative to  the base of global, local or sub-local. You can use this only in lower 32k area.

 

Standard indirect & extended indirect: Requires to 2 memory references. First

location that contains address and second that contains data.

Standard indirect is 16-bit addressing system. It’s byte or word in

lower 32k and word in upper 32k. Extended is always 32-bit addressing.

 

Managing Addresses:

You can use upper 32k word area of the current user data segment if you are not using CRE. USE DATAPAGSES directive such as ?DATAPAGES 33.

To accesses word address in upper 32K area use standard 16-bit pointer.

To access byte address use 32-bit extended pointer.

INT .std_ptr := %10000;  first 16-bit word address in UPPER 32k area.

INT .ext top_ptr := %20000D; first 32-bit byte address in UPPER 32K area.

 

Use $XADR to convert standard address into extended address.

Int .std_ptr := %10000;

Int .ext ext_ptr;

@ext_ptr := $XADR(std_ptr);

 

Managing large block of memory:

LITERAL head_size = 19D;

INT .EXT poolhead := %20000D;

INT .EXT pool := %20000D + head_size;

INT .EXT block;

status := DEFINEPOOL(poolhead, pool, head_size);

@block := GETPOOL(poolhead, 1024D);

CALL PUTPOOL(poolhead, block);

INSPECT:

 

Inspect for high level debugging.

source code debug., default decimal Debug for machine level debug, address mode, m/c code , control program, default octal.

low level TRACE command differs slightly from high level TRACE. HIGH level

command includes an entry for the current scope unit while low level doesn't

 

Difference between low level inspect & debug:

low level inspect doesn't support DEBUG ALL parameter when setting breakpoint,

Low level inspect allows to write output to disk file, debug to non-disk file

such as spooler.

Debug allows you to modify code locations. You cannot modify code location

with either low level or high level inspect.

Low level inspect displays address in extended mode while Debug shows

in 16 bit word address.

 

execution by instruction by Instruction.

local system customization :INSPLOCL

personal customization     :INSPCSTM

 

For debugging across network, expand link should be there, remote password,

inspect should be started remotely.

 

High level: source level access, symbols should be included , default decimal

low-level: machine level access, no symbols required, default octal.

Difference in command such as break, modify, trace.

Add source assign command enables u to inform inspect where to find source file

when their location has changed.

 

To generate break point for specific time use

break #procname EVERY 10 TEMP 3, break #procname TEMP 5 etc..

 

THEN clause allows u to use list of command in " ". such as

break #procname THEN "modify vara; resume"

break #procname EVERY 42 IF vara< 100

DISPLAY arr, display arr WHOLE gives array element in " ". display arr plane

shows element without array name.

 

FROM clause is used if we have two functions with the same name.

 

DEBUG:

For multiple code segment u must specify the code segment where address is

located, as well as address.

UC :USERCODE SPACE, UL : user library

b #UC.1 means usercode space and segment #1.

Display VALUE clause is useful.

To show address use d (@var)

display  x FORMAT (E10.4, E10)

Info segment gives info about segment like

segid, length, description, Type, swapfile.

List alias AS COMMANDS.

Modifying strings:  When u modify string, new string cannot exceed 250 bytes, to avoid this modify string in parts.

Use modify whole to modify the elements of array.

Set status line25 & set status scroll commands control the information

Inspect displays in the event-message system.

show subproc scoping local | sublocal

 

Two types of Buffering/reading system:

1.       Cache buffering:

2.       Sequential block buffering:

block is physical I/O size between Guardian-90 and disk.

 

Cache buffering:

Record to be retrieved is searched in cache, if present moved to application

process, if not then record is moved from disk to cache, and then to application process.

 

If you read file sequentially, use SBB. This applies to READ ONLY and not WRITE

With SBB entire block is returned from disk process to PFS. Subsequent read is

done entirely by file system and no hardware disk access, no communication with

disk and no environment changes, reduces I/O.

 

 

DDL:

Dictionary maintenance.

1. Generating backup schema.

  ddl

  >?dict <dict^name>

   ?source <source^outputfile>

   output *

 

2.Adding new object to dict.

If new object has the same name as old one , ddl replaces the old one with new one, but for new constant it gives error message.

?dict <dict^name>

?source <source^file>

 

3. Deleting object:

?dict <dict^name>

?delete <object^name>

For deleting reference object use OUTPUT UPDATE <object^name>

 

4. Modifying object:

Modifying records, SPI TOKEN are easier as they are never referenced by any other object.

 

5. Moving dictionary from one place to another.

Moving non-audited dictionary is simpler than audited.

 

USE FUP DUP, FUP ALTER to alter the alternate key file of dict.

e.g.

FUP DUP DICTKDF, $VOL.SUBVOL.*

VOLUME $VOL.SUBVOL

FUP ALTER DICTKDF, ALTFILE(0,DICTALT)

 

?DICT : creates AUDITED dict.

?DICTN: creates NON-AUDITED dict.

?DICTR: opens dict for READ-ONLY.

 

?TALBOUND command is useful for setting bounds..

?TALBOUND 1, ?TALBOUND 0

?talunderscore , converts hyphens into underscores, by default it converts

into circumflex.

 

Compare TACL Routine & Macro:

·         Arguments in macro are substituted without check. each argument is checked by position. Routine can check its argument type by #argument, and can compute its own result.

·         Macro is used where limited need of validating argument is required and no condition exists.

·         Routine can handle exceptions, check argument, and control flow of program.

 

BIND

 

The Binder program is a tool you can use to read, link, modify, and build executable object files. You can bind C, COBOL85, Pascal and TAL object files, including SQL program files.

Follow the guild lines when you bind SQL program files:

 

If you do not specify the RUNNABLE pragma when you compile the a single-module program, you must explicitly use the binder program to set this attribute in the object file, otherwise it does automatically.

For a multiple-module program, use the Binder program to combine the object code from each module into a single executable object file.

You can run Binder program from TACL prompt by BIND command.


ENSCRIBE

Enscribe is a disc file architecture that is supported by the GUARDIAN 90 file system, provides high-level access to records in a database.

 

Disk file Types:

·         Unstructured

·         Structured: key-sequenced, entry-sequenced and relative.

 

Comparison of Structured files

 

 

Key-Sequenced

Entry-Sequenced

Relative

1

Records are ordered by the value in primary-key field.

Records are in the order in which they are entered.

Records are ordered by relative record number.

2

Access is by primary or alternate key.

Access is by record address or alternate key.

Access is by record number or alternate key.

3

Length of primary key varies. Key is actually part of record. ENSCRIBE uses index blocks to locate primary key, which is stored in record.

Record address is primary key. Length: 4 bytes.

ENSCRIBE uses record address to find physical location of record in file.

Record number is primary key. Length: 4 bytes.

ENSCRIBE uses record number to perform calculation to find physical location of record in file.

4

Space occupied by a record depends on length specified when written.

Space occupied by a record depends on length specified when written.

Space allowed per record is specified when the file is created.

5

Free space in block or at end of file is used for adding records.

Space at the end of file is used for adding records.

Empty positions in file are used for adding records.

6

Records can be deleted, shortened, or lengthened (within the maximum size specified).

Records cannot be deleted, shortened, or lengthened.

Records can be deleted, shortened, or lengthened (within the maximum size specified).

7

Space freed by deleting or shortening a record can be reused.

A record cannot be deleted, but its space can be used for another record of the same size.

Space freed by deleting a record can be reused.

 

Record Management Functions Summary

 

Function

Procedure

Description

Delete

WRITEUPDATE

From Key-seq or relative as indicated by primary-key value.

Find

KEYPOSITION,

POSITION

 

Insert

WRITE

 

Lock

LOCKREC,

LOCKFILE,

READLOCK,

READUPDATELOCK

 

Unlock

UNLOCKREC,

UNLOCKFILE,

WRITEUPDATEUNLOCK

 

Read

READ

Read subset of records sequentially

Update

READUPDATE,

WRITEUPDATE

Random position in file

 

BIG files
On Tandem, Enscribe and SQL are the (only) two ways by which an application program can maintain its data.
Enscribe, with the help of DP2 disk process, manages database of an application in the form of records. It also maintains data integrity in case of fatal errors.
Initially, Enscribe was designed to support files upto 2GB size. Since disk drives available at that time were of few 100 MBs only, a limit of 2GB was found sufficient. Moreover, since integers were used to hold record pointers and EOF information, 2GB could fit well into a signed integer (2^15 = 2GB).
To suffice application needs of huge data files (files larger than 2GB), concept of partitioning was introduced. But there is a maximum limit of 16 partitions for a file in Enscribe. SQL, which was introduced later, had no such limits. Moreover, SQL allows adding and deleting partitions to Key Sequenced tables, which is not possible with Enscribe Key Sequenced Files.
With the invention of disk drives greater than 2GB (Disks of size 72GB disks are expected in future), 2GB limit seemed to be a restriction on Enscribe, which needed to be overcome. With D46 release of NSK for K-Series Systems (and G06 for S-Series Systems), Enscribe supports unpartitioned files of size 1TB (1024 GB).
The new (Big File) version of file is called Fomat 2 file, whereas the older version has been termed as Format 1.
Note: Format 2 File Concept is valid only for database files. EDIT Files (Code 101), Object Files (Code 100 or 700) and all other files having reserved Code Number (Code Numbers Between 100 and 999) cannot be Format 2.

What is the meaning of Primary Extents, Secondary Extents and MAXEXTENTS?

An extent is a set of n disk pages (n = value of extent). An enscribe file is created with extents.
A disk page represents 2K of data (= 2048 bytes).
Extents are allocated in consistent data blocks on the physical disk drive.
Primary extent: The disk space 'booked' when the first data is written to the file. The size is defined by the value of Primary Extent Size.
Secondary extent: Whenever the first/previous extent is filled up, new disk space is 'booked'. The size is defined by the value of Secondary Extent Size.
MAXEXTENTS: The maximum value of extents to allocate for a file (1 primary + 1 or more secondary extents).
The Primary extent is the amount of physical disk space allocated for a file when the first piece of data is written to it. When that space is filled, a Secondary extent is allocated based on the size given in the file description. The maximum number of extents for a file is determined by the value of MAXEXTENTS, and is the total number that will be allocated to a file before it is considered "full".
Example: Creating a file with Ext (5000, 3000), MaxExtents 16 means:
The first write will allocate (reserve or book if you want) 5000 pages on the physical disk = 5000 * 2048 = 10.240.000 bytes (= ~10MB). Once you filled the ~10MB of data, a next extent is allocated. The size is 3000 pages on the physical disk = 3000 * 2048 = 6144000 (= ~6MB). Same scenario when this extent is filled. MAXEXTENTS delimits the maximum file size. In this example the maximum data size all in all will be (5000 + (15 * 3000)) * 2048 = 50000 * 2048 = 102400000 (= ~100MB)
Notes: Allocating extents takes time. The bigger the data income/growth, the bigger the extents should be. If you know you have a lot of data use a big primary extent so that the seek time is reduced because the data will be stored in a physically contiguous space. A once allocated extent is not freed automatically when data is deleted (or fup purgedata is done). You can release unused allocated extents with the 'FUP Deallocate' command.

What is Enscribe? A file system or a database management system?
Enscribe is NOT a file system. It is a hierarchical type of database management system. Tandem systems support two kinds of databases: NonStop SQL/MP which is a Relational Database Management system, and Enscribe

UNSTRUCTED FILES:

Separate current-record, & next-record pointers are associated with each

opening of file, so if same file is opened several times, each opening provides

a logical separate access. But only one EOF pointer is there so only one

process can append data.

You can access file by RANDOM access by using POSITION call.

 

CALL POSITION(filenum, 81920D);

CALL READUPDATE(filenum, buffer, 512);

CALL WRITEUPDATE(filenum,buffer,512);

 

Appending to the END

call POSITION(filenum, -1D);

 

KEY-SEQUENCED FILES:

logical record = blocksize-32

Maximum record size allowed is blocksize-32.

Key-Compression: leading chars

Index-Compression: trailing chars

 

To insert record

cust^rec := ' ' & cust^rec for $LEN(cust^rec)-1 BYTES;

 

Then fill record.& write

WRITE(file^num, rec, $len(rec));

 

To Update

READUPDATE

WRITEUPDAE

 

To delete

WRITEUPDATE(filenum, rec, 0); i.e. set recordlength 0

filetype 3

N = (blocksize-30)/ (recordsize+2);

2 bytes are for record control info.

 

ENTRY-SEQUENCED FILES:

Primary key is constant length 4 bytes address. They are not designed for

random access.

logical record size = block size = 24

 

filetype 2

You can read RANDOMLY by alternate key.

N = (blocksize-22)/ (recordsize+2);

 

RELATIVE FILE

Filetype = 1

relative record number.

Once you create file and written record to it, all records preceding records

are also created and actually occupy the space, even though they don't contain

data. This is very SERIOUS LIMIATION of relative file.

 

You can insert record to any available position by giving -2D option.

for EOF use -1D option.

Files are suited for random access with fixed length records and where record

number has some meaningful relationship to particular piece of data.

N = (blocksize-22)/ (recordsize+2);

 

Extent size:

FORMAT1  MAX 65535 pages

FORMAT 2: 536,870,912

 

Buffer is for unstructured file; block size is for structured file.

Maxextent for every file excluding key seq. is 16,

For key-sequence it is more than 16.


NonStop SQL/MP

 

·         Integrity refers to data that is accurate, valid and consistent according to rules established for changing the database.
·         Concurrency refers to the ability of two or more processes to gain access to the same data at the same time. With more concurrency, a greater number of transactions can complete in a given timeframe.
 

Access Options

 

 

 

 

Lock Modes

 

Lock mode controls access to locked data.

 

Views

 

A View is a specification of columns and rows from one or more base tables. View is a virtual table.

 

Comparison of Protection Views and Shorthand Views:

 

Protection View

Shorthand View

Derived from only one table

Derived from any number of tables and other views

Can be secured separately from the table on which it is based.

Protection view provides column-level security by restricting access to individual columns.

Derives it’s security from the tables or views on which it is based.

 

Allow modification of data

Allows reading but not modification of data.

 

Indexes

If you often need to look up table values in a sequence different from the primary-key sequence, you can create an index table. The table on which an index is based is called the base table.  Primary key is called the primary index.

Index definitions are stored separately from base table definitions. Each index has a name and is stored in a key-sequence file of the same as the index. Index files are not tables, and you can not query an index directly. Index provides faster access to tables.

 

Partitions

Partitions can make data more accessible in a large table or a table used at different geographical locations. A partition of a table or index holds all the rows within a range of key values.

 

SQL Catalogs

A NonStop SQL/MP catalog consists of a set of table on a single subvolume. Catalog tables contain specific information about SQL objects and programs, such as keys, comments, columns, partitions, attributes and interdependencies.

 

DEFINE: A DEFINE is a named set of attributes and associated values stored in the process file segment (PFS) of a running process. Using the DEFINEs can simplify the SQL/MP environment. You can establish one to one mapping between logical names and physical names.

 

what are audited and non-audited tables?

Audited table is a table flagged for auditing by the Transaction Management Facility (TMF). The TMF subsystem monitors all transactions against an audited table in preparation for possible transaction back-out, volume recovery, or file recovery.
 
Non-audited tables are not protected by transactions and follow a
different locking and error handling model than audited tables. In
SQL/MX, certain situations such as DML error occurrences or utility
operations with DML operations can lead to inconsistent data within a
non-audited table or between a non-audited table and its indexes.

 

The *only reliable* means of determining whether a file or table is audited is 
to examine the audit attribute in one of the following ways:
1) (TACL) #FILEINFO /AUDITED/
2) (TAL, C, Cobol) CALL FILE_GETINFOLIST[BYNAME]_
3) Look for "A" in column 20 of the output from FUP INFO 
4) Look for "A" in column 19 of the output from TACL FILEINFO

 

Remote Database Facility (RDF)

In the event of an environmental disaster, Tandems Remote Database

Facility (RDF) provides rapid recovery of your database by letting you maintain

a current online copy of all or part of the database at another site.

The presence of the backup is transparent to applications.

If you are running NonStop TM/MP, no application code has to be changed to implement RDF.

In addition, RDF allows users to perform read operations from remote duplicate databases,

improving response times.

 

Safeguard security management facility

To protect your data from unauthorized use, unauthorized modification, or destruction, Tandems Safeguard security management facility enables you to implement a full range of organizational security policies for your NonStop servers and their users.

 

ENFORM:

 

  1. Retrieve data from the database.
  2. Perform calculations such as addition, subtraction, multiplication, and division upon retrieved data.
  3. Sort and group the retrieved data.
  4. Perform cumulative operations (such as counting, totaling, and averaging) upon the retrieved data.
  5. Format and print a report containing the retrieved data.
  6. Create a new physical file containing the retrieved data.

 

The ENFORM language consists of statements, clauses and commands that you use to provide ENFORM with a detailed description (called a query specification) of the data to be retrieved from the data base, the operations to be performed on the data, and the form in which the data is to be returned to you.

 

Establishing and Clearing Relationships:

Statements:

LINK: Create a session-wide link; used to link records descriptions for a query

LINK OPTIONAL

DICTIONARY

DELINK : Clears links from the internal table.      

DELINK OPTIONAL

CLOSE

 

Commands:

?SHOW LINK: Display session-wide links currently in effect

?DICTIONARY

 

Selecting the information:

LIST: Selects information to be printed in the report

FIND: Selects information to be placed in a new physical file called FIND file

 

Clauses:

WHERE,  BY, BY DESC, ASCD, DESC, SUBTOTAL, TOTAL, PCT, CUM

 

AT END, AT START, FOOTING, SUBFOOTING, SUBTITLE, TITLE

 

Compiling and Executing Query:

 

Non-interactive Mode:

:ENFORM/IN test1, OUT $s/

 

Interactive Mode example

:ENFORM

 

 

ENFORM Query and Report example:

 

ENFORM Query:

-- establish Query environment

OPEN parts, fromsup;

DECLARE u-var INTERVAL F3.2;

SET u-var TO 0.10;

 

LIST parts.partnum,        ----------- field name

 

            “ – “,                             ---------- literal

                partname,                      ---------- field name    

                suppnums,                    ----------- field name

 

(IF inventory GT 0 THEN inventory ELSE zero  --------- IF/THEN/ELSE expression

heading “STOCK”,

 

((price+ (price * u-var)) – partcost ---------------arithmetic expression

heading “New Profit”

 

AVG(inventory OVER ALL) ---------------------aggregate

Heading “AVG/Stock”,

 

WHERE parts.partnum EQ fromsup.partnum; ---------------Links parts to fromsup

 


COBOL

 

Program Organization

 

1.       Identification Division: program id, author, date etc.

 

2.       Environment Division

·         Configuration Section:

a.       SOURCE-COMPUTER paragraph

b.       OBJECT-COMPUTER paragraph

c.       SPECIAL-NAMES paragraph: (relate hardware names to user specified names, change currency sign. Change   function of commas and periods)

·         Input-Output Section:

a.       FILE-CONTROL paragraph: file control entries in general, for sequential files, line sequential files, relative files, index files (record key/alternate record key), sort-merge files 

b.       I-O-CONTROL paragraph: Specifies positioning information for a tape file or the sharing of a memory area for more than one file.  

c.       RECEIVE-CONTROL paragraph: To define the two tables used by $RECEIVE this paragraph is used. Two tables are: receive-control (requester table) and reply table.

3.       Data Division

·         FILE Section: external files. Defines the characteristics of the program’s files.

·         WORKING-STORAGE Section: Defines records and misc data items for the process to use. You can set the initial values for the data items here. 01(elementary) level, 77 level, 66(rename items) or 88 (condition-names for values) level

·         EXTENDED-STORAGE Section: similar to working-storage, but this describes data to be stored in the single area of the extended memory (used by extended addressing mode on Tandem) 

·         LINKAGE Section: Describes Data passed by the calling program to the program containing the LINKAGE section.

·         SCREEN Section (Only in SCOBOL): base screen and overlay screen.

·         MESSAGE section (Only in SCOBOL)

 

4.       Procedure Division

5.       End program header

 

Description of records:

 

Levels 01 to 49:

 

Data description entry that starts at level-01 is a record description entry. It defines the chars of records and it follows subordinate data description entries for the items that are part of that record.

 

FILLER Keyword

REDEFINE clause: enables you to describe one computer storage area in more than one way. Data items level-66 and level-88 can not be redefined.

EXTERNAL clause: specifies that record data item is external.

GLOBAL Clause

 

PICTURE Clause:

9: Numeral

            X: Char

            A: Letter/Space

            V: Decimal

            S: Signed

            P: Assumed Decimal

e.g.

PPP999 - .000375

999PP – 37500.

03 NUMBER-ONE PIC S9(3)V99 VALUE –3.25

 

USAGE Clause

SIGN Clause

OCCURS Clause

SYNCHRONIZED Clause

JUSTIFIED Clause

BLANK WHEN ZERO Clause

VALUE Clause

 

Level 66: Rename item: causes new data name to the item, or to two or more contiguous items in a record. This does not causes allocation of storage.

 

Level 77: Noncontiguous elementary items:

In the working storage or extended storage section, you do not need to use the record structure to define elementary items that bear no hierarchical relationship to one another. Instead, you can classify and define them as noncontiguous elementary class with special level no 77.

 

Level 88: Condition names for values

You can assign a name to a specific value, set of values, or range of values that data item can have and use that name as a condition in a conditional statement. Name is calledcondition-name, data item is called conditional variable.

e.g.

05 RETURN-CODE PIC 99.

            88 END-OF-FILE     VALUES 01.

            88 ERROR-ON-READ   VALUE 02.

88 PERMANENT-ERROR VALUE 04.

 

IF END-OF-FILE

            PERFORM END-UP-OPERATION

CLOSE FILE-IN

END-IF

 

Procedure Division

Statement always start with COBOL verb & ends with period. Sentences can be grouped together to form paragraph. Paragraphs are grouped to form section.

 

Imperative (Non Conditional) Verbs:

e.g.: ACCEPT, DISPLAY, ADD, ALTER, CALL, GO TO, INITIALIZE, SET, OPEN,

COMPUTE, MOVE, LOCKFILE

 

Conditional Statement:

e.g.: EVALUATE, IF, RETURN, SEARCH, (READ & AT END or INVALID KEY phrase), (CALL with EXCEPTION phrase)

 

Program Compilation and Execution

COBOL85/IN MYSRC, OUT $SPOOL, PRI 140/MYPROG; ICODE; LMAP *

 

SCOBOLX/IN MYSRC, OUT #LSTFILE/ tcl-prog file

Tcl-prog file: can not be longer than 5 chars (if not specified POBJ is used)

 

The SCOBOL compiler does not produce discrete objects for each source
compiled.  Instead, the object is packed into the POBJCOD object file,
with an entry in the POBJDIR directory file, and any symbols in the

POBJSYM file.

 

Execution with the use of following TACL commands:

RUN, RUND, ASSIGN, PARAM, CLEAR, DEFINE

 

COBOL85 interview questions:
 
1) Explain the $RECEIVE concept.
2) What is a server vs. a requestor?
3) What is "context free" programming?
4) How many bytes of storage does a PIC S9(4) COMP field use?
5) Explain when you would use NATIVE-2, NATIVE-4, or NATIVE-8.
6) Are you familiar with any of the COBOL85 Intrinsic functions?
   6a) If Yes, describe one.
7) List some of the compiler directives you have used and what they
do.
8) What are the basic elements required to write a NonStop program?
9) Can you explain the RECEIVE-CONTROL table and how it is used?
10) What elements are needed to use embedded SQL in a COBOL85 program?
11) How many nested loops are possible in COBOL-85?
12) What is the Array limit?
13) What are the screen section variables?

Pathway

 

Pathway System Components:

 

 

PATHCOM Commands

 

PATHCOM Commands

Valid Objects

ABORT

TERM

ADD

PROGRAM, SERVER, TCP, TERM

ALTER

PROGRAM, SERVER, TCP, TERM

DELETE

PROGRAM, SERVER, TCP, TERM

FREEZE

SERVER (Prohibits communication between a terminal and server class)

INFO

PATHMON, PATHWAY, PROGRAM, SERVER, TCP, TERM

INSPECT

TERM

RESET

PROGRAM, SERVER, TCP, TERM

RESUME

TERM

RUN

PROGRAM

SET

PATHMON, PATHWAY, PROGRAM, SERVER, TCP, TERM

SHUTDOWN

SHUTDOWN2

PATHMON

START

PATHWAY, SERVER, TCP, TERM

STATUS

LINKMON, PATHMON, PATHWAY, SERVER, TCP, TERM

STOP

PATHMON, SERVER, TCP, TERM

THAW

SERVER (Removes the prohibition imposed with the FREEZE command)

 

Configuring the PATHMON Environment

 

Pathway Object

Few Configuration Attributes

PATHMON

MAXASSIGNS, MAXPARAMS, MAXSERVERCLASSES, MAXSERVERPROCESSES, MAXSTARTUPS, MAXTCPS, MAXTERMS,

PATHWAY

MAXLINKMONS, MAXPATHCOMS, MAXPROGRAMS, OWNER, SECURITY, all above

TCP

CPUS, HIGHPIN, MAXTERMS, TCLPROG, MAXSERVERCLASSES, MAXSERVERPROCESSES, MAXTERMS, INSPECT, PROCESS, PROGRAM

TERM

FILE, TCP, AUTORESTART, INSPECT, TMF

PROGRAM

OWNER, SECURITY, TCP, TMF, TYPE

SERVER

PROCESSTYPE(Guardian/OSS), AUTORESTART, CPUS, DELETEDELAY, CREATEDELAY, DEFINE, MAXSERVERS, MAXLINKS, NUMSTATICS,

 

TACL

 

Tandem Advanced Command Language (TACL) is the standard command interface to the Tandem NonStop kernel. In addition to providing full command interpreter facilities, TACL is a high-level programming language.

 

TACL Variables

 

 

e.g. variable “s” for the STATUS command:

[#DEF  s  ALIAS  |BODY|  STATUS]

 

e.g. ?SECTION fn MACRO

        FILENAMES %1%

             

e.g. Filename: HEYMAC contains:

?TACL MACRO

#FRAME

#PUSH file^name

#SET file^name %1%

#OUTPUT File Name is [file^name]

UNFRAME

 

To run this macro:

>HEYMAC thisfile

File Name is thisfile

>

 

Argument handling: #ARGUMNT, #MORE, REST

Routines own expansions: #RESULT

Multiple exit points: #RETURN

Handle exceptions: #EXCEPTION, #FILTER, #RAISE, #ERRORTEXT

 

e.g. Filename ROOTN contains:

?TACL ROUTINE

#FRAME

#PUSH file^name

SINK [#ARGUMENT /VALUE file^name/ FILENAME]

#OUTPUT File Name is [file^name]

#UNFRAME

 

To run this routine

>ROOTN thatfile

File Name is \NODE.$VOL.SUBVOL.THATFILE

>

    

 

Few Functions and Commands:

 

Allocate and define variables: #PUSH, #DEF, #SET, #SETV, #SETMANY

Delete variables: #POP, #KEEP, #UNFRAME, #RESET FRAMES

Accessing variable contents: #OUTPUT [var1]

Using variable as an argument: #OUTPUTC var1

 

Enabling TACL Debugger:

From within the macro or routine, type

#SET #TRACE –1

TACL waits for an instruction before it performs it’s first expansion. At this point you can set breakpoints and either resume execution or step through the code.

 

?SECTION Directive

Use this directive to signal the beginning of a variable definition in a file. This directive allows you to create a library that contains definitions for many variables.

?SECTION var-name var-type

 

To cause TACL to interpret or execute the contents of the file. use the LOAD command or #LOAD built-in function to load the contents into memory.

e.g. LOAD /KEEP 1/mymacs

To invoke a variable after it is loaded, type the variable name.

 

OSS (Open System Services)

An open system environment is available for interactive or programmatic use with the Tandem NonStop Kernel. Processes that run in the OSS environment use the OSS Application Program Interface (API).

Interactive uses of the OSS environment use the OSS shell for their command interpreter. The OSS API and shell are similar to those provided by the UNIX operating system.

OSS provides portable applications which can move between Tandem system and another platform with ease. To achieve the portability, applications are written with standardized API, a set of functions common to multiple platforms.

 

Guardian files on the local node appear as OSS file in the / G directory of the OSS file system. The node is the local node, because you can not remotely access a file in / G.

Pahnames in the / G directory with more than 3 components after the / G/ cannot be accessed as Guardian files.  /G/volume1/subvol1/myfile

 

gtacl Utility    

gtacl runs a process in the Guardian environment from the OSS environment and lets you use Guardian tools from the OSS shell. You can use gtacl to start an interactive TACL process.

e.g. $ gtacl –c ‘status *,user’

 

File type conversion tools:

TEDIT Creates 101 files. Files in / G directory created with an OSS editor such as vi have a type of 180.

Convert type 180 file to type 101 file on TACL prompt:

>CTOEDIT ossfile, editfile

Convert type 101 file to type 180 file on TACL prompt:

>EDITTOC editfile, ossfile

 

Compilation Tools

The c89 utility controls the C compilation system in the OSS environment.

e.g.

c89 test1.c      -> Output file is: a.out

c89 –o testout test1.c  -> output file is testout, Compiles, links, produces executable program file.

 

Starting the inspect:

Guardian: ?RUN INSPECT or >INSPECT

OSS: $ gtacl –p inspect

Staring the Inspect and Program at same time:

Guardian:  >RUND gprog

OSS: $ run –debug –inspect=on ossprog


Summary of VI commands

 

Cutting and Pasting/Deleting text

 

"

Specify a buffer to be used any of the commands using buffers. Follow the " with a letter or a number, which corresponds to a buffer.

D

Delete to the end of the line from the current cursor position.

P

Paste the specified buffer before the current cursor position or line. If no buffer is specified (with the " command.) then 'P' uses the general buffer.

X

Delete the character before the cursor.

Y

Yank the current line into the specified buffer. If no buffer is specified, then the general buffer is used.

d

Delete until where. "dd" deletes the current line. A count deletes that many lines. Whatever is deleted is placed into the buffer specified with the " command. If no buffer is specified, then the general buffer is used.

p

Paste the specified buffer after the current cursor position or line. If no buffer is specified (with the " command.) then 'p' uses the general buffer.

x

Delete character under the cursor. A count tells how many characters to delete. The characters will be deleted after the cursor.

y

Yank until , putting the result into a buffer. "yy" yanks the current line. a count yanks that many lines. The buffer can be specified with the " command. If no buffer is specified, then the general buffer is used.

 

Inserting New Text

 

A

Append at the end of the current line.

I

Insert from the beginning of a line.

O

(letter oh) Enter insert mode in a new line above the current cursor position.

a

Enter insert mode, the characters typed in will be inserted after the current cursor position. A count inserts all the text that had been inserted that many times.

i

Enter insert mode, the characters typed in will be inserted before the current cursor position. A count inserts all the text that had been inserted that many times.

o

Enter insert mode in a new line below the current cursor position.

 

Moving the Cursor Within the File

 

^B

Scroll backwards one page. A count scrolls that many pages.

^D

Scroll forwards half a window. A count scrolls that many lines.

^F

Scroll forwards one page. A count scrolls that many pages.

^H

Move the cursor one space to the left. A count moves that many spaces.

^J

Move the cursor down one line in the same column. A count moves that many lines down.

^M

Move to the first character on the next line.

^N

Move the cursor down one line in the same column. A count moves that many lines down.

^P

Move the cursor up one line in the same column. A count moves that many lines up.

^U

Scroll backwards half a window. A count scrolls that many lines.

$

Move the cursor to the end of the current line. A count moves to the end of the following lines.

%

Move the cursor to the matching parenthesis or brace.

^

Move the cursor to the first non-whitespace character.

(

Move the cursor to the beginning of a sentence.

)

Move the cursor to the beginning of the next sentence.

{

Move the cursor to the preceding paragraph.

}

Move the cursor to the next paragraph.

|

Move the cursor to the column specified by the count.

+

Move the cursor to the first non-whitespace character in the next line.

-

Move the cursor to the first non-whitespace character in the previous line.

_

Move the cursor to the first non-whitespace character in the current line.

0

(Zero) Move the cursor to the first column of the current line.

B

Move the cursor back one word, skipping over punctuation.

E

Move forward to the end of a word, skipping over punctuation.

G

Go to the line number specified as the count. If no count is given, then go to the end of the file.

H

Move the cursor to the first non-whitespace character on the top of the screen.

L

Move the cursor to the first non-whitespace character on the bottom of the screen.

M

Move the cursor to the first non-whitespace character on the middle of the screen.

W

Move forward to the beginning of a word, skipping over punctuation.

b

Move the cursor back one word. If the cursor is in the middle of a word, move the cursor to the first character of that word.

e

Move the cursor forward one word. If the cursor is in the middle of a word, move the cursor to the last character of that word.

h

Move the cursor to the left one character position.

j

Move the cursor down one line.

k

Move the cursor up one line.

l

Move the cursor to the right one character position.

w

Move the cursor forward one word. If the cursor is in the middle of a word, move the cursor to the first character of the next word.

 

Moving the Cursor Around the Screen

 

^E

Scroll forwards one line. A count scrolls that many lines.

^Y

Scroll backwards one line. A count scrolls that many lines.

z

Redraw the screen with the following options. "z<return>" puts the current line on the top of the screen; "z." puts the current line on the center of the screen; and "z-" puts the current line on the bottom of the screen. If you specify a count before the 'z' command, it changes the current line to the line specified. For example, "16z." puts line 16 on the center of the screen.

 

Replacing Text

 

C

Change to the end of the line from the current cursor position.

R

Replace characters on the screen with a set of characters entered, ending with the Escape key.

S

Change an entire line.

c

Change until . "cc" changes the current line. A count changes that many lines.

r

Replace one character under the cursor. Specify a count to replace a number of characters.

s

Substitute one character under the cursor, and go into insert mode. Specify a count to substitute a number of characters. A dollar sign ($) will be put at the last character to be substituted.

 

Searching for Text or Characters

 

,

Repeat the last f, F, t or T command in the reverse direction.

/

Search the file downwards for the string specified after the /.

;

Repeat the last f, F, t or T command.

?

Search the file upwards for the string specified after the ?.

F

Search the current line backwards for the character specified after the 'F' command. If found, move the cursor to the position.

N

Repeat the last search given by '/' or '?', except in the reverse direction.

T

Search the current line backwards for the character specified after the 'T' command, and move to the column after the if it's found.

f

Search the current line for the character specified after the 'f' command. If found, move the cursor to the position.

n

Repeat last search given by '/' or '?'.

t

Search the current line for the character specified after the 't' command, and move to the column before the character if it's found.

 

Manipulating Character/Line Formatting

 

~

Switch the case of the character under the cursor.

<

Shift the lines up to where to the left by one shiftwidth. "<<" shifts the current line to the left, and can be specified with a count.

>

Shift the lines up to where to the right by one shiftwidth. ">>" shifts the current line to the right, and can be specified with a count.

J

Join the current line with the next one. A count joins that many lines.

 

Saving and Quitting

 

^\

Quit out of "VI" mode and go into "EX" mode. The EX editor is the line editor VI is build upon. The EX command to get back into VI is ":vi".

Q

Quit out of "VI" mode and go into "EX" mode. The ex editor is a line-by-line editor. The EX command to get back into VI is ":vi".

ZZ

Exit the editor, saving if any changes were made.

 

Miscellany

 

^G

Show the current filename and the status.

^L

Clear and redraw the screen.

^R

Redraw the screen removing false lines.

^[

Escape key. Cancels partially formed command.

^^

Go back to the last file edited.

!

Execute a shell. If a is specified, the program which is executed using ! uses the specified line(s) as standard input, and will replace those lines with the standard output of the program executed. "!!" executes a program using the current line as input. For example, "!4jsort" will take five lines from the current cursor position and execute sort. After typing the command, there will be a single exclamation point where you can type the command in.

&

Repeat the previous ":s" command.

.

Repeat the last command that modified the file.

:

Begin typing an EX editor command. The command is executed once the user types return. (See section below.)

@

Type the command stored in the specified buffer.

U

Restore the current line to the state it was in before the cursor entered the line.

m

Mark the current position with the character specified after the 'm' command.

u

Undo the last change to the file. Typing 'u' again will re-do the change.

 

My additions:

 

>>Vi –R <file-name>     open in Read Only mode

hijk  for arrows

 

To search and replace word

Shift :

S/<word1>/<word2>/g    -----in one line

%S/<word1>/<word2>/g ----in full file

 

Yanking:

Y – copy line to buffer

P – paste

U – undo

5Y – copy 5 lines to the buffer

r – replace one char

R – overwrite

cw – change word

dw – delete word

 

:set all

:set noshowmode

$ /set filec

vi la….. ---------expands

cntr-b – back pg(full), cntr-u – back pg(half)

cntr-f – next pg(full), cntr-d – next pg(half)

shift G – file end, :1 – file start

shift 4 – go to EOL

shift 6 – start of line

w – word by word forward, b – backword, e-end of word

J – join lines(align para)

i <enter> - break

:wq – save and quit, q – quit, q! –force quit, w! – test.sql(save as)

 

EX Commands

The VI editor is built upon another editor, called EX. The EX editor only edits by line. From the VI editor you use the : command to start entering an EX command. This list given here is not complete, but the commands given are the more commonly used. If more than one line is to be modified by certain commands (such as ":s" and ":w" ) the range must be specified before the command. For example, to substitute lines 3 through 15, the command is ":3,15s/from/this/g".

:ab string strings

Abbreviation. If a word is typed in VI corresponding to string1, the editor automatically inserts the corresponding words. For example, the abbreviation ":ab usa United States of America" would insert the words, "United States of America" whenever the word "usa" is typed in.

:map keys new_seq

Mapping. This lets you map a key or a sequence of keys to another key or a sequence of keys.

:q

Quit VI. If there have been changes made, the editor will issue a warning message.

:q!

Quit VI without saving changes.

:s/pattern/to_pattern/options

Substitute. This substitutes the specified pattern with the string in the to_pattern. Without options, it only substitutes the first occurence of the pattern. If a 'g' is specified, then all occurences are substituted. For example, the command ":1,$s/Dwayne/Dwight/g" substitutes all occurences of "Dwayne" to "Dwight".

:set [all]

Sets some customizing options to VI and EX. The ":set all" command gives all the possible options. (See the section on customizing VI for some options.)

:una string

Removes the abbreviation previously defined by ":ab".

:unm keys

Removes the remove mapping defined by ":map".

:vi filename

Starts editing a new file. If changes have not been saved, the editor will give you a warning.

:w

Write out the current file.

:w filename

Write the buffer to the filename specified.

:w >> filename

Append the contents of the buffer to the filename.

:wq

Write the buffer and quit


FAQ:

1) How do you MOVE files from one subvolume to another on a Tandem system? Is there a FUP MOVE command? How do you rename a subvolume on a Tandem system?
(A) Suppose you want to MOVE "all" files from a subvolume $DATA00.FIRST to the subvolume
$DATA00.SECOND
FUP RENAME $DATA00.FIRST.* , $DATA00.SECOND.*
You may replace the wild-card * with any file-name template. This command is as good as renaming the subvolume FIRST to SECOND.

(2) How do you extract preliminary information from a SAVEABEND file?
(A) On Inspect prompt issue the command
--INFO SAVEFILE FILE ZZSA3126

(3) What is Garth?
(A) Garth is a symbolic, high-level tool that does low-level debugging, working on both live system (via TCP-IP) as well as processor images (dumps). It includes features of gdb, Crunch, as well as powerful, new utilities. Garth was originally the brainchild of Hieu Tran when he was working on Native Mode 1. Based upon the GNU Debugger (GDB) as well as the Tcl/Tk scripting language, it is easily flexible and extensible, as users can write their own scripts and invoke them when desired. Garth is available for various UNIX platforms including Sun-OS, Solaris, as well as for Tandem NSK. Details available on Garth home-page at http://nskernel.web.tandem.com/garth/

(4) What is HIGHPIN?
(A) Each process that runs in a CPU has a Process Indentification Number (PIN) that uniquely identifies it. Before the Dxx release, there was a limit of 256 processes that could run at the same time in a CPU. A PIN could take a value between 0 and 255. The Dxx release increased the limit on the number of processes that can run in a CPU. (It also increased many other limits). Processes that run in PINs greater than 255 are called HIGHPIN processes, the others are called LOWPIN processes - what else :-) This is all fine and dandy, except that programs may require changes in order to run in a high pin. This is because HIGHPINs are stored as 16 bit integers, and LOWPINS are stored as 8 bit integers. The Guardian procedure calls that are used for process management were revamped. The old calls are still there, but for the most part they can only be used on LOWPIN processes. If a program wants to run in a HIGHPIN, or wants to communicate with another process that runs in a HIGHPIN, it will need to be changed to use the new procedure calls. Also, there are a new set of system messages (that are read from $RECEIVE) that relate to HIGHPIN processes. Again, the old messages are still there, but are only useful for LOWPIN processes.

(5) What are the differences in the pointers in Tandem C and TAL?
(A) Differences between TAL and C pointers include the following:
·TAL structure pointers can point to a byte or word address.
· C structure pointers always point to a word address. To pass a C structure pointer to a TAL routine that expects a byte structure pointer, you must explicitly
cast the C pointer to type char.
· TAL pointers are dereferenced implicitly.
· C pointers are usually dereferenced explicitly.
· Small-memory-model C routines use 16-bit pointers only.
· Large-memory-model C routines use 32-bit pointers only, even if the pointers refer to the user data segment. In global structure declarations, you must specify _lowmem in the storage class of the declaration.
· If a TAL routine expects a 16-bit pointer, the C pointer you pass must refer to an object in user data space.

(6)What is BASE24?

Many customers around the world use BASE24 to manage devices, route and switch transactions, and provide authorization support for high-volume payments processing. The software operates on Compaq NonStop Himalaya systems to provide 24/7 support for ATM and POS networks, manned teller systems, telephone banking, mobile commerce, and Internet banking and commerce. ACI (www.aciworldwide.com) develops and markets many BASE24 based applications like BASE24-ATM, BASE24-CARD, BASE24-BILLPAY, BASE24-TELLER, etc.

(7) How do you determine the RAM on a Tandem machine?
Type the following at the tacl prompt :
> peek /cpu 0/ paging
Here's a sample output :
PEEK - T9050G09 - (04APR01) SYSTEM \WHIT10
COPYRIGHT TANDEM COMPUTERS INCORPORATED 1981, 1985, 1988, 1990

SYSTEM \WHIT10
22 SEP 2001, 18:20___ELAPSD 32:11:07___CPU 0(NSR-W)

PAGES: PHYSCL SWAPBL FREE FREEMIN FREEQUOTA FREERED LOCKED LOCKED(KSEG0)
(16Kb) 16384 16164 867 10 10 5 7372/14144 7372/28480

FAULTS ALLOCS DISKREADS DISKWRITES MUTEXCRAX NONMUTEXCRAX
TOTAL 90718 101394 46526 1810 21017 649046
(per sec) 0.78 0.87 0.40 0.01 0.18 5.60

REDHIT REDBUSY REDTASK
TOTAL 0 0 0
(per sec) 0.00 0.00 0.00

CLEANQ: FULLS FRLST:HITS CLOCK:CALLS FAILS CYCLES ALIASES: FAILS
0 0 100202 2745 0 3.58 0 0

This will give you the amount of RAM for CPU 0 :
PAGES * PHYSCL = (16kb) * 16384= 256 MB (rounded)

(8) How do I know the full Guardian filename of a file under OSS?
Use "GNAME <filename>" on the OSS prompt.

(9) How do you run TACL commands from OSS and vice-versa?
As the kernel is same for both OSS and Guardian, there is an option of executing TACL commands on the OSS prompt and the other way round.
This is the syntax of running TACL commands on OSS :
gtacl -c " < tacl cmd > "
E.g. gtacl -c "fup copy taclcstm"

Here's the way of running OSS commands on TACL prompt :
OSH -c " < OSS CMD > "

E.g. If you want to see the contents of a file, you can try this :
osh -c "more taclcstm"

(10) What is RISC and CISC?

 

RISC: Reduced Instruction Set Computing.

CISC: Complex Instruction Set Computing.

 

 

TNS C Languages system made up cprep, C compiler, C runtime library, Binder

C Prep is embedded in C compiler running in Guardian environment, but in OSS environment

You must run it separately using c89 utility.

 

TNS/R Native mode: The operational environment in which native-compiled

RISC code executes.

 

NMC: You have to use -L to search library instead of SEARCH pragma, use -I instead of SSV. NMC produces non-executable object. Combine several modules by nld to get the executable object. You can combine several files in one file and then use LINKFILE to link them.

e.g.

NMC/ in mod1c/ fileo; RUNNABLE, LINKFILE "myfile" 

Here myfile contains the names of object files like file1, file2, file3 etc.

 

CRTLMAIN: contains initialize code for c, c++ libraries.

SRL: shared runtime libraries. (Code in virtual memory).

-OBEY $SYSTEM.SYSTEM.LIBCOBEY is sufficient to link the SRLs used by c program.

 

nld: NATIVE LINK EDITOR:

nld is same as binder in TNS mode. nld is used in NATIVE mode. Unlike binder

nld cannot replace individual procedures and data blocks in an object file

or build object file from individual procedures and data blocks. nld

operates on procedures and data blocks but in terms of an entire object file.

 

noft: NATIVE OBJECT FILE UTILITY:

It is used to,

Determine the optimization level of procs

Display object code with source code

List object file attributes

List unresolved references

 

Converting C-series C programs to D-series:

 

1.       Replace LARGEC, SMALLC, WIDEC with CLARGE, CSMALL, CWIDE.

2.       Replace min & max macro with _min & _max macros.

3.       Replace cc_status with _cc_status. lowmem with _lowmem., tal with _tal.

 

Before D-Series, you had to bind the memory-model independent C runtime library

(CLIB) into your application. In D series CLIB and CRELIB are part of system library.

GUARDIAN Help:

 

AWAITO[X]:

This call is used to complete previously initiated i/o.

you can use AWAITOX instead of AWAITO , segement id is -1 here.

buffer-address contains extended address. But if user use accidentally

AWAITO instead of X then error 2 is returned. If the address is in selectable

segment that segment must be in use.

Attempting open disk file with nowait_depth more than 1 causes error 28.

 

AWAITOX(filenum ! i,o

        ,buffer-addr !o

        ,count-transferred !o

        ,tag               !o

        ,timelimit         !o

        ,segmentid         !o

 

 

 

FILE_CREATE & FILE_CREATELIST:

Some file chars like alternate key, format type, partition info cannot be

specified in 1st call that’s why use FILE_CREATELIST .

 

FILE_OPEN:

Input to this is file name and output is filenumber.

Filenumber is 0 is reserved for $RECEIVE.

Direct i/o: file opened by file_open uses direct i/o transfer by default.

To use intermediate buffer in PFS use SETMODE 72. OPEN call by default uses PFS.

 

HEADROOM_ENSURE:

Allows u to check that current main stack or privileged stack has enough space

 

ret-val := HEADROOM_ENSURE(room);

 

ret-val INT(32) returns Number of bytes between current stack pointer  & stack limit if room <= 0D. It returns outcome of operation if room > 0D

 

KEYPOSITION[X]:

To position file by primary or alternate key in structed file.

Generally POSITION call is used in case of realtive and entry-sequenced file

while KEYPOSITION is used in case of key-sequenced file.

0: approximate, 1: generic, 2:exact

Error 22 :

0022 The application parameter or buffer address is out of bounds.

is returned if KEPOSITIONX

 address is extended, and segement is not in use.

 address is not absoulte and user is not privileged.

 

MOVEX:

Used to move data between extended segments.

Error 24: segement is privileged, but user not.

 

NUMIN: Converts ASCII value into signed NUMBER

NUMOUT: Converts unsigned NUMBER into ASCII value.

 

READ:

return data from open file to application buffer.

SEGEMENT_ALLOCATE:

allocates extended segment for use by application process.

Extensible segment is one for which swap file disk space is not allocated

until it is needed.

 

READUPDATE[X]

if KEPOSITION call is there before READUPDATEX then it must be exact otherwise

READUPDATEX fails.gives error 46 invalid key. To avoid this make intermediate call to READ.

If $RECEIVE is opened with receive-depth 0 only READX is allowed.

READUPDATEX gives error 2, invalid operation. receivedepth is maximum number

of messages that the application process expects to read before corresponding

reply is made.

 

GUARDIAN PROGRMMING MANUAL:

Fault-Tolerance:

-TMF

-Process pairs

-Persistent process: process that supplies services to other processes but

 otherwise maintain no data of their own.

 

Security:

O : owner on local node

U : owner on local & remote node

G : group user on local node

C : group user on local & remote node

- : super id on local

A : all on local node

N : all on local & remote node(n/w).

G-Series Highlights and Migration Planning Guide

426088-0011-3

 

The Advantages of Migrating to a G-Series Release

 

The following is a brief summary of some of the features and capabilities you gain by migrating from a D-series release to a G-series release:

 

1.       Scheduled down time decreases; almost all system configuration can be performed online.

2.       A new SYSnn subvolume is created only when you install a new software release. Therefore, less disk space is required on $SYSTEM for system configuration information.

3.       More memory per processor is available for NonStop™ Himalaya S-series servers. On NonStop™ Himalaya K-series servers, 256 megabytes per processor is the maximum.

4.       Graphical user interfaces (GUIs) are available.

5.       The Compaq Tandem Service Management (TSM) package provides logical views and physical views of a system’s configuration through a GUI.

6.       Each system console can manage up to ten servers. Only one server can be managed by each system console on NonStop™ Himalaya K-series systems.

7.       You must migrate to a G-series release to take advantage of the ServerNet architecture on the NonStop™ Himalaya S-series server.

 

The ServerNet architecture offers the following features:

 

1.       Faster disk access. NonStop™ Himalaya S-series systems need less disk capacity to achieve the same performance as NonStop™ Himalaya K-series systems.

2.       Better data transfer performance. A ServerNet SAN allows simultaneous bi-directional data transfer, whereas inter-processor bus communications do not.

3.       On an inter-processor bus, the destination address is sent and then the data is sent after the proper response is received. A ServerNet SAN is optimized for data transfer and handshaking, because it sends the data and the destination address at the same time.

4.       More reliable data transfer. On an interprocessor bus, the data is not checked until it is received. On a ServerNet system area network (SAN), a packet of information is checked at various points on the network as it is being transmitted; thus, errors are easily detected and corrected.

5.       Faster data transfer. The ServerNet architecture uses adapters with ServerNet addressable controllers (SACs) instead of separate I/O controllers. ServerNet adapters and SACs require less processing than I/O controllers, which makes data transfer faster.


 

Tandem NonStop TCP/IP

Transmission Control Protocol/Internet Protocol (TCP/IP)

 

Tandem TCP/IP subsystem allows communications to take place between heterogeneous systems in multi-network environment (Internet), and provides for the integration of UNIX systems with Tandem systems.

TCP/IP subsystem also includes an X.25 interface and Logical Link Control (LLC) interface.

 

Type of Service:

 

Depending on the type of communications service required, your application uses one or more of the following protocols:

 

 

 

 

Layering

 

Networking protocols are normally developed in layers, with each layer responsible for a different facet of the communications. TCP/IP is a combination of different protocols at various layers.

 

OSI Service Layers/ 7-Layer Model

Application, Presentation, Session, Transport, Network, Link, Physical

 

TCP/IP is normally considered to be a 4-layer system.

 

Application (Telnet, FTP, SMTP, e-mail, etc)

Transport (TCP, UDP)

Network (IP, ICMP, IGMP)

Link (device driver and interface card)

 

  1. Link layer, sometimes called the data-link or network interface layer, normally includes the device drivers in the operating system and the corresponding n/w interface card in the computer.

2.       Network Layer, sometimes called internet layer handles the movements of packets around the network.

  1. Transport layer provides the flow of data between two hosts, for the application layer above.
  2. Application layer handles the details of the particular application.

 

Socket Library Routines

 

A socket is an end point for communication. An application process calls a socket routine to request that the Tandem TCP/IP software create a socket when needed and specify the type of service desired. Applications can request TCP and UDP sockets as well as raw sockets for direct access to IP.

After creating a socket, the application optionally binds the socket to a specific local address and port, and sends or receives data on the socket. When the transfer is complete, application can shut down the socket and close it.

 

Internet Addresses

 

The combination of Internet Protocol (IP) address and a port number uniquely identifies a socket.

Because a host can be connected to more than one network, each host can have more than one IP address. Each physical device, or interface, that adds the host to a new, logical network has its own IP address.

 

An IP address is a 4-octal (32-bit) numeric value identifying a particular network and a local host on that network. (e.g. 133.50.85.43). Each octet value is a number in 0-255

 

An IP address is sometimes represented externally as two numbers separated by a period. In this case the first number is the network address and the second is the local address. The interpretation of such addresses in octets depends on the class of the IP address- Class A,B,C. Class of the IP address determines how the 32 bits are divided between the network address and the local address.

0-31 bits, bit 0 and 1 used to specify Class.

 

xx

Octet-1(bits 2-7)

Octet-2

Octet-3

Octet-4

 

xx= 00: Class A – 1-octet n/w and 3-octet local address.

xx= 10: Class B – 2-octet n/w and 2-octet local address.

xx= 11: Class C – 3-octet n/w and 1-octet local address.

 

The host address can be split into subnets. To address subnets within a local area network, your LAN administrator can further divide the local address part of your IP addresses into a subnet number (identifying the particular subnet) and a host number (identifying the host system within the subnet.

The subnet number is always in the most significant n bits of the local address, the LAN administrator will decide the value of n based on the number of subnets needed and the number of hosts per subnet.

 

To identify the part of the IP address that represents the subnet number, a subnet mask is used. This is 32-bit mask with all bits corresponding to the network address and subnet address is set to 1, and with all bits corresponding to remainder of the local address set to 0. e.g. Class B address shown below:

 

Network address (bit 0-15)

Subnet

Number (16-20)

Host number (21 to 31)

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1                                             1 1 1 1 1               0 0 0 0  0 0 0 0 0 0 0

 

Port Numbers

 

Both TCP and UDP use a 16-bit port number to select a socket on the host.

Client programs normally use more or less random port numbers; however, specific port numbers called well-known ports are assigned for use by server programs. (e.g. FTP- ports 20/21, Telnet – port 23, HTTP – Port 80)

 

0-512: Well known ports

512-1024:

>1024: Ephemered (Short Lived)

 


TCP/IP Basic Steps

 

 

Client program [Function call]

Server program [Function call]

1

Designate the TCP/IP process name (optional)[call function: socket_set_inet_name]

Designate the TCP/IP process name (optional)

2

Create a socket [call function: socket]

Create a socket

3

Bind the socket to any port (optional; not done in IP)

[function: bind]

Bind the socket to a well-known port (required for most servers; does not apply to IP; optional for servers started by the LISTNER process)

4

Connect the socket (required for TCP; optional for UDP or IP) [connect]

Listen for connections (required for TCP; not done for UDP or IP)

[listen]

5

 

Accept incoming connections. When connection is received, create a new socket and accept the connection on the new socket (required for TCP; optional for UDP; not done for IP)

[accept]

6

Start data transfer

[send and recv],

[sendto and recvfrom – uses the remote address and port number passed as argument, used with connectionless protocols (UDP and IP)

Start data transfer (use the new socket created in the last step)

7

Shut down the socket (optional for TCP; not done for UDP or IP)

[shutdown]

Shut down the socket (optional for TCP; not done for UDP or IP

8

Close the socket [CLOSE]

Close the socket