background image

Listing a File

Accessing Files

4–16

107365 Tandem Computers Incorporated

Listing a File

Use the macro in Figure 4-7, 

tacllist

, to format, paginate, and print TACL program

files.  This macro calls #REQUESTER to read the TACL file, copies the TACL file to a
disk file designated as the OUT file in TFORM format, and then calls TFORM to
format and print the file.  

Tacllist 

displays the following:

A listing banner with the TACL file date and the current date.

The contents of the file, including line numbers and page numbers.

Note

Figure 4-7 shows the use of a macro for a more complex set of operations.  Because a macro cannot use
the #ARGUMENT built-in function, the macro must provide more argument checking capabilities.  In
addition, the macro cannot use the #RETURN built-in function, so it uses a series of #IF calls.  The bulk of
the code resides in the innermost #IF statement, making the program more difficult to read.

You can use the TFORM \NEW command within the TACL file to cause TFORM to
advance to the top of a new page.  When you insert a directive of the form ==\NEW in
the file to be printed, 

tacllist

 replaces it with \NEW.  The macro sets the page

width to 132 characters.

To preview your output before printing, specify your terminal name as the output file.
Following a preview, reinvoke 

tacllist 

to get a printed listing.   To run this macro,

load the file and enter:

tacllist 

infilename [outfilename]

If 

outfilename

 already exists, TACL purges the file.  If you do not specify a result

file, 

tacllist

 writes to a file called TACLTFRM.

Figure 4-7.  Listing a File (Page 1 of 5)

?SECTION tacllist MACRO

#FRAME

#PUSH err_inp rec_inp prompt default_outfile

#PUSH line_num line page_num page_out bin_date file_date

#PUSH list_date year month day file_hour file_min

#PUSH list_hour list_min short_stars long_stars

#PUSH lines_out max_lines match_string printer

#PUSH #OUTFORMAT #WIDTH

#SET printer $S.#LP5           == Put local printer name here

#SET max_lines  55             == Set to maximum lines/page

#SET default_outfile TACLTFRM  == Default output file name

#SET #WIDTH 132                == Listing wrap column

#SET #OUTFORMAT PLAIN

Summary of Contents for TACL

Page 1: ...em Advanced Command Language TACL and provides information and examples for creating TACL programs Part Number 107365 Edition Second Published December 1994 Product Version TACL D30 Release ID D30 00 Supported Releases This manual supports D30 00 and all subsequent releases until otherwise indicated in a new edition ...

Page 2: ...of the FARS Computer Software Restricted Rights clause RESTRICTED RIGHTS NOTICE Use duplication or disclosure by the Government is subject to the restrictions as set forth in subparagraph c 1 ii of the Rights in Technical Data and Computer Software clause at DFARS 52 227 7013 RESTRICTED RIGHTS LEGEND Use duplication or disclosure by the Government is subject to restrictions as set forth in paragra...

Page 3: ...nge the behavior of TACL for a specified TACL image or configure the currently running TACL process A new built in function XLOGON implements the LOGON command The LOGON command CHANGEUSER built in function and XLOGON built in function support the Safeguard authentication dialog The STATUS command and XSTATUS built in function display new process type information CLASS DEFAULT DEFINEs have eight n...

Page 4: ...New and Changed Information iv 105919 Tandem Computers Incorporated This page left intentionally blank ...

Page 5: ... Nesting TACL Code 2 7 Saving Levels of Variables 2 8 Exiting From Programs 2 9 Processing Character Data 2 9 Line and Character 2 10 Global Editing Commands 2 13 Additional Data Manipulation Capabilities 2 16 Data Types 2 17 Accessing Time Data 2 17 Timestamp Formats 2 17 Retrieving a Timestamp 2 18 Converting a Timestamp 2 19 Accessing Terminals 2 24 Defining Function Keys 2 24 Sending Escape Se...

Page 6: ...n Handler 3 20 Creating a Keep Exception Handler 3 24 Combining Keep and Release Handlers 3 30 Section 4 Accessing Files REQUESTER Operation 4 1 Requesting Waited Reads 4 2 Requesting Nowaited Reads 4 4 Requesting Waited Writes 4 6 Requesting Nowaited Writes 4 8 Copying Records Between Files 4 10 Comparing Files 4 12 Listing a File 4 16 Section 5 Initiating and Communicating With Processes Initiat...

Page 7: ...Constructing a TACL Server 6 5 Using TACL as a Pathway Server 6 6 Section 7 Using Programmatic Interfaces Overview of SPI and EMS 7 1 Using SPI 7 4 Defining an SPI Buffer 7 5 Using SPI Functions 7 9 Using EMS 7 12 Communicating With EMS 7 12 Generating an EMS Event 7 13 Section 8 Example of a System Management Program Monitoring System Operation 8 1 Section 9 Syntax Summary TACL Commands and Funct...

Page 8: ...2 25 Figure 2 12 Displaying a Screen of Text 2 27 Figure 2 13 Locking a Terminal 2 28 Figure 2 14 Displaying a Menu 2 30 Figure 2 15 Starting TEDIT From TACL 2 34 Figure 3 1 Processing Arguments 3 5 Figure 3 2 Returning Characters From a Routine 3 9 Figure 3 3 Returning a Set of Characters From a Variable 3 10 Figure 3 4 Searching for Text 3 10 Figure 3 5 Counting Characters in a Variable 3 11 Fig...

Page 9: ...ing Terminal Output 5 11 Figure 5 5 Deleting PERUSE Jobs 5 12 Figure 5 6 Retrieving the TACL IN File Name 5 15 Figure 5 7 Communicating With FUP Using INV and OUTV 5 17 Figure 5 8 Directing FUP Output to a Log File 5 18 Figure 5 9 Displaying PERUSE Jobs 5 19 Figure 5 10 Sending Messages to a Terminal 5 22 Figure 5 11 Creating CMON Messages 5 25 Figure 5 12 Communicating With FUP Using SERVER 5 30 ...

Page 10: ... Handlers 3 19 Table 3 3 Differences Between Keep and Release Exception Handlers 3 20 Table 4 1 Functions Used With REQUESTER 4 2 Table 5 1 RUN and NEWPROCESS Communication Options 5 2 Table 5 2 INLINE Commands and Variables 5 6 Table 5 3 Variables and Commands for INLINE Display 5 9 Table 5 4 Functions and Options Used With INV and OUTV 5 15 Table 5 5 Functions to Use With RECEIVE 5 21 Table 6 1 ...

Page 11: ...that show how to access files from TACL programs Section 5 Initiating and Communicating With Processes provides information and examples that show how to start and communicate with processes from TACL programs Section 6 Running TACL as a Server describes how to create a TACL program that acts as a server to other processes Section 7 Using Programmatic Interfaces provides information and examples f...

Page 12: ...onal sources of information you might want to have available for reference are Debug Manual Event Management Service EMS Manual Enscribe Programmer s Guide Expand Network Management Guide File Utility Program FUP Reference Manual Guardian Programmer s Guide Introduction to Distributed Systems Management DSM Distributed Systems Management DSM Programming Manual Inspect Manual NetBatch Manual Securi...

Page 13: ...quence for reading TACL related manuals Figure 1 Documentation Road Map 001 Guardian User s Guide TACL Programming Guide TACL Reference Manual NetBatch Manual Guardian Programmer s Guide Event Management Service EMS Manual Introduction to Distributed Systems Management DSM Related Manuals Prerequisite Manuals ...

Page 14: ...Related Reading About This Manual xiv 107365 Tandem Computers Incorporated This page left intentionally blank ...

Page 15: ...tem or none The items in the list may be arranged either vertically with aligned brackets on each side of the list or horizontally enclosed in a pair of brackets and separated by vertical lines For example LIGHTS ON OFF SMOOTH num Note also that TACL uses brackets in commands and functions Braces A group of items enclosed in braces is a list from which you are required to choose one item The items...

Page 16: ...arks around a symbol such as a bracket or brace indicate the symbol is a required character that you must enter as shown Item Spacing Spaces shown between items are required unless one of the items is a punctuation symbol such as a parenthesis or a comma For example PURGE file name If there is no space between two items spaces are not permitted In the following example there are no spaces permitte...

Page 17: ...n variables Commands are typically used for interactive work Built in functions are typically used for programmatic work Built in variables store environmental information you can set and retrieve their values Procedural constructs such as flow control statements are provided as part of the set of built in functions In addition TACL provides powerful text manipulation functions that process output...

Page 18: ...y example or sample program before placing the software into productive use Note For additional examples you can view the code for TACL commands by displaying the contents OUTVAR command Style Conventions The examples in this manual adhere to the following conventions for clarity and maintainability of programs Built in functions commands variables and other keywords appear in uppercase SET TIME U...

Page 19: ... are used for consistency The COMPUTE command and the COMPUTE IF and LOOP built in functions accept expressions as arguments When you supply a variable name as all or part of an expression you can enclose the variable name in square brackets or omit the square brackets Either way TACL retrieves the contents of the variable The examples in this manual include the square brackets to show that the st...

Page 20: ...Style Conventions An Overview of TACL 1 4 107365 Tandem Computers Incorporated This page left intentionally blank ...

Page 21: ...T variables Compare move and manipulate the contents of variables Process arguments Use TACL built in functions and commands including built in functions that provide conditional execution of code Use TACL built in variables to specify or obtain information about the TACL environment A routine is the most general and fully functioned type of procedural variable and is required for programs that ha...

Page 22: ...g each pass through a loop For the second three duplications copier loops to prepare a sequence of commands and then passes the commands to FUP The second method requires one additional variable and one more function call but starts only one FUP process and is therefore more efficient When you run copier your TACL process must be named using the NAME option with the TACL command To run copier load...

Page 23: ...d LOOP Statements Page 1 of 2 SECTION bubble MACRO FRAME PUSH i j max ocount element prompt temp SETMANY i j max ocount element 0 0 0 0 0 SET prompt Enter Next Number to be Sorted Request the number of elements specified in argument 1 and store them in levels of STACK LOOP WHILE element 1 DO PUSH stack INPUTV stack prompt SET element COMPUTE element 1 end of INPUT loop Loop once for each element S...

Page 24: ...does not check the data type of the argument Therefore bubble abc causes an error 29 bubble abc IF 0 abc Expecting a constant Or NOT Or a string variable does not exist Or a number Or 30 Use the routine in Figure 2 3 checkfiles with its IF statements and nested CASE statements to perform file maintenance on a subvolume The routine asks for an alphanumeric starting point in the subvolume It starts ...

Page 25: ...want to empty the file E Checkfiles stops at the end of the subvolume to stop earlier press BREAK Figure 2 3 Deleting Files in a Subvolume Page 1 of 2 SECTION checkfiles ROUTINE FRAME PUSH filenm reply prompt volsubvol thisone temp resp SET thisone DEFAULTS CURRENT SET volsubvol thisone SET prompt Enter the start file default beginning of subvol Read text from the terminal INPUTV filenm prompt SET...

Page 26: ...y filenm y n e INPUTV reply prompt IF MATCH Y SHIFTSTRING UP reply THEN SET resp PURGE filenm CASE resp 0 OUTPUT filenm purged OTHERWISE OUTPUT filenm could not be purged OUTPUT Error resp end CASE end IF IF MATCH E reply THEN empty the file FUP PURGEDATA filenm end CASE Get the next file SET filenm NEXTFILENAME filenm SET volsubvol FILEINFO VOLUME filenm FILEINFO SUBVOL filenm end SET end LOOP UN...

Page 27: ...is nested within a routine To call a program recursively use 0 for a macro or ROUTINENAME for a routine to specify the name of the program You cannot call a text variable recursively The following macro calls itself to display each of its arguments on a separate line TACL MACRO OUTPUT 1 Display current argument IF NOT EMPTY 2 THEN Test for additional arguments 0 2 TO Call self without current argu...

Page 28: ...n omitting the current pair 0 3 TO The following session shows how defaultvars works 15 PUSH a b c 16 defaultvars a 3 b 4 c 5 17 OUTPUTV a 3 18 OUTPUTV b 4 19 OUTPUTV c 5 Saving Levels of Variables The PUSH built in function creates a new level for a user defined or built in variable If you push a variable twice TACL creates two levels of the variable A new level remains in existence until you req...

Page 29: ...iles or devices Analyzing process output Analyzing results of functions For example whenever you use RUN or NEWPROCESS to initiate a process from TACL you can direct output from the process to a variable The OUT option directs program output to a file The OUTV option stores program output into a variable for later use Section 5 Initiating and Communicating With Processes describes process initiati...

Page 30: ... accepts a line address Table 2 1 lists both types of built in functions a dash indicates that there is no equivalent function or command Table 2 1 Built In Functions That Edit Variables by Line Character Address Function Line Address Function Description CHARADDR LINEADDR Converts between a character address and a line address CHARBREAK LINEBREAK Inserts a line break at the specified character or...

Page 31: ...to the address of the line that appears after the last line in the variable If the variable changes the assumed line numbers will be different on the next operation Unlike line numbers in an edit format file these assumed line numbers are not saved For example a variable called sample contains three lines of text 10 PUSH sample 11 APPEND sample This variable is called sample 12 APPEND sample It co...

Page 32: ...is macro it displays the following 15 volname The volume name is DATA 16 Figure 2 5 Extracting a Volume Name from a Variable SECTION volname MACRO FRAME PUSH mylist begin end vol Specify the contents of mylist SET mylist The disk file name is SYS1 DATA SVOL NAME1 Search for a dollar sign SET begin CHARFINDV mylist 1 Search for the first period following the dollar sign SET end CHARFINDV mylist beg...

Page 33: ...and inserts them at a given line position in another variable Unlike the built in functions the commands in Table 2 2 do not return a result Instead each of these commands except VINSERT lists the lines it operates on with sequence numbers to either the TACL OUT file or another user specified file You can append copies of the lines to an existing variable To use these commands specify a range of l...

Page 34: ...s of the word line in sample2 enter 15 VFIND sample2 line 2 There are 37 characters in this line 3 This is the last line in the variable To change all occurrences of line to sentence enter 16 VCHANGE sample2 line sentence 2 There are 37 characters in this sentence 3 This is the last sentence in the variable You can also use a variable for the comparison string 17 PUSH var1 18 SET var1 line 19 VFIN...

Page 35: ...names MACRO FRAME PUSH dsapoutput an output stack for DSAP diskpaths a stack of disk names diskinfo a single line from DSAP volname a volume name displayinfo a stack of volume names to display count a stack counter begin beginning of the volume name end end of the volume name Run DSAP and capture the output DSAP OUTV dsapoutput SHORT VFIND QUIET TO diskpaths dsapoutput Set a stack counter for disk...

Page 36: ... level to another variable level FILETOVAR Copies data from a file to the end of a variable level JOIN Converts a multiple line variable level into a single line variable level with spaces in place of end of line indicators _LONGEST Returns the longest element in a variable containing a space separated list SET SET VARIABLE Changes the entire contents of a variable level SETMANY Distributes the me...

Page 37: ...ted by the ARGUMENT built in function You can access a routine that contains an ARGUMENT call from any type of procedural variable For more information see Processing Arguments in Section 3 Developing TACL Routines Accessing Time Data The system clock keeps track of time as a numeric value known as a timestamp TACL supports timestamps in four formats for arithmetic operations comparisons and displ...

Page 38: ... evenings by advancing the civil time Usually but not always this is done in hour increments Numeric date a space separated list in Gregorian date form year month day hour minute second and fraction of a second If obtained for a Julian timestamp the list starts with the Julian day number Examples include 1992 4 28 22 59 17 88 converted from a three word timestamp 2447635 1992 4 28 22 59 17 88 conv...

Page 39: ...ng Timestamp Ending Timestamp Function Four word Julian Numeric date including Julian day INTERPRETTIMESTAMP Three word Numeric date CONTIME Numeric date Four word COMPUTETIMESTAMP Numeric date Julian day number COMPUTEJULIANDAYNO Three word Four word CONVERTTIMESTAMP Four word Three word CONVERTTIMESTAMP Julian day number Numeric date INTERPRETJULIANDAYNO Numeric date Textual date _CONTIME_TO_TEX...

Page 40: ...L Functions 002 JULIANTIMESTAMP TIMESTAMP 45553140000 CONTIME 1989 6 7 8 30 0 0 _CONTIME_TO_TEXT SETMANY _ yy mm dd hh mn ss ms 2447685 1989 6 7 8 30 0 0 0 SET hs COMPUTE ms 10 SET tm yy mm dd hh mn ss hs June 7 1989 08 30 00 211479971400000000 INTERPRETTIMESTAMP 2447685 1989 6 7 8 30 0 0 0 June 7 1989 08 30 00 _CONTIME_TO_TEXT tm NonStop System ...

Page 41: ...3 FILEINFO MODIFICATION 45553140000 1989 6 7 8 30 0 0 SETMANY _ yy mm dd hh mn ss ms 2447685 1989 6 7 8 30 0 0 0 SET hs COMPUTE ms 10 SET tm yy mm dd hh mn ss hs June 7 1989 08 30 00 211479971400000000 2447685 1989 6 7 8 30 0 0 0 June 7 1989 08 30 00 FILEINFO CREATION_GMT FILEINFO LASTOPEN_GMT _CONTIME_TO_TEXT _CONTIME_TO_TEXT tm CONTIME INTERPRETTIMESTAMP Disk ...

Page 42: ...weeks There are 8640000 hundredths of a second in a day Determine how many days have elapsed since midnight December 31st 1974 starting timestamp SET elapsed days COMPUTE TIMESTAMP 8640000 Determine how many whole weeks have elapsed SET elapsed weeks COMPUTE elapsed days 7 The day of the week is the total elapsed days minus the number of days in the elapsed whole weeks SET day of week COMPUTE elap...

Page 43: ...ns a modification of this example that shows how a nested routine can return dates as results Figure 2 10 Converting Timestamps SECTION getdates MACRO FRAME Save the current setting of OUTFORMAT so that it can be restored later PUSH OUTFORMAT INFORMAT PUSH date starting date 30 days ago yyyy year mm month dd day SET OUTFORMAT PRETTY Get the date and convert to yyyy mm dd calendar format SETMANY yy...

Page 44: ...e function keys create an edit format file that contains definitions for each function key you want to define You then load the file or refer to it from your TACLCSTM file so that it is loaded when you log on Function key definitions are typically ALIAS variables if you are providing an alias for a single command or built in function or MACRO variables for more complex operations For example you c...

Page 45: ...STRUCT variable set a BYTE value to the decimal value of the escape character and the numbers that perform the desired operation To define an escape sequence using DELTA specify a decimal number followed by the I command for information about DELTA see the TACL Reference Manual Use the macro in Figure 2 11 display to define several escape sequences and send them to the home terminal To run this ma...

Page 46: ...ii esc 6 ascii at OUTPUT Inverted text ascii esc 6 ascii dollar These words are inverted ascii esc 6 ascii at OUTPUT Inverted text ascii esc 6 ascii perc These words are inverted and dim ascii esc 6 ascii at OUTPUT ascii esc o ascii esc 6 ascii amp These words are inverted blinking in line 25 ascii esc 6 ascii at OUTPUT Here is the bell ascii bell OUTPUT And this is normal text UNFRAME Figure 5 10...

Page 47: ... help_input help_prompt DEF ascii STRUCT BEGIN BYTE byt0 0 1 VALUE 27 CHAR esc 0 1 REDEFINES byt0 BYTE byt1 0 1 VALUE 84 CHAR rdf1 0 1 REDEFINES byt1 roll down BYTE byt2 0 1 VALUE 75 CHAR rdf2 0 1 REDEFINES byt2 erase to end of line END SET help_prompt PRESS CTRL Y to exit or any other key to continue OUTPUT Sample list text OUTPUT Line 2 OUTPUT Line 3 INPUTV help_input help_prompt The following c...

Page 48: ...lear the screen BEGIN BYTE byt0 0 1 VALUE 27 73 decimal escape I CHAR clear 0 1 REDEFINES byt0 END OUTPUT ascii clear 0 1 Disable break mode SET BREAKMODE DISABLE Obtain information about the current user USERS OUTV userinfo EXTRACTV userinfo line EXTRACTV userinfo line SET prompt Password for USERNAME CHARGET userinfo 22 FOR 8 Read a password no echo and attempt to log on LOOP DO INPUTV NOECHO pw...

Page 49: ... built in variable before you set PREFIX to the new prompt text The following code displays the node name volume and subvolume in the TACL prompt SET PROMPT 1 DEF _PROMPTER TEXT BODY SET PREFIX DEFAULTS When you are working on your local system the prompt looks like this DATA SVOL 10 When you have used the SYSTEM command or SYSTEM built in function to access another node the prompt looks like this...

Page 50: ...ng displayvar to the display text avoids multiple OUTPUT calls To run this code load the file that contains the code and type menu Figure 2 14 Displaying a Menu Page 1 of 2 SECTION menu TEXT FRAME PUSH prompt prompt1 prompt2 fkey temp temp2 displayvar done PUSH OUTFORMAT Save the current value SET OUTFORMAT PRETTY SET done 0 SET prompt Please select a function key _ _ SET prompt1 Type file name fo...

Page 51: ...emp F3 INPUTV temp prompt1 SET temp2 INPUTV temp2 prompt2 IF EMPTYV BLANK temp2 THEN SET temp2 S AD SINK TGAL IN temp OUT temp2 NOWAIT F4 SINK PERUSE F5 INPUTV temp prompt1 SET temp2 INPUTV temp2 prompt2 IF EMPTYV BLANK temp2 THEN SET temp2 S ADMIN SINK TFORM IN temp OUT temp2 NOWAIT SF1 SET done 1 SF16 UNFRAME LOGOFF OTHERWISE OUTPUT Invalid selection Select a valid function key UNTIL done OUTPUT...

Page 52: ... the TACL trace facility invokes the _DEBUGGER function prior to invoking a variable The debugger displays the current history number nnn At this point you can enter a command If you enter a TACL command the debugger passes the command to TACL for execution If you enter a _DEBUGGER command _DEBUGGER executes the command Table 2 5 lists _DEBUGGER commands Table 2 5 _DEBUGGER Command Syntax Command ...

Page 53: ...rence declared variables The TACL debugger displays each line before it is evaluated therefore a declaration PUSH is in effect when the debugger is displaying a line that follows the PUSH function To set a breakpoint specify a variable that will be invoked at a later point in the debugging session The variable may be used by the function you will debug or by a later invocation from within the prog...

Page 54: ...it displays output similar to the following 2 tedsave sect08 Control passes to TEDIT After the user exits from TEDIT the routine displays DONE WITH VOL SUBVOL SECT08 The following paragraphs describe a sample debugging session The tedsave routine is already loaded into memory 3 BREAK tedsave 4 tedsave sect08 tedsave sect08 BREAK On line 5 the user issues a STEP command and _DEBUGGER displays the n...

Page 55: ...rmal processing 9 DISPLAY editfile sect08 10 CLEAR editfile 11 RESUME Control passes to TEDIT After you exit the routine displays DONE WITH VOL SUBVOL SECT08 To modify a variable during a debugging session use the MODIFY command After entering the new value press RETURN then enter CTRL Y to signify that there is no more input At prompt 10 in the previous example you could type the following to cha...

Page 56: ...Debugging TACL Programs Developing TACL Programs 2 36 107365 Tandem Computers Incorporated This page left intentionally blank ...

Page 57: ... n Instead in your routine you specify an ARGUMENT function with a list of argument alternatives The ARGUMENT function steps through the list and checks to see if the current argument matches a specified alternative If the argument matches ARGUMENT returns an index to the alternative and optionally stores the argument in a variable for use within the routine The following statement checks to see i...

Page 58: ...ile If so store it in fname SET rslt ARGUMENT VALUE fname FILENAME OTHERWISE IF rslt 1 THEN valid filename OUTPUT File name is fname ELSE OUTPUT Invalid filename UNFRAME Note The OTHERWISE alternative allows you to handle invalid arguments within your program The routine performs more error checking If the user does not supply an argument or if the file does not exist the routine returns an error ...

Page 59: ...at which the next ARGUMENT function will resume processing arguments How ARGUMENT Works Use the ARGUMENT built in function to specify data types and in some cases entities as arguments When invoked ARGUMENT steps through the list of supplied arguments ARGUMENT Options The ARGUMENT built in function supports the following options PEEK processes an argument but keeps the internal argument pointer at...

Page 60: ...TACL error occurs unless you specify the OTHERWISE alternative If you use OTHERWISE an invalid argument does not produce a TACL error your routine must retrieve and examine the invalid argument and determine an appropriate action Using ARGUMENT To define a fixed order for arguments use a sequence of ARGUMENT statements The following statements search for a file name followed by a slash followed by...

Page 61: ...ST attributes NUMBER END OTHERWISE 1 OUTPUT Argument count is the keyword stat 2 OUTPUT Argument count is the number stat 3 SET end 1 4 OUTPUT Invalid argument SET end 1 UNTIL NOT MORE OR end UNFRAME Using ARGUMENT for Data Within a Program TACL itself does not provide data type declarations and functions but you can write a function that uses ARGUMENT to determine the type and return the informat...

Page 62: ...code returns two digits even if the number has a single digit or three digits As an alternative you can define a routine that uses ARGUMENT SECTION getnumber ROUTINE FRAME PUSH rslt arg position First get the requested character position SET rslt ARGUMENT TEXT position NUMBER OTHERWISE CASE rslt 1 position is OK 2 Caller did not supply a number for position arg RESULT 1 RETURN Skip position charac...

Page 63: ...outine parses an OUT option enclosed in slashes The routine first checks for a slash If present the routine checks for the word OUT followed by a file name and an ending slash The routine then sets the TACL OUT file to the file specified in the argument list If the user does not specify an OUT option this routine displays the current setting of the OUT file To run the routine type the name of the ...

Page 64: ...me OUTPUT fname fname UNFRAME Processing Variables as Arguments The following routine accepts any type of existing variable except a STRUCT or a STRUCT item TACL ROUTINE PUSH vname IF ARGUMENT VALUE vname VARIABLE FORBID STRUCT ITEM OUTPUT vname POP vname Processing a Space Separated List of Words The following routine accepts a space separated list of words and returns it as a comma separated lis...

Page 65: ...RIABLE IF ARGUMENT VALUE num NUMBER IF ARGUMENT END Enclose the following in brackets in case the result contains more than one line RESULT CHARGET var 1 FOR num UNFRAME To obtain the contents of a multiple line variable enclose your statement in square brackets If for example x contains the following abcde fgh you can display the contents of x including the line break character at the end of the ...

Page 66: ...ion starting at a specified position where the text occurs in the variable The syntax is scan variable number text Do not enclose text in double quotes unless the quotes are part of the text Figure 3 4 Searching for Text SECTION scan ROUTINE FRAME PUSH var num txt IF ARGUMENT VALUE var VARIABLE IF ARGUMENT VALUE num NUMBER IF ARGUMENT VALUE txt TEXT IF ARGUMENT END RESULT CHARFINDV var num txt UNF...

Page 67: ... ROUTINE FRAME PUSH var1 var2 num IF ARGUMENT VALUE var1 VARIABLE IF ARGUMENT VALUE var2 VARIABLE IF ARGUMENT VALUE num NUMBER IF ARGUMENT END RESULT CHARINSV var2 num var1 UNFRAME Parsing Arguments for a Caller You can use the ARGUMENT built in function to provide a general parser for other TACL programs Figure 3 7 contains two sample programs getargs a macro that parses arguments for a routine t...

Page 68: ...atching argument is found otherwise variable is empty The following statement asks getargs to search for two arguments one required number and one optional text constant getargs REQUIRED NUMBER numvar OPTIONAL TEXT datavar If getargs finds a numeric argument it pushes num and stores the argument into num If getargs finds a text argument it pushes data and stores the argument in data Figure 3 7 Ass...

Page 69: ...UMENT COMMA END 2 SET 3 3 end IF required SINK ARGUMENT TEXT 3 2 Get required argument IF EMPTY 4 THEN Check for more triplets No more triplets argument cannot be followed by a comma SINK ARGUMENT END ELSE More triplets argument can be followed by a comma SINK ARGUMENT COMMA END end IF end CASE Call self again without the current triplet 0 4 TO end IF Call_getargs supports the following syntax cal...

Page 70: ...s data1 data2 4 file1 data1 file2 data2 n1 4 12 Figure 3 8 Sending Arguments to a Parsing Program SECTION call_getargs ROUTINE FRAME getargs REQUIRED filename file1 REQUIRED filename file2 OPTIONAL number n1 OPTIONAL number n2 Display the results OUTPUT file1 file1 OUTPUT file2 file2 IF NOT EMPTY n1 THEN OUTPUT n1 n1 IF NOT EMPTY n2 THEN OUTPUT n1 n2 UNFRAME ...

Page 71: ...rns results To run this macro load the associated file and enter report_shell Figure 3 9 Converting Timestamps SECTION report_shell MACRO FRAME PUSH OUTFORMAT INFORMAT today SET OUTFORMAT PRETTY SET INFORMAT TACL Calling part of Macro OUTPUT This macro displays a start and end date SETMANY today get_dates OUTPUT OUTPUT The date is today UNFRAME SECTION get_dates ROUTINE FRAME Save the current sett...

Page 72: ...o process one or more arguments To use this macro load the associated file and enter caller file name TACL TAL PASCAL system name Caller calls proc_arg to process each argument Proc_arg calls itself additional times if there is more than one argument Figure 3 10 Processing Arguments SECTION caller MACRO FRAME PUSH e1 var1 rslt IF NOT EMPTY 1 THEN proc_arg UNFRAME SECTION proc_arg ROUTINE SET rslt ...

Page 73: ...rocess the first argument OUTPUT current argument fn Check for another file name SET rslt ARGUMENT TEXT nextfn FILENAME SYNTAX COMMA END OTHERWISE CASE rslt 1 2 3 Next argument is a comma or end ignore it SET nextfn OTHERWISE OUTPUT Invalid argument RETURN If nextfn contains a file name or there are additional unprocessed arguments call self appending the results IF NOT EMPTY nextfn REST THEN RESU...

Page 74: ...ng error messages Resetting data defaults Terminating open INLINE processes Resetting frames or accumulated results Purging scratch files Performing INITTERM operations Passing information to the calling routine Returning control to the calling routine If you declare local variables within the body of your routine determine whether or not to delete these variables within the exception handler If a...

Page 75: ...t was listed in a FILTER function FILTER Specifies the types of exceptions a routine can handle RAISE Causes an exception to occur RETURN Returns immediately from the routine As shown in Figure 3 12 a routine that contains an exception handler has the following structure It begins with a CASE statement immediately after the SECTION directive This CASE statement uses the EXCEPTION built in function...

Page 76: ...L portion Pushes global variables Does not invoke RESET The CASE statement Does not contain a FRAME Does not push global variables Invokes RESET and RETURN The body of code ends with UNFRAME The body of code starts with FRAME and ends with UNFRAME Creating a Release Exception Handler A release exception handler processes exceptions and returns to the calling procedure The _CALL path taken when the...

Page 77: ...its To invoke this routine load the associated file and enter command_processor Figure 3 13 Sample Release Handler SECTION command_processor ROUTINE Exception handler CASE EXCEPTION _CALL No action required when first called _BREAK OUTPUT BREAK key pressed RESET RESULTS FRAMES RETURN _ERROR OUTPUT Input error occurred RESET RESULTS FRAMES RETURN End CASE Beginning of body of routine FRAME PUSH cmd...

Page 78: ...ile template file template The specifies purge without confirmation without it the routine prompts for each file If the routine encounters a _BREAK exception it displays a message with the number of files purged and the number not purged and then exits Figure 3 14 Returning Information From a Release Handler Page 1 of 3 SECTION purgefiles ROUTINE CASE EXCEPTION _CALL _BREAK _ERROR PUSH errtext ERR...

Page 79: ...t IF ARGUMENT VALUE prevname FILENAME SYNTAX IF ARGUMENT SLASH SET prevname FILEINFO FULLNAME prevname SET firsttime 1 LOOP DO IF firsttime THEN SET firsttime FILEINFO EXISTENCE prevname IF firsttime THEN SET firsttime 0 ELSE SET prevname FILENAMES MAXIMUM 1 PREVIOUS prevname filetemplate IF NOT EMPTYV BLANK prevname THEN IF wanttopurge THEN SET purgeerr PURGE prevname IF purgeerr THEN OUTPUT Purg...

Page 80: ...tive command shell with five commands a keep handler allows you to process the five commands and any errors or break conditions without exiting the routine The user could not then gain access to a standard TACL prompt The _CALL path is the entry point for the routine and because control is to remain in the routine it is not likely to be executed repeatedly Therefore the _CALL path contains the FRA...

Page 81: ... Exception Handler SECTION restricted_cmd_processor ROUTINE CASE EXCEPTION _CALL FRAME PUSH cmd _BREAK OUTPUT BREAK key pressed _ERROR OUTPUT TACL error occurred EXIT For demo only RESET FRAMES RESULTS RETURN OTHERWISE OUTPUT Unknown exception occurred End CASE Filters predefined exceptions only FILTER _BREAK _ERROR EXIT After you enter this loop control stays here unless the routine is processing...

Page 82: ...oldstart Pops old variables if necessary pushes new variables sets the condition and recovery variables and then starts the application If the user presses BREAK during this time the exception handler sets the condition and recovery flags When finished coldstart resets the condition and recovery flags Warmstart Attempts to purge a file with an invalid file name this attempt forces a TACL error to ...

Page 83: ...key hit during _ OUTPUT IF NOT EMPTYV name THEN name at step step ELSE input end of IF end of OUTPUT SETMANY condition recovery 1 REQUIRED _ERROR OUTPUT Error occurred during name at step OUTPUT step ERRORTEXT CAPTURE err OUTPUT The error is OUTPUTV err SETMANY condition recovery 1 REQUIRED EOF OUTPUT CTRL Y will not break me EXIT RESET FRAMES RESULTS RETURN Body of the routine enable four excepti...

Page 84: ...OP UNFRAME SECTION display_initial_message TEXT OUTPUT This interface is used to OUTPUT COLDSTART WARMSTART or SHUTDOWN the application OUTPUT OUTPUT EXIT is disabled if an error exists OUTPUT The BREAK key and CTRL Y do not cause an EXIT SECTION warmstart MACRO WARMSTART the application IF condition 1 THEN OUTPUT An error condition exists OUTPUT Must COLDSTART or SHUTDOWN OUTPUT ELSE CASE recover...

Page 85: ...ISE SET name VARIABLEINFO VARIABLE 0 SET step 1 PUSH e f If an error occurs during this step force recovery OUTPUT COLDSTARTing application X OUTPUT Press BREAK now to force a recovery DELAY 300 SETMANY condition recovery 0 OFF OUTPUT COLDSTART Successful OUTPUT SECTION shutdown MACRO SHUTDOWN the application OUTPUT SHUTDOWN of application X CASE recovery REQUIRED cleanup OTHERWISE SET name VARIAB...

Page 86: ...Handlers The routines in Figure 3 17 show one way to combine a keep handler restricted_caller and a release handler protected_code Restricted_caller starts first therefore if an exception occurs control returns to the processing loop after the exception is processed When the user enters a valid command restricted_caller calls protected_code to execute the command that routine in turn calls either ...

Page 87: ...E PUSH cmd exceptionlist SET exceptionlist _BREAK _ERROR EXIT _BREAK OUTPUT BREAK key pressed _ERROR OUTPUT TACL error occurred EXIT for demonstration purposes RESET FRAMES RESULTS RETURN OTHERWISE OUTPUT Unknown exception occurred End CASE Filter for predefined exceptions only FILTER exceptionlist LOOP DO SET cmd INPUT Enter cmd Get value from terminal CASE cmd ADD protected_code do_add SUB prote...

Page 88: ..._code ROUTINE CASE EXCEPTION _CALL No action required when first called OTHERWISE RESET FRAMES RESULTS Deallocate resources RAISE EXCEPTION Return to caller with exception raised so that the caller executes its exception handler End CASE FILTER exceptionlist REST Invoke rest of arguments call macro SECTION do_add ROUTINE OUTPUT Adding SECTION do_sub ROUTINE OUTPUT Subtracting ...

Page 89: ...the REQUESTER function TACL continues to execute code For waited I O operations TACL stops at the next I O request and ensures that each read or write is complete before processing the next request For nowaited operations call WAIT to determine whether your request has been completed If you plan to read or write records larger than 239 bytes you must use waited I O To initiate a read or write oper...

Page 90: ...lts of the open operation otherwise you will not know if the open request received an error To initiate a read operation append data to the prompt variable APPEND prompt_var start read When reading a disk file TACL discards the data in prompt_var you can specify any non null data TACL reads a record from FILE1 and places it into read_var You can use EXTRACT V to retrieve data from read_var as you ...

Page 91: ...ON waited_read ROUTINE FRAME PUSH open_error read_error read_data read_prompt line PUSH read_file rslt SET rslt ARGUMENT VALUE read_file FILENAME OTHERWISE CASE rslt 1 Open the file SET open_error REQUESTER WAIT READ read_file read_error read_data read_prompt IF open_error THEN OUTPUT Error opening read_file open_error RETURN SET read_error 0 LOOP WHILE NOT read_error DO APPEND read_prompt start E...

Page 92: ...FILE1 and places it into read_var You can use EXTRACT V to retrieve data from read_var as you EXTRACT records TACL deletes them from read_var Each time you append a line to prompt_var the TACL process reads a record from disk file FILE1 and appends it to read_var TACL then performs a READ operation TACL continues executing code when you are ready to wait for completion of the read operation use th...

Page 93: ..._error read_data read_prompt line PUSH read_file rslt SET rslt ARGUMENT VALUE read_file FILENAME OTHERWISE CASE rslt 1 Open the file SET open_error REQUESTER WAIT READ read_file read_error read_data read_prompt IF open_error THEN OUTPUT Error opening read_file open_error RETURN SET read_error 0 LOOP WHILE NOT read_error DO APPEND read_prompt start CASE VARIABLEINFO VARIABLE WAIT read_data read_err...

Page 94: ...ON PROTECTED WRITE file2 error_var write_var To initiate the write operation append data to the write variable APPEND write_var This is a test When TACL detects data in write_var it writes the data to FILE1 You can add a record to a structured file but cannot replace a record If you attempt to write a record that already exists TACL returns an error Each time you append a line to write_var the TAC...

Page 95: ...TACL IN file Figure 4 3 Reading From a Terminal and Performing a Waited Write SECTION waited_write ROUTINE FRAME PUSH open_error write_error write_data write_prompt line PUSH write_file rslt SET INPUTEOF 0 SET rslt ARGUMENT VALUE write_file FILENAME OTHERWISE CASE rslt 1 Open the file SET open_error REQUESTER WAIT WRITE write_file write_error write_data IF open_error THEN OUTPUT Error opening writ...

Page 96: ... the write variable APPEND write_var This is a test When TACL detects data in write_var it writes the record to FILE1 You can add a record to a structured file but you cannot replace a record If you attempt to write a record that already exists TACL returns an error Each time you append a line to write_var the TACL process writes a record to FILE1 TACL continues executing code When you are ready t...

Page 97: ...rming a Nowaited Write SECTION nowaited_write ROUTINE FRAME PUSH open_error write_error write_data write_prompt line PUSH write_file rslt SET INPUTEOF 0 SET rslt ARGUMENT VALUE write_file FILENAME OTHERWISE CASE rslt 1 Open the file SET open_error REQUESTER WRITE write_file write_error write_data IF open_error THEN OUTPUT Error opening write_file open_error RETURN LOOP DO CASE VARIABLEINFO VARIABL...

Page 98: ...s data to the end of FILE2 Copy could be changed to modify records before copying them for example you could search for a string and if it is present modify the string before writing the record to the destination file Figure 4 5 Copying Records From One File to Another File Page 1 of 2 SECTION copy ROUTINE FRAME PUSH rslt rslt2 source dest PUSH write_err write_var read_err read_var prompt_var PUSH...

Page 99: ...e read was successful IF MATCH read_var Ready THEN Wait for the last write to complete SINK WAIT write_var Move the record into write_var to initiate the write operation EXTRACTV read_var write_var UNTIL read_err end of loop Wait for the last write operation to finish SINK WAIT write_var Close both files and terminate the REQUESTER functions SINK REQUESTER CLOSE read_var SINK REQUESTER CLOSE write...

Page 100: ... parses the arguments of a calling routine it accepts sets of three arguments REQUIRED or OPTIONAL specify whether an argument must be present or can be omitted from the list of arguments Type specifies an ARGUMENT alternative such as FILENAME or KEYWORD Variable is pushed and set by the TEXT option of ARGUMENT if the argument is supplied otherwise the variable remains empty defaultvars accepts a ...

Page 101: ...TRUCTS to compare lines of data DEF line1 STRUCT LIKE char_array DEF line2 STRUCT LIKE char_array PUSH linecount file1_err file1_var file1_prompt PUSH file2_err file2_var file2_prompt SET linecount 0 Call the getargs macro to parse FCOMP arguments getargs required FILENAME file1 required FILENAME file2 optional NUMBER f1 optional NUMBER f2 optional FILENAME SYNTAX results Call defaultvars to set d...

Page 102: ... file1_err file1_var file1_prompt IF file1_err 0 THEN OUTPUT file1 opened successfully ELSE OUTPUT file1 not open file error file1_err RETURN SET file2_err REQUESTER WAIT READ file2 file2_err file2_var file2_prompt IF file2_err 0 THEN OUTPUT file2 opened successfully ELSE OUTPUT file2 not open file error file2_err SINK REQUESTER CLOSE file1_err close FILE1 RETURN While there are no errors read and...

Page 103: ...line2 column f1 f2 THEN OUTPUT File file1 line linecount line1 OUTPUT OUTPUT File file2 line linecount line2 OUTPUT end of IF COMPAREV end of IF NOT file2_err end of IF file1_err end of LOOP Close the files SINK REQUESTER CLOSE file1_err SINK REQUESTER CLOSE file2_err Handle EOF conditions file size mismatches and errors CASE file1_err file2_err 1 1 OUTPUT linecount lines compared Normal exit 0 1 ...

Page 104: ... TFORM NEW command within the TACL file to cause TFORM to advance to the top of a new page When you insert a directive of the form NEW in the file to be printed tacllist replaces it with NEW The macro sets the page width to 132 characters To preview your output before printing specify your terminal name as the output file Following a preview reinvoke tacllist to get a printed listing To run this m...

Page 105: ..._date OUTPUT HOLD COLUMN 71 WIDTH 2 JUSTIFY RIGHT FILL ZERO list_hour OUTPUT HOLD COLUMN 73 WIDTH 1 OUTPUT HOLD COLUMN 74 WIDTH 2 JUSTIFY RIGHT FILL ZERO list_min OUTPUT COLUMN 77 OUTPUT HOLD Program Date file_date OUTPUT HOLD COLUMN 27 WIDTH 2 JUSTIFY RIGHT FILL ZERO file_hour OUTPUT HOLD COLUMN 29 WIDTH 1 OUTPUT HOLD COLUMN 30 WIDTH 2 JUSTIFY RIGHT FILL ZERO file_min OUTPUT HOLD COLUMN 49 Page N...

Page 106: ... empty drop out of the loop and display an error IF NOT EMPTY 1 THEN SET file input 0 33 SHIFTSTRING UP 1 Look for the out file name If empty use the default OUT file IF NOT EMPTY 2 THEN SET file output 0 33 SHIFTSTRING UP 2 ELSE SET file output 0 33 default_outfile Open the input file for read access SET err_inp REQUESTER WAIT READ file input 0 33 err_inp rec_inp prompt IF err_inp 0 THEN open err...

Page 107: ...ord into line APPEND prompt start EXTRACTV rec_inp line LOOP WHILE NOT err_inp DO If the line equals NEW perform a page break IF MATCH match_string line THEN OUTPUT NEW output_banner SET lines_out 0 Otherwise output the line number and the line ELSE OUTPUT HOLD WIDTH 3 COLUMN 1 JUSTIFY RIGHT FILL ZERO line_num OUTPUT HOLD WIDTH 1 OUTPUTV line SET lines_out COMPUTE lines_out 1 If the page is full i...

Page 108: ...ACLLIST inputfilename outputfilename OUTPUT end of IF NOT EMPTY 1 UNFRAME Figure 4 8 contains a sample listing produced by the TACLLIST macro Figure 4 8 TACLLIST Output STYLE FORM WIDTH 132 CHARS tacllist Program Name S6A Listing Date 920415 12 21 Program Date 920415 12 20 Page Number 001 001 SECTION defaultvars MACRO 002 003 Any more pairs 004 IF NOT EMPTY 1 THEN 005 006 Is this variable level em...

Page 109: ...sions about further commands depending on information obtained from the utility If you access a utility or other process frequently during interactive work you can save process startup overhead by starting the process once sending it commands as needed and letting it run in the background until you are finished The following subsections describe mechanisms for starting and communicating with proce...

Page 110: ...provides RUN and NEWPROCESS options that allow you to specify whether your TACL process waits for the new process to finish or not In addition TACL provides commands and a RUN and NEWPROCESS option IN that send startup information to the new process Table 5 1 lists these options and commands Table 5 1 RUN and NEWPROCESS Communication Options Communication Requirements at Startup Time Associated RU...

Page 111: ...le characteristics to programs ASSIGN associates a physical file name with a logical file name The physical file name is any valid file name The logical file name is defined and used within the program you are starting The following code assigns the file DATAFILE to the logical file name FT002 for use by a FORTRAN program forcalc that accesses the logical file FT002 14 ASSIGN FT002 datafile 15 for...

Page 112: ...ers for the FASTSORT program You can use the DEFINESAVE and DEFINERESTORE built in functions to save a copy of one or more DEFINEs for later use This operation is similar to a FRAME and UNFRAME for a set of variables you can save the current set of DEFINEs and restore them when you are finished with your work For more information about how to create and use DEFINEs see the TACL Reference Manual or...

Page 113: ...ceive a reply from the process 4 Based on the reply decide upon the next action and either go back to Step 2 or continue to Step 5 5 When finished close the process The REQUESTER APPEND V EXTRACT V and WAIT built in functions support this type of communication There is also a third communication method that allows TACL to run as a server process Section 6 Running TACL as a Server describes this me...

Page 114: ...ify the INLINE option Your commands appear as they would in an interactive session except that they start with the defined prefix and a space character You can capture the output into a queue examine the contents of the queue and enable and disable output to the queue TACL IN and OUT files coexist with INLINE input and output streams when you start a process with the INLINE option TACL does not us...

Page 115: ...asses the prefixed line to the process as its input In addition to program defined termination commands you can use the INLINEEOF built in function to pass an EOF to an inline process Lines sent as input to processes started with the INLINE option are not copied to the TACL OUT file unless you set INLINEECHO to a nonzero value Use the macro in Figure 5 1 inline_fup to set the INLINE prefix start a...

Page 116: ... process UNFRAME Use the macro in Figure 5 2 script to build a script definition for use by a FUP process using double slash characters as the prefix The syntax is script When you invoke this macro it displays the FUP banner the SECURE command and FUP results Figure 5 2 Building a Script SECTION script MACRO FRAME DEF getinfo TEXT BODY Define the script SECURE NUNU Resecure all files EXIT Finished...

Page 117: ...UT INLOUT ON Enables or disables output lines to the TACL OUT file INLINETO INLTO NULL Specifies an output variable Lines written by a process started with the INLINE option and without the OUT or OUTV options are copied to the current TACL OUT file unless the INLINEOUT built in variable is set to zero to disable copying If the INLINETO built in variable contains the name of a variable TACL append...

Page 118: ... Figure 5 3 Retrieving Output from FUP SECTION inline_fup_log ROUTINE FRAME PUSH file1 file2 INLINEPREFIX Create a new level of INLINEPREFIX INLINETO Create a new level of INLINETO log Create a variable to contain output SET INLINEPREFIX Set the new prefix to SET INLINETO log Associate log with process output SINK ARGUMENT VALUE file1 FILENAME SINK ARGUMENT VALUE file2 FILENAME FUP INLINE Start FU...

Page 119: ... ARGUMENT VALUE file1 FILENAME SINK ARGUMENT VALUE file2 FILENAME SET INLINEOUT 0 Disable output to the terminal FUP INLINE info file1 Send a command to FUP info file2 Send a second command to FUP INLINEEOF Stop FUP INLTO Stop logging FUP output SET INLINEOUT 1 Display the results OUTPUT Here are the contents of the output log OUTPUTV log OUTPUT End of the log UNFRAME Use the macro in Figure 5 5 e...

Page 120: ... INLINE Start PERUSE in inline mode The preceding command waits until the PERUSE summary is available and PERUSE prompts for its first command SET INLINETO del_rslts Now store deletion results Loop over remaining lines LOOP WHILE NOT EMPTYV queue DO EXTRACTV queue line IF MATCH JOB line THEN LOOP WHILE NOT EMPTYV queue DO EXTRACTV queue line Get the next job line SETMANY jobno line J jobno DEL Del...

Page 121: ...their output format or the rules for some of their commands The output from some processes changes with the release of new Tandem software The input syntax and output formats can vary from release to release If you process text strings reevaluate process dependent code for new releases of software The INLINE option cannot be combined with the IN or INV options The INLINE option includes the effect...

Page 122: ...empt to add lines TACL returns an error Dynamic Provides an interactive type environment You can add lines at any time during the life of the process To specify dynamic include the word DYNAMIC after the variable name in the INV option TACL sends the lines one by one to the process If the variable is empty the process waits until the variable contains data If you use a dynamic INV variable you can...

Page 123: ...rocess Closes the process Determining the Name of the IN File TACL assigns a name to the IN file used by the new process The name consists of the name of your TACL process followed by a period a number sign the letter S and a number in the range 0 through 32767 T127 S3 for example Use the routine in Figure 5 6 getname to start a FUP process and retrieve the name of its IN file To use the routine l...

Page 124: ...the first line from a variable level in such a way that no data is lost if the process is simultaneously adding lines to a variable level If you use OUTPUTV to display an OUT variable and then use SET to clear it a new line could arrive between the OUTPUT and the SET that line would be lost Use WAIT to delay processing until one of a list of variable levels is ready WAIT returns the fully qualifie...

Page 125: ...ession with FUP 1 Define the variables 9 PUSH input_queue output_queue prompt_string termination_results 2 Start a FUP process that runs concurrently with the TACL process 10 FUP INV input_queue DYNAMIC PROMPT prompt_string OUTV output_queue NOWAIT STATUS termination_results 3 Use WAIT to make sure the previous operation has finished 11 SINK WAIT prompt_string 4 Clear the prompt variable 12 SET pr...

Page 126: ...e macro displays the contents of LOGFILE before exiting Figure 5 8 Directing FUP Output to a Log File SECTION fup2 MACRO FRAME PUSH errvar fupout logvar result Create variables Open logfile for writing SINK REQUESTER WAIT WRITE logfile errvar logvar APPEND logvar CONTIME TIMESTAMP FUP FROM TERMINAL MYTERM Write a log record SYSTEM SYSTEM FUP OUTV fupout Invoke FUP LOOP WHILE NOT EMPTYV fupout DO R...

Page 127: ...ing PERUSE Jobs SECTION show_spooler_jobs MACRO FRAME PUSH line job input_queue prompt_string output_queue Start PERUSE as an implicit server PERUSE INV input_queue DYNAMIC PROMPT prompt_string NOWAIT OUTV output_queue Wait for PERUSE to start SINK WAIT prompt_string Look for a line that contains Job IF LINEFINDV output_queue 1 Job 0 THEN VDELETE QUIET output_queue 1 LINEFINDV output_queue 1 Job L...

Page 128: ...ular variable level can be associated with only one process at a time A TACL process can have a maximum of 100 simultaneous openers including active processes using variables for STATUS PROMPT INV OUTV or REQUESTER Multiple openers of a given process must use the process with care If one opener has issued a WRITEREAD and is waiting for data to be appended to the IN variable of the process any othe...

Page 129: ...ply to processes associated with devices as well as other types of processes Table 5 5 lists the functions and commands with which you can run a process and communicate through its RECEIVE mechanism You can request waited or nowaited I O Table 5 5 Functions to Use With RECEIVE TACL Function or Command Description REQUESTER with the READ option Opens the process by name APPEND V Sends a WRITEREAD t...

Page 130: ...d use WAIT to make sure the previous operation has finished Sending Messages to a Process The following examples show how to use REQUESTER to communicate with processes Use the routine in Figure 5 10 send to open a terminal and write a message to line 25 of the terminal The syntax is send device id text The OUTPUT statements output_help_text in this example do not follow the indentation style guid...

Page 131: ...TPUT COLUMN 3 SEND terminal name message OUTPUT OUTPUT COLUMN 3 Where terminal name is the destination terminal OUTPUT COLUMN 10 message is the message text OUTPUT OUTPUT COLUMN 3 SEND with no arguments displays this information OUTPUT FILTER _BREAK _ERROR Get the arguments If the user did not provide any arguments or if either of the arguments is invalid then display the help text CASE ARGUMENT V...

Page 132: ...me origin_time_hh origin_time_mm Build the message SET message L25 char 0 1 origin_time Line 25 SET message message USERNAME PROCESSINFO PAID MYPID Orig userID SET message message temp_message The message text Open the destination device SET req_status REQUESTER WRITE destination_name error send_message IF req_status 0 THEN The open failed Report the error and exit OUTPUT The open of the terminal ...

Page 133: ...he routine in Figure 5 11 strio shows how to use STRUCTs and the REQUESTER built in function to send messages to CMON and display replies For more information about CMON see the Guardian Programming Guide To run this example load the file that contains the definitions in Figure 5 11 and enter strio strio is listed at the end of Figure 5 11 Figure 5 11 Creating CMON Messages Page 1 of 4 SECTION cmo...

Page 134: ...N logoff_msg STRUCT BEGIN INT msgcode VALUE 51 STRUCT ci LIKE cmon_ci END SECTION logoff_reply STRUCT BEGIN INT replycode CHAR replytext 0 131 END SECTION processcreation_msg STRUCT BEGIN INT msgcode VALUE 52 STRUCT ci LIKE cmon_ci FNAME progname INT priority INT processor FNAME proginfile FNAME progoutfile FNAME proglibfile FNAME progswapfile END SECTION processcreation_reply STRUCT BEGIN INT rep...

Page 135: ...et the names of the two structures PUSH to_cmon from_cmon IF ARGUMENT VALUE to_cmon VARIABLE IF ARGUMENT VALUE from_cmon VARIABLE IF ARGUMENT END Set the common information for the caller SET to_cmon ci groupuser grp_usr PROCESSINFO PAID MYPID SET to_cmon ci cipri PROCESSINFO PRI MYPID SET to_cmon ci ciinfile MYTERM SET to_cmon ci cioutfile MYTERM Open CMON PUSH e r p IF REQUESTER WAIT 5000 READ c...

Page 136: ...FRAME Do a simulated LOGON DEF msg STRUCT LIKE logon_msg DEF reply STRUCT LIKE logon_reply talk_to_cmon msg reply Do a simulated processcreation DEF msg STRUCT LIKE processcreation_msg SET msg progname tacl These are simulated RUN options SET msg priority 148 SET msg processor 13 SET msg proginfile taclin SET msg progoutfile taclout SET msg proglibfile tacllib SET msg progswapfile taclswap DEF rep...

Page 137: ...able to use SERVER For information about accessing a TACL process as a server see Section 6 Running TACL as a Server Naming Your Process To create a server path for your TACL process use the SERVER built in function After TACL creates the name other processes can open your TACL as if it were a file so that you can write to and read from those processes For example PUSH server_name in_var out_var p...

Page 138: ...an INFO operation Figure 5 12 Communicating With FUP Using SERVER SECTION serv MACRO FRAME PUSH server_name in_v out_v prompt_v response lines Assign a name to this process SET server_name SERVER IN in_v PROMPT prompt_v OUT out_v Start FUP and use this process for its IN and OUT files FUP IN server_name OUT server_name NAME fp NOWAIT Wait for a prompt and issue a command SINK WAIT prompt_v APPEND ...

Page 139: ...t product DP provides a mechanism for starting and communicating with processes If ViewPoint is installed on your system you can use DP to Define and start one or more background processes Communicate with a background process interactively or with a list of commands Manage response data As with other asynchronous background processes you can use DP to run a process and access it frequently to avo...

Page 140: ...NetBatch Jobs and Completion Codes TACL saves completion code information in the variable _COMPLETION if it exists Tandem code in the standard TACLSEGF defines _COMPLETION as follows DEF _completion STRUCT BEGIN INT messagecode CRTPID process INT headersize VALUE 14 INT4 cputime INT jobid INT completioncode STRUCT internal BEGIN INT terminationinfo SSID subsystem END STRUCT external REDEFINES inte...

Page 141: ...more of the following are true PMSG is ON MESSAGECODE is 5 STOP and COMPLETIONCODE is not 0 and not 6 stopped externally MESSAGECODE is 6 and COMPLETIONCODE is not 5 and not 6 stopped externally TERMINATIONINFO is not 0 and COMPLETIONCODE is not 6 stopped externally TEXTLENGTH is not 0 For more information about MESSAGECODE and other definitions see the System Procedure Calls Manual The display sh...

Page 142: ...process PARAM BINSERV SYSTEM SYSTEM BINSERV PARAM SYMSERV SYSTEM SYSTEM SYMSERV COBOL85 name CPU 3 PRI 140 IN CBLFL OUT S PM APPOBJ Check the completion code if an error occurred display it and exit IF _COMPLETION COMPLETIONCODE 0 THEN OUTPUT Error during COBOL85 compilation and binding OUTPUT Completion code _COMPLETION COMPLETIONCODE UNFRAME RETURN SQL compilation waited process SQLCOMP name CPU...

Page 143: ...to nulls If you detect a null line length the remaining part of the buffer is empty You can use this information to determine where in the buffer to start reading On the initial read if the next line field has a zero length you must begin reading at line 0 Use the routine in Figure 5 14 enquiry to access the ENQUIRY feature of TACL The enquiry routine acquires the last 22 lines that a TACL process...

Page 144: ...h SET max_chars 80 Truncate display at this position SET last_line 21 SET last_char COMPUTE max_chars 1 DEF enquiry_message STRUCT BEGIN INT message_code VALUE 22 END DEF enquiry_reply STRUCT BEGIN INT next STRUCT line 0 last_line BEGIN INT length CHAR text 0 last_char END END Get the name of the TACL process SINK ARGUMENT TEXT process_name PROCESSNAME Open the TACL process SET status REQUESTER WA...

Page 145: ...ngth 0 THEN SET next 0 If we do not have an empty buffer begin the processing IF enquiry_reply line next length 0 THEN LOOP DO Check the line length and truncate if necessary IF enquiry_reply line next length max_chars THEN SET enquiry_reply line next length max_chars Display it for length characters SET length COMPUTE enquiry_reply line next length 1 OUTPUT enquiry_reply line next text 0 length C...

Page 146: ...Monitoring Job Status ENQUIRY Initiating and Communicating With Processes 5 38 107365 Tandem Computers Incorporated This page left intentionally blank ...

Page 147: ...architecture these processes wait until they receive a request on RECEIVE and then process the request and reply with the results Both of these mechanisms support the following type of communication TACL Process such as a PATHWAY TCP OPEN SEND REPLY The following subsections describe how to create both types of servers Note When operating as a server TACL does not act as a fault tolerant server it...

Page 148: ... the CLOSE option Closes the process Use the macro in Figure 6 1 runsrv to read requests from the home terminal and send the requests to a background TACL process The background TACL process executes each request and returns results to MYTERM To invoke this macro load the file and enter runsrv Figure 6 1 Starting and Sending Requests to a TACL Server Page 1 of 2 SECTION runsrv MACRO FRAME PUSH err...

Page 149: ... Figure 6 1 accepts the standard set of TACL commands and built in functions to create a TACL server that runs your code see the next subsection Running TACL Code as a Server When TACL is operating as a server it queues messages if they arrive while TACL is already working on a message The depth of this queue is limited solely by the availability of space in the TACL segment If the message cannot ...

Page 150: ...t message and the resumes processing the text left over from the first message After TACL processes all of the message text it replies with the results of the second message and the results from the leftover text in the first message The second mechanism is not used frequently the description is provided to explain the action of TACL in case such use should occur Directing Output From TACL As a se...

Page 151: ...that uses an INPUTV and REPLYV loop Using REPLYPREFIX Pathway programs can use TACL as a server You can use REPLYPREFIX to prefix each reply with a 16 bit binary code The REPLYPREFIX built in variable can be empty or it can contain any numeric value in the range 0 through 65535 If REPLYPREFIX is not empty its value precedes each response if REPLYPREFIX is set replies can be up to 5002 bytes long U...

Page 152: ... file that starts the Pathway environment listed after Figure 6 3 PATHCNFG The Pathway configuration file in Figure 6 4 In addition the Pathway configuration file uses a file named LOG1 for logging create this file before starting the Pathway environment When the application runs it presents a screen that lists the three functions If you type a request TACL processes the request and returns a resp...

Page 153: ...WISE 1 CREATE file CASE ARGUMENT VALUE param FILENAME TEMPLATE END TEXT 1 RESULT File param already exists 2 CREATE param RESULT File param created 3 RESULT No file name supplied 4 RESULT Invalid file name param 2 PRINT file CASE ARGUMENT VALUE param FILENAME END TEXT 1 fup NOWAIT OUT null copy param s prt RESULT Printing of file param started 2 RESULT No file name supplied 3 RESULT Invalid file n...

Page 154: ... DEF answer80 STRUCT 80 character text response BEGIN CHAR byte 0 79 END IF ARGUMENT VALUE text TEXT SET REPLYPREFIX 0 constant reply code SET answer80 CHARGET text 1 to 80 IF INTERACTIVE THEN OUTPUT answer80 Display the result ELSE or REPLYV answer80 Reply UNFRAME main loop PUSH request prompt outcome end_flag SET end_flag 0 LOOP DO Read a record INPUTV NOECHO request prompt IF INPUTEOF THEN SET ...

Page 155: ...compile the requester Screen COBOL produces two files POBJCOD and POBJDIR Figure 6 3 Screen COBOL Code That Accesses a TACL Server Page 1 of 2 Identification Division Program Id TEST TACL Environment Division Configuration Section Source Computer EXT Object Computer EXT Terminal Is T16 6530 Special Names REVERSE Reverse F1 F1 SF16 Sf16 Data Division Working Storage Section 1 TOTACL Pic X 80 1 TACL...

Page 156: ... Base FRAME Perform 1 LOOP Until EXI Stop Run 1 LOOP Accept FRAME Until F1 Escape SF16 If Termination Status 1 Then Send TOTACL To TACL Reply Code 0 Yields REPCOD TACL Display RESPONSE Accept Escape F1 Reset RESPONSE Clear Input Else Move 1 To FEOJ End If The following commands start the Pathway environment You can store these commands in an OBEY file PATHMON NAME tst NOWAIT PATHCOM IN pathcnfg ts...

Page 157: ...WAY MAXDEFINES 1 SET PATHWAY MAXPARAMS 1 SET PATHWAY MAXPATHCOMS 1 SET PATHWAY MAXPROGRAMS 1 SET PATHWAY MAXSERVERCLASSES 1 SET PATHWAY MAXSERVERPROCESSES 5 SET PATHWAY MAXSTARTUPS 1 SET PATHWAY MAXTCPS 1 SET PATHWAY MAXTERMS 10 START PATHWAY COLD RESET TCP SET TCP MAXREPLY 100 SET TCP MAXTERMS 10 SET TCP PROGRAM SYSTEM SYSTEM PATHTCP2 SET TCP TCLPROG DATA TEST POBJ SET TCP CPUS 2 1 ADD TCP TCP 1 ...

Page 158: ...his application type the following 12 O PWYOBEY Pathway displays startup information here 13 PATHCOM TST RUN TEST TACL Pathway displays the application screen When finished press SF16 instead of entering a request SHUTDOWN WAIT TCP TCP 1 STOPPED EXIT 14 Press F1 after each response to return to input mode ...

Page 159: ...Management DSM Programming Manual and the Event Management Service EMS Manual Overview of SPI and EMS SPI and EMS are two components of the Distributed System Management DSM product group a set of software applications tools and services that facilitates management of systems and networks SPI is a set of procedures associated definition files and programming conventions used for building sending r...

Page 160: ...t Logs EMS Collectors Tokenized Messages 323 EMS Distributors Filter To transport messages between management applications and subsystems you place tokens into a buffer Each token consists of a token type and a token number known collectively as a token code and a token value For example a buffer that contains a Pathway PATHCOM START TCP command would contain the following tokens Token code ZSPI T...

Page 161: ...for each subsystem you want to manage To retrieve event messages you also need the EMS definition file for the subsystem TACL provides built in functions that initialize and manipulate the contents of message buffers To establish communication with a subsystem you use REQUESTER or SERVER with IN set to RECEIVE to establish communication and APPEND V and EXTRACT V to send and receive a buffer respe...

Page 162: ...eves token values from an SPI buffer converts the values to external representation and makes the results available SSGETV Retrieves token values from an SPI buffer converts the values to external representation and makes the results available SSGETV must be used for extensible structured tokens and tokens of type ZSPI TYPE STRUCT SSPUT Converts token values from external representation to binary ...

Page 163: ...CT BEGIN BYTE buffer 1 ZTAC VAL BUFLEN END When you use the definitions supplied by Tandem your code retains compatibility with future changes in length TACL sends the length of the STRUCT to the SSINIT procedure and ignores the rest of the definition Note TACL has a maximum I O buffer size of 5000 bytes and STRUCT variables are also limited to 5000 bytes In addition TACL cannot perform nowaited I...

Page 164: ...be found are given number 255 on input system number 255 is shown as on output The creation time of any unnamed process or the cpu pin of a named process can be accessed only by redefining the fields appropriately ZSPI TDT DEVICE Any valid device name Systems whose numbers cannot be found are given number 255 on input system number 255 is shown as on output ZSPI TDT ENDLIST Not applicable ZSPI TDT...

Page 165: ...TDT TIMESTAMP 2 63 to 2 63 1 ZSPI TDT TOKENCODE 2147483648 to 2147483647 On input a 32 bit STRUCT can be used ZSPI TDT TRANSID A TMF transaction identifier formatted as follows system name crash count cpu sequence If the internal format trans id contains a crash count of zero the transaction ID is formatted as follows system name cpu sequence In either case if the system is not named the transacti...

Page 166: ...fies that the contents of the token map are consistent with the size of the STRUCT in which it is stored External Representation of Token Values Use text instead of binary bits when storing and retrieving token values Legal text characters come from the ISO 8859 1 character set The following lists conditions of data representation If the token length of a token is 255 the token value is of variabl...

Page 167: ...lows you to extract fields from a subsystem ID SECTION template STRUCT BEGIN SSID ss STRUCT z_ssid REDEFINES ss BEGIN CHAR z_owner 1 8 INT z_number UINT z_version END END DEF ss1 STRUCT LIKE template Use the code in Figure 7 1 same_ssid to compare two subsystem IDs returned by SSGETV with ZSPI TKN NEXTCODE or ZSPI TKN NEXTTOKEN The code uses the template STRUCT defined under Defining an SPI Buffer...

Page 168: ...equest I O variable retcode Return code from server ZEMS CMD STATUS ZEMS status command ZEMS VAL EXTERNAL SSID ZEMS subsystem ID zspidef zspidef subvolume arg rslt defs Include SPI and EMS definitions LOAD LOADED defs KEEP 1 system zspidef zemstacl LOAD LOADED defs KEEP 1 system zspidef zspitacl LOAD LOADED defs KEEP 1 system zspidef ztactacl Define the SPI buffer DEF spi_buf STRUCT BEGIN BYTE b 1...

Page 169: ...I UNFRAME RETURN Retrieve the return code and place it into the SPI buffer SETMANY err _ retcode SSGET INDEX 1 spi_buf ZSPI TKN RETCODE IF err THEN OUTPUT Error err from SSGET ZSPI TKN RETCODE UNFRAME RETURN Retrieve EMS status information and place it into the SPI buffer SETMANY err _ SSGETV INDEX 1 spi_buf ZEMS MAP COL STATUS ZEMS DDL COL STATUS IF err THEN OUTPUT Error err from SSGETV ZEMS MAP ...

Page 170: ...ent message buffer so that you can use the STRUCT in calls to other EMSxxx and SSxxx functions EMSGET V Retrieves token values from a buffer converts them to external representation and returns the external representation as its result This function is similar to SSGET SSGET V Retrieves token values from an SPI buffer converts them to external representation and makes the results available Use SSG...

Page 171: ...s taclevent urgency where urgency is 1 for no flag 2 for an action flag and 3 for a critical flag You can use the dumplog routine n Figure 7 2 to display the event log and check your results Figure 7 3 Generating an EMS Event Page 1 of 3 SECTION taclevent MACRO FRAME PUSH evt_x evt_error req_error req_read req_prompt PUSH action_id collector Load the files If the files do not exist TACL returns an...

Page 172: ...MS TKN EMPHASIS ZSPI VAL TRUE IF evt_error THEN OUTPUT ERROR SSPUT error evt_error on Emphasis token RETURN End IF End IF If action is TRUE set the ACTION NEEDED flag IF action THEN SET evt_error SSPUT evt_buf ZEMS TKN ACTION NEEDED ZSPI VAL TRUE IF evt_error THEN OUTPUT ERROR SSPUT error evt_error on Action Needed token End IF SET the action ID token to a unique value SET evt_error SSPUT evt_buf ...

Page 173: ... If open fails display an error message Otherwise send an event message IF evt_error THEN OUTPUT ERROR REQUESTER OPEN error evt_error ELSE CASE 1 1 build_evt 9997 0 0 Test Calm event 2 build_evt 9998 1 0 Test Action event 3 build_evt 9997 0 1 Test Critical event OTHERWISE OUTPUT Invalid argument Must be OUTPUT 1 event OUTPUT 2 action event or OUTPUT 3 critical event Close the Collector SET evt_err...

Page 174: ...Using EMS Using Programmatic Interfaces 7 16 107365 Tandem Computers Incorporated This page left intentionally blank ...

Page 175: ...tors and other device errors The macro ckup uses CHARxxx routines to retrieve information To run this macro load the associated file and enter ckup Portions of ckup require a version of TACL released at C20 or later In addition your TACL process must be named The macro runs as a batch file you start it and it runs through several tests displaying results Rather than placing defines at the start of...

Page 176: ... later replacement in OUTPUT calls PUSH rev end termout SET rev Esc Char_Escape 6 Terminal Control reverse SET end Esc Char_Escape 6 Terminal Control end DEF Tcr text BODY IF termout THEN rev DEF Tce text BODY IF termout THEN end PUSH PMSG turn off PMSG flag SET PMSG 0 IF NOT EMPTY 1 THEN PUSH OUT SET termout 0 IF MATCH p 1 THEN SET OUT s hum ELSE SET OUT 1 end if ELSE SET termout 1 end if Note If...

Page 177: ...ET release C OUTPUT OPSYS release version OUTPUT SYSnn FILEINFO SUBVOL PROCESSINFO PROGRAMFILE 0 0 POP release OUTPUT Display whether configured processors are up or down generalized to run on all systems DEF cpuupordown ROUTINE BODY FRAME PUSH cpucounter cpustatus maxcpus type SET cpucounter 0 SINK ARGUMENT TEXT maxcpus NUMBER cpu count LOOP WHILE cpucounter maxcpus DO SINK ARGUMENT TEXT cpustatu...

Page 178: ... eof pri sec SET filename SYSTEM SYSTEM OPRLOG IF FILEINFO EXISTENCE filename THEN SETMANY eof pri sec FILEINFO EOF PRIMARY SECONDARY filename SET maxext COMPUTE FILEINFO MAXEXTENTS filename 1 SET size COMPUTE eof 100 pri maxext sec 2048 IF termout AND size 100 THEN OUTPUT rev OPRLOG is size percent full end ELSE OUTPUT OPRLOG is size percent full end if ELSE oprlog does not exist end if SET filen...

Page 179: ...E 100 minfreespace percent full OUTPUT _and maxfragments fragments DSAP OUTV dsapout SHORT Remove banner lines from output EXTRACTV dsapout line LOOP WHILE NOT MATCH volume line DO EXTRACTV dsapout line end loop Remove lines with unavailable disks SET addr CHARFIND dsapout 1 unavailable LOOP WHILE addr DO LINEDEL dsapout LINEADDR dsapout addr SET addr CHARFIND dsapout addr unavailable end loop Cop...

Page 180: ...sk pfree line fragments OUTPUT Check specified files for index level growth and for file 90 full DEF lvl MACRO BODY FRAME Check for index level increase growth Syntax LVL filename acceptable_index_level_number Example LVL DATABASE 3 PUSH stats line level eof maxbytes percent OUTPUT Checking 1 SQLCI OUTV stats FILEINFO 1 STAT LOOP WHILE NOT MATCH LEVEL line OR EMPTY stats DO EXTRACTV stats line end...

Page 181: ...lout line banner EXTRACTV spoolout line blank line EXTRACTV spoolout line first collector LOOP WHILE NOT EMPTY line DO SETMANY collector state line SET size CHARGET line 74 FOR 2 IF size 90 THEN OUTPUT hold Tcr collector collector is state OUTPUT _AND is size percent full Tce end if EXTRACTV spoolout line get next collector end loop OUTPUT Checking devices EXTRACTV spoolout line banner with device...

Page 182: ...ile code PUSH eof primary secondary code full SET volok 1 OUTPUT TMF information OUTPUT Collecting TMF status TMFCOM OUTV stat STATUS TMF STATUS VOLUMES EXTRACTV stat line get first status line LOOP WHILE NOT MATCH volume line DO OUTPUTV line EXTRACTV stat line end loop EXTRACTV stat line underscore EXTRACTV stat line first valid status volume line LOOP WHILE NOT EMPTYV stat DO SETMANY vol _ statu...

Page 183: ... if code end if not emptyv UNTIL EMPTYV file end loop POP volok stat line volume vol status file code POP eof primary secondary code full OUTPUT Display disk status Use PUP to get the status Save output in pup_out Loop ignoring blank lines and tokenize each line Display paths in the H D R and S states Display paths that are not P or M the preferred paths Due to the format change of PUP output this...

Page 184: ...0 Hard down Tce R OUTPUT Tcr CHARGET scanline 6 FOR 10 reviving Tce S OUTPUT Tcr CHARGET scanline 6 FOR 10 Special state Tce I OUTPUT Tcr CHARGET scanline 6 FOR 10 Inaccessible Tce OTHERWISE IF CHARFINDV scanline 8 P OR CHARFINDV scanline 8 M accept p or m THEN send a pup listbad command APPEND pupcommand listbad CHARGET scanline 6 FOR 10 end if end case end if charfind end loop POP version scanli...

Page 185: ...disk 0 12 LINEGET pupout 1 for 1 LOOP WHILE linecounter maxlines DO IF MATCH NO LINEGET pupout linecounter for 1 THEN LINEDEL pupout linecounter remove NO BAD SECTORS SET linecounter COMPUTE linecounter 1 SET maxlines COMPUTE maxlines 1 LINEDEL pupout linecounter remove line volume x LINEINS pupout linecounter msg insert structure ELSE Prepare structure for next possible OK disk IF MATCH LINEGET p...

Page 186: ...0 IF MATCH OFF CHARGET scanline 18 FOR 3 THEN OUTPUT 0 logging is OFF OUTPUT end if SET otherdevs 1 LOOP WHILE NOT EMPTYV puplistdev DO EXTRACTV puplistdev scanline SET device CHARGET scanline 65 FOR 4 the IF statement will skip lines with no state device is OK lines with no device number B backups lines with type 3 disk handled in above code lines without a in device name page banners SET state C...

Page 187: ...CHARGET scanline 6 FOR 10 down H OUTPUT CHARGET scanline 6 FOR 10 Hard down R OUTPUT CHARGET scanline 6 FOR 10 reviving S OUTPUT CHARGET scanline 6 FOR 10 Special state I OUTPUT CHARGET scanline 6 FOR 10 Inaccessible OTHERWISE OUTPUT CHARGET scanline 6 FOR 10 state state end case end if end loop end if version 20 POP puplistdev scanline state device otherdevs OUTPUT TIME UNFRAME ...

Page 188: ...Monitoring System Operation Example of a System Management Program 8 14 107365 Tandem Computers Incorporated This page left intentionally blank ...

Page 189: ... of the DELTA character processor UTILS TACL Commands and Functions The following summarizes the syntax of the TACL command interpreter commands and functions ACTIVATE node name process name cpu pin ADD DEFINE define name define name define name LIKE define name attribute spec ADDDSTTRANSITION start date time stop date time offset ADDUSER run option run option group name user name group id user id...

Page 190: ...ce file dest file COPYVAR variable level in variable level out CREATE file name extent size CREATESEG file name DEBUG node name process name cpu pin TERM node name terminal name _DEBUGGER current trace value reason for entry DEFAULT run option run option default names default security default security DELETE DEFINE define name list DELUSER run option run option group name user name DETACHSEG direc...

Page 191: ...IX prefix INLTO variable level JOIN variable level KEEP LIST num variable variable KEYS LIGHTS run option run option ON OFF SMOOTH num sys option ALL BEAT LOAD KEEP num file name file name LOGOFF option option LOGON group name user name group id user id alias password old password new password old password new password new password parameter parameter _LONGEST list _MONTH3 num O BEY command file O...

Page 192: ...u bus param param RELOAD run option run option cpu set cpu set HELP REMOTEPASSWORD node name password RENAME old file name new file name RESET DEFINE attribute name attribute name RUN D program file run option run option param set SEGINFO SET DEFINE attribute spec LIKE define name attribute spec SET DEFMODE ON OFF SET HIGHPIN ON OFF SET INSPECT OFF ON SAVEABEND SETPROMPT SUBVOL VOLUME BOTH NONE SE...

Page 193: ...directory name USERS run option run option range VARIABLES directory name VARINFO variable variable VARTOFILE variable level file name VCHANGE option option variable level string 1 string 2 range VCOPY option option source var range dest var dest line VDELETE option option variable level range VFIND option option variable level string range VINSERT variable level line num VLIST option option varia...

Page 194: ...gh gmt offset ALTERPRIORITY node name process name cpu pin pri APPEND to variable level text APPENDV to variable level from variable level string ARGUMENT option option alternative alternative ASSIGN option option logical unit BACKUPCPU cpu BEGINTRANSACTION BREAKMODE BREAKPOINT variable level state BUILTINS FUNCTIONS VARIABLES CASE text enclosure CHANGEUSER CHANGEDEFAULTS group name user name grou...

Page 195: ...ng COLDLOADTACL COMPAREV string 1 string 2 COMPUTE expression COMPUTEJULIANDAYNO year month day COMPUTETIMESTAMP year month day hour min sec milli micro COMPUTETRANSID system cpu sequence crash count CONTIME timestamp CONVERTPHANDLE PROCESSID integer string INTEGERS process identifier CONVERTPROCESSTIME process time CONVERTTIMESTAMP gmt timestamp direction node name CREATEFILE EXTENT num file name...

Page 196: ...e value DEFINESETLIKE define name DEFINEVALIDATEWORK DELAY csecs DELTA COMMANDS variable level text DEVICEINFO option option device name file name EMPTY text EMPTYV BLANK string EMSADDSUBJECT SSID ssid buffer var token id token value EMSADDSUBJECTV SSID ssid buffer var token id source var EMSGET option option buffer var get op EMSGETV option option buffer var get op result var EMSINIT option optio...

Page 197: ...e level FILEGETLOCKINFO option fvname control lockdesc participants FILEINFO option option file name FILENAMES option option file name template FILTER exception exception FRAME GETCONFIGURATION option option GETPROCESSSTATE option option GETSCAN HELPKEY HIGHPIN HISTORY option option HOME IF NOT numeric expression enclosure IN INFORMAT INITTERM INLINEECHO INLINEEOF INLINEOUT INLINEPREFIX INLINEPROC...

Page 198: ...EDEL variable level line addr 1 FOR line count TO line addr 2 LINEFIND EXACT variable level line addr text LINEFINDR EXACT variable level line addr text LINEFINDRV EXACT variable level line addr string LINEFINDV EXACT variable level line addr string LINEGET string line addr 1 FOR line count TO line addr 2 LINEGETV string variable level line addr 1 FOR line count TO line addr 2 LINEINS variable lev...

Page 199: ...OUT OUTFORMAT OUTPUT option option text OUTPUTV option option string PARAM param name PAUSE node name process name cpu pin PMSEARCHLIST PMSG POP variable variable PREFIX PROCESS PROCESSEXISTS node name process name cpu pin PROCESSFILESECURITY PROCESSINFO option option node name process name cpu pin PROCESSORSTATUS node name PROCESSORTYPE BOTH NAME node name process name cpu pin cpu num PROMPT PURG...

Page 200: ...ED SEGMENTCONVERT FORMAT a b old file name new file name SEGMENTINFO option option segment id SEGMENTVERSION file name SERVER option option server name SET option option variable level text built in variable built in text SETBYTES destination source SETCONFIGURATION option option tacl image name SETMANY variable name list text SETPROCESSSTATE SETPROCESSSTATE LOGGEDON TSNLOGON STOPONLOGOFF PROPAGAT...

Page 201: ...ken map struct SSPUT option option buffer var token id token value token value SSPUTV option option buffer var token id source var STOP option option node name process name cpu pin text SUSPENDPROCESS node name process name cpu pin SWITCH SYSTEM node name SYSTEMNAME system number SYSTEMNUMBER node name TACLOPERATION TACLSECURITY TACLVERSION REVISION TIMESTAMP TOSVERSION node name TRACE UNFRAME USE...

Page 202: ...Built In Functions and Variables Syntax Summary 9 14 107365 Tandem Computers Incorporated WAIT variable level variable level WAKEUP WIDTH ...

Page 203: ... structured variables DEF variable STRUCT BEGIN declaration declaration END LIKE structure identifier type identifier VALUE initial value type identifier lower bound upper bound VALUE initial value STRUCT identifier lower bound upper bound BEGIN declaration declaration END LIKE structure identifier FILLER num type identifier lower bound upper bound REDEFINES previous identifier ...

Page 204: ...ET ERRORNUMBERS n n n n SET EXIT num SET HELPKEY key name SET HIGHPIN OFF ON SET HOME directory SET IN file name SET INFORMAT PLAIN QUOTED TACL SET INLINEECHO num SET INLINEOUT num SET INLINEPREFIX prefix SET INLINETO variable level SET INPUTEOF num SET INSPECT OFF ON SAVEABEND SET MYTERM home term SET OUT file name SET OUTFORMAT PLAIN PRETTY TACL SET PARAM param name param value SET PMSEARCHLIST ...

Page 205: ... file for output xFC Lowercase lines y xFC Lowercase characters x FC Uppercase lines y x FC Uppercase characters FEvar Test variable level for emptiness FFvar Get frame number of variable level xFGvar Compare lines to variable level y xFGvar Compare range to variable level FL Get length from last I or S operation FOvar Pop variable FTvar Get variable type xFTvar Set variable type FUvar Push variab...

Page 206: ... Type text xUvar Unload x into variable level y xUvar Unload x into variable level xV View lines x V View lines and show end xXvar Extract lines to variable level y xXvar Extract characters to variable level xY Read lines Z Get buffer size Convert number in text to value in X x Put x in text Exit from macro Condition NOT condition End condition Move X into Y Clear X and Y Get current position Disp...

Page 207: ...n Programmer s Guide provides programming information for a D series operating system The System Procedure Calls Reference Manual describes syntax and programming considerations for D series procedures The System Procedure Errors and Messages Manual describes error codes system messages and trap numbers for C series and D series procedures The D series System Migration Planning Guide contains plan...

Page 208: ...s options Influence on Examples in This Manual Examples listed in this manual run on D series software without modification Refer to the guidelines in Section 1 An Overview of TACL for steps to perform before running the examples Communicating With a CMON Process Section 5 Initiating and Communicating With Processes contains an example that illustrates communication with a CMON process If you comm...

Page 209: ... the variable _COMPLETION to access completion information Because a D series PIN does not fit into a CRTPID field D series TACL uses a new structure for completion information The TACL product provides C series compatibility by continuing to support the use of _COMPLETION In previous releases TACL saved STOP 5 and ABEND 6 messages in the variable _COMPLETION if it existed TACL defines _COMPLETION...

Page 210: ...tion code INT z termination code INT z killer craid REDEFINES z termination code SSID z subsystem PHANDLE z killer INT z termtext len STRUCT z procname BEGIN INT zoffset INT zlen END INT z flags INT z reserved 0 2 STRUCT z data BEGIN CHAR byte 0 111 END STRUCT z termtext REDEFINES z data BEGIN CHAR byte 0 111 END STRUCT z procname REDEFINES z data BEGIN CHAR byte 82 193 END END _completion procdea...

Page 211: ...N process to one of these interfaces you must use a process handle in place of a process identifier CRTPID The D series TACL product recognizes a new data type called PHANDLE process handle for STRUCT variables TACL uses ten unsigned integers separated by periods to represent a process handle in external form as returned by SSGET or OUTVAR Each integer can range from 0 to 65535 Use this external f...

Page 212: ...0 to 65535 A null process handle consists of ten integers each of which has the value 65535 A new built in function CONVERTPHANDLE converts process file identifiers to process handles and process handles back to process descriptors A new built in function SPIFORMATCLOSE closes the template file defined in _EMS_TEMPLATES so that you can open a new template file ...

Page 213: ...e process that receives the break on device message when the BREAK key is pressed The establishment of BREAK ownership is achieved using SETPARAM function 3 or SETMODE function 11 breakpoint A location or point in a program where execution is to be suspended so that you can then examine and perhaps modify the state of the program You can set and clear breakpoints with _DEBUGGER commands built in A...

Page 214: ...nsactions cannot continue because they are each waiting for the other to release a lock default process The process whose name is returned by the PROCESS function It is the process most recently created by a RUN or RUND command an implied RUN or a NEWPROCESS built in function or for which TACL was most recently paused by a PAUSE proc spec command or a PAUSE proc spec built in function if that proc...

Page 215: ...and other expressions with operators Expressions are used as arguments to commands and built in functions extended data segment One or more consecutive absolute segments that are dynamically allocated by a process extensible data segment An extended data segment for which swap file extents are not allocated until needed extent A contiguous area of a disk allocated to the same file fault tolerance ...

Page 216: ...arance of the function name and its arguments at the point where the result of the function is wanted A built in function is hard coded into TACL users can define other functions Variable types for functions include TEXT MACRO and ROUTINE GMT See Greenwich mean time godmother See job ancestor Greenwich mean time GMT The mean solar time for the meridian at Greenwich England Gregorian date A date sp...

Page 217: ...gical device A logical device number can be used instead of a device file name when opening a device file LST See local standard time macro A named sequence of one or more instructions invoked by the appearance of the macro name When a macro is invoked TACL replaces arguments of the form n with actual arguments passed to it and returns as a result the instructions that define the macro including a...

Page 218: ...f contiguous data page mode A mode of communication between a terminal and its I O process in which the terminal stores up to a full page of data 1 920 bytes in its own memory before sending the page to the I O process Contrast with conversational mode PAID See process access ID PARAM An association of an ASCII value with a parameter name made by the TACL PARAM command You can use PARAMs to pass p...

Page 219: ...st be alphabetic process pair Two processes created from the same object file running in a way that makes one process a backup process of the other in case of failure Periodic checkpointing ensures that the backup process is always ready to take over from the primary if the primary process should fail The process pair has one process name but each process has a different process identification num...

Page 220: ...es acts upon and replies to messages from requesters Contrast with requester shared data segment An extended data segment that can be accessed by more than one process simple data item A STRUCT item that contains a single value of a specific type space separated list A list whose entries are separated from each other by a space Several built in functions accept space separated lists of values star...

Page 221: ...d it stops terminal simulation process A process that is made to behave like a terminal file text A set of characters from the ISO 8859 1 character set The length of text can be limited by a specific function or command TACL interprets a text argument as all remaining text on the line with leading and trailing spaces and end of line characters removed timekeeping A function performed by the operat...

Page 222: ...nning of a variable level with the EXTRACT and EXTRACTV functions and can be added to the end of a variable level with the APPEND and APPENDV function variable type The designation MACRO DELTA STRUCT TEXT and so on of a variable level that describes its contents and the use for which it is designated virtual memory A range of addresses that processes use to reference real storage where real storag...

Page 223: ...N command 5 3 ATTRIBUTENAME argument alternative 3 3 B BREAK for debugging 2 32 Bubble example 2 3 Built in functions for data manipulation 2 16 for EMS 7 12 for string manipulation 2 10 APPEND 2 3 2 17 4 2 5 1 5 5 5 16 5 31 APPEND V 7 3 APPENDV 5 37 ARGUMENT 3 1 BREAKMODE 3 30 CASE 2 4 2 34 3 25 CHANGEUSER 2 28 CHARCOUNT 2 11 3 10 CHARFINDV 2 12 3 10 CHARGET 2 12 2 28 3 9 CHARINSV 3 11 COMPAREV 4...

Page 224: ...R 3 22 3 25 3 32 FRAME 2 3 2 8 5 4 IF 2 4 2 8 INFORMAT 2 23 INLINEECHO 5 7 INLINEEOF 5 7 INLINEOUT 5 9 5 11 INLINEPREFIX 5 7 INLINETO 5 9 INPUT 2 17 3 22 3 32 INPUT V 7 5 INPUTEOF 2 27 3 28 6 2 6 3 INPUTV 2 5 2 27 2 30 3 28 6 4 6 5 INTERPRETJULIANDAYNO 2 23 INTERPRETTIMESTAMP 2 23 JULIANTIMESTAMP 2 18 2 23 LINECOUNT 2 11 2 15 LINEFINDV 2 11 5 19 LOGOFF 2 30 LOOP 2 3 2 15 3 8 MATCH 2 5 3 22 6 2 MOR...

Page 225: ... 32 RESET FRAMES 2 8 REST 3 5 3 16 RESULT 3 8 3 15 RETURN 3 17 ROUTINENAME 2 7 3 9 3 16 SERVER 5 1 5 31 6 5 7 3 SET 2 3 2 16 SETMANY 2 23 3 27 SHIFTSTRING 2 5 3 16 4 16 6 2 SSGET V 7 5 SSINIT 7 5 SSNULL 7 5 SSPUT V 7 5 7 13 SYSTEM 2 29 SYSTEMNUMBER 3 16 TACLSECURITY 5 35 TIMESTAMP 2 18 2 22 TOSVERSION 8 3 UNFRAME 2 8 5 4 USERNAME 2 28 WAIT 4 10 5 16 Built in functions description or example of Bui...

Page 226: ... programs 2 32 ASSIGN 5 3 FILETOVAR 2 16 for data manipulation 2 16 for global editing 2 13 INLPREFIX 5 7 PARAM 5 3 RUN 5 2 6 1 SETPROMPT 2 29 SINK 2 30 SYSTEM 2 29 TIME 8 13 VCHANGE 2 14 VDELETE 5 19 VFIND 2 14 VINSERT 2 13 VLIST 2 14 _COMPAREV 2 5 _CONTIME_TO_TEXT_DATE 8 3 _MONTH 2 19 Command_processor example 3 21 Completion code 5 33 A 3 Completion information processing 5 32 34 A 3 Completion...

Page 227: ...7 Distributed System Management See DSM DSM and TACL 7 1 Dumplog example 7 10 E Editing commands 2 13 Editing variables 2 11 Emptyspool example 5 11 EMS and TACL 7 1 15 calling EMSDIST 7 12 flags 7 13 generating an event 7 13 log displaying contents of 7 10 Enquiry example 5 35 ENQUIRY facility 5 35 Escape sequences for terminals sending 2 25 Event Management Service See EMS Example call_getargs 3...

Page 228: ...35 fcomp 4 12 fup2 5 18 fupin 5 17 getdates 2 23 inline_fup 5 7 inline_fup_log 5 10 inline_fup_log2 5 11 lock 2 28 menu 2 30 monitoring a system 8 1 nowaited_read 4 4 nowaited_write 4 9 Pathway 6 6 purgefiles 3 22 report_shell 3 15 restricted_caller 3 30 restricted_cmd_processor 3 24 restrictive_command_shell 3 26 running 1 1 runsrv 6 3 same_ssid 7 9 script 5 8 send 5 22 serv 5 30 show_spooler_job...

Page 229: ...9 Exception handlers description of 3 18 Exception definition of 3 18 EXCLUSION option for REQUESTER built in function 4 2 F Fcomp example 4 12 FILENAME argument alternative 3 3 Files opening 4 1 reading from 4 2 5 writing to 4 6 9 FILETOVAR command 2 16 Function keys defining 2 24 Functions built in See Built in functions Fup2 example 5 18 Fupin example 5 17 G Getargs example 3 11 Getdates exampl...

Page 230: ... 10 Inline_fup_log2 example 5 11 INLPREFIX command 5 7 INV option limitations 5 20 INV option RUN and NEWPROCESS NEWPROCESS INV variable 5 1 J Julian day number 2 17 Julian timestamp 2 17 K KEYWORD argument alternative 3 3 L Local civil time LCT 2 17 Local daylight time LDT 2 17 Local standard time LST 2 17 Local timestamp 2 17 Lock example 2 28 M Macros overview 2 1 Menu example 2 30 N Nesting co...

Page 231: ...5 3 Pathway example 6 6 Process handles A 5 Processes initiating and communicating with 5 1 initiating and communicating with 5 37 stopping 5 20 PROCESSNAME argument alternative 3 3 Programs debugging 2 32 defining structure of 2 2 exiting 3 17 style conventions of 1 2 Prompts setting 2 29 Purgefiles example 3 22 R Reading from a file nowaited 4 4 waited 4 2 Recursion in macros and routines 2 7 Re...

Page 232: ... 14 Run options INLINE 5 6 STATUS 5 16 Runsrv example 6 3 S Same_ssid example 7 9 Script example 5 8 Send example 5 22 Serv example 5 30 Server programs testing 5 25 Server TACL as a 6 1 12 SETPROMPT Command 2 29 Show_spooler_jobs example 5 19 SINK command 2 30 SLASH argument alternative 3 3 SPI and D series software A 5 and TACL 7 1 12 buffers 7 5 definition files 7 4 messages 7 3 subsystem ID 7 ...

Page 233: ...Structures accessing structured data 5 25 examples 5 25 SUBSYSTEM argument alternative 3 3 Subsystem ID 7 5 Subsystem Programmatic Interface See SPI Syntax summary built in functions and variables 9 6 14 STRUCT declarations 9 15 DELTA commands 9 17 SET built in variable 9 16 17 UTILS TACL commands and functions 9 1 6 SYSTEM command 2 29 T TACL D series features A 1 programs nesting 2 7 running as ...

Page 234: ...ernative 3 3 V Variable levels using 2 3 variable INV 5 1 OUTV 5 1 _COMPLETION 5 32 VARIABLE argument alternative 3 8 Variables creating modifying 2 9 types 2 1 Variables editing 2 11 VCHANGE command 2 14 VDELETE command 5 19 VFIND command 2 14 VINSERT command 2 13 VLIST command 2 14 Volname example 2 12 Volnames example 2 15 W WAIT option for REQUESTER built in function 4 2 Waited_read example 4 ...

Page 235: ...ilt in funcion See Built in functions built in variable See Built in variables CMON 5 25 A 2 RECEIVE 5 1 5 5 7 3 and TACL as a server 6 1 using for process communication 5 21 29 0 using to call a macro recursively 2 7 _COMPLETION variable 5 32 _COMPAREV command 2 5 _COMPLETION PROCDEATH variable A 3 _CONTIME_TO_TEXT_DATE command 8 3 _DEBUGGER commands 2 32 _MONTH function 2 19 _PROMPTER 2 29 ...

Reviews: