631010000 COM TERM=104308003073 LCG/I=00/079 CG=63090009 CD=63010000 U#=TEST1 M000 *** YOU ARE ON PROCESSOR 34, TIME SHARING MAY BE UNSTABLE *** M000 EXPANDED CLUSCON RUNNING AT T/S, 'Q/R' CAN'T BE BOOTED M000 *** NEW LOADER AT T & S LEVEL, PROBLEMS CALL X-4704 *** USED 1.93 UNITS CAT SAVED FILES, USER NUMBER EZ99550 04/23/90 TIME02:28EDT B 900420 COMPARE 900420 MCHO19 900420 TALKER.Z 900421 TALKER 900421 A 900420 L 900422 LOG 900422 READY LIS A user does not have read access, cannot list READY LIS L L 02:29EDT 04/23/90 READY LIS B user does not have read access, cannot list READY LIS MCHO19 MCHO19 02:29EDT 04/23/90 1 *BUG REPORT: 03/28/90 READY CAT SAVED FILES, USER NUMBER EZ99550 04/23/90 TIME02:29EDT B 900420 COMPARE 900420 MCHO19 900423 TALKER.Z 900421 TALKER 900421 A 900420 L 900423 LOG 900422 READY RUN TALKER.Z TALKER.Z 02:29EDT 04/23/90 L 5 ch 5: Syntax error, character is $ (octal 044). L 90 ch 8: Syntax error, character is = (octal 075). L 100 ch 9: Syntax error, character is = (octal 075). L 110 ch 9: Syntax error, character is = (octal 075). L 120 ch 9: Syntax error, character is = (octal 075). L 130 ch 9: Syntax error, character is = (octal 075). L 140 ch 9: Syntax error, character is = (octal 075). L 150 ch 9: Syntax error, character is = (octal 075). L 160 ch 9: REAL Subexpression appears in LOGICAL context. L 170 ch 9: REAL Subexpression appears in LOGICAL context. L 220 ch 4: No label, statement(s) inaccessible. L 220 ch 9: Syntax error, character is = (octal 075). L 230 ch 9: Syntax error, character is = (octal 075). L 250 ch 4: No label, statement(s) inaccessible. L 250 ch 9: REAL Subexpression appears in LOGICAL context. L 260 ch 9: REAL Subexpression appears in LOGICAL context. L 270 ch 9: REAL Subexpression appears in LOGICAL context. L 300 ch 4: No label, statement(s) inaccessible. L 300 ch 5: Syntax error, character is ' (octal 047). L 320 ch 4: No label, statement(s) inaccessible. L 320 ch 5: Syntax error, character is ' (octal 047). L 340 ch 4: No label, statement(s) inaccessible. L 340 ch 5: Syntax error, character is ' (octal 047). L 370 ch 4: No label, statement(s) inaccessible. L 370 ch 9: REAL Subexpression appears in LOGICAL context. L 400 ch 5: Syntax error, character is ' (octal 047). L 410 ch 5: Syntax error, character is ' (octal 047). L 420 ch 9: REAL Subexpression appears in LOGICAL context. L 450 ch 5: Syntax error, character is ' (octal 047). L 460 ch 5: Syntax error, character is ' (octal 047). L 480 ch 4: No label, statement(s) inaccessible. L 480 ch 9: REAL Subexpression appears in LOGICAL context. L 500 ch 4: No label, statement(s) inaccessible. L 500 ch 15: CHARACTER Subexpression appears in LOGICAL context. L 505 ch 5: Syntax error, character is ' (octal 047). L 510 ch 5: Syntax error, character is ' (octal 047). L 520 ch 5: Syntax error, character is ' (octal 047). L 530 ch 5: Syntax error, character is ' (octal 047). L 540 ch 5: Syntax error, character is ' (octal 047). L 550 ch 9: REAL Subexpression appears in LOGICAL context. L 600 ch 4: No label, statement(s) inaccessible. L 600 ch 9: Syntax error, character is = (octal 075). L 620 ch 4: No label, statement(s) inaccessible. L 620 ch 5: Syntax error, character is ' ( USED 7.30 UNITS RUN TALKER ZAP 02:30EDT 04/23/90 ZAP is owned and maintained by GEISCO UK Ltd. Align paper to top of form if necessary. Standby for 12 pages of documentation ( requires 120 columns ) . Hit carriage return for listing or break to terminate. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO XXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXX XXXX XXX OOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOO OOO OOOO OOO XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXX XX XXX XXX XXX OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OO OOO OO OOO OOO OOO XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXX XX XXX XXX XXX OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOO OOO OO OOO OOO OOO XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XX XXXX XXX OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOO OO OOOO OOO XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXX XX XXXXXXX XXX OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO OOO OO OOOOOOO OOO XX XXXXX XXXXX XXXXXXXXXXX XXXXXX XXX XX XXXXXXXXXXXX OO OOOOO OOOOO OOOOOOOOOOO OOOOOO OOO OO OOOOOOOOOOOO XX XXXXX XXXXX XXXXXXXXXXX XX XXX XX XXXXXXX XXX OO OOOOO OOOOO OOOOOOOOOOO OO OOO OO OOOOOOO OOO XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOO XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO Introduction ============ ZAP is an F77 program which acts like a super CMF facility. The program functions as an interpreter for a file of ZAP statements; the syntax of which is simple yet very powerful. The interpreter has the ability to manipulate a limited set of string variables, carry out assignments, evaluate IF tests and act on GOTO's. It can also perform terminal and file I/O and execute variable system commands and its own set of macros. The ZAP statements are interpreted from a line numbered ascii file, the logic flow being determined by the statements just as in other programming languages. This interpretive approach enables an easy yet flexible method to be adopted whilst writing statements. Via a suitable AFN ZAP can be made 'User invisable' and the zap file executed directly. The user interface to the zap file is catered for by allowing uo to twenty-six paramters to be set at 'slash time'. Illustation ----------- Two very simple zap file examples to illustrate the simplicity and power of the ZAP syntax. The first GREET , simply displays an appropriate salutation by testing the hour derived from the F77 CLK function. 10 A=$clk \* assign the time to a string variable A 20 A=A(:2) \* only the first two characters needed 30 B='grief!' \* assign default response 40 if(A<'08')goto 80 \* assign appropriate 50 if(A<'12')B='morning' \ goto 80 \* response dependent 60 if(A<'17')B='afternoon' \ goto 80 \* upon the hour 70 if(A<'22')B='evening' 80 !DISP ' ... Good 'B \* use macro to display concatenated message This file is then executed with "/EURO:ZAP GREET" and if the time is 10:30 will yield ... Good morning The second example CATNTS simply edi cats an mds file first creating it if it does not already exist. 10 IF('.A.B.C.')GOTO 30 \* IF FILE .A.B.C. EXISTS GOTO TO STATEMENT 30 20 CRE .A.B.C.,,BIN \* SYSTEM COMMAND TO CREATE FILE 30 MDS .A.B.C. \* SYSTEM COMMAND TO MDS INTO FILE 40 EDI CAT .A.B.C.;NAM,TYP,SIZ \* SYSTEM COMMAND TO EDI CAT This file is executed with "/EURO:ZAP CATNTS" . Except for line 10 this could be a CMF file - but this line enables a test to be made to determine if a specific file exists and to act on the result. Zap syntax ============ Definitions ----------- o Items Characters Any of the ASCII character set. o Constants Numeric Integers composed from the digits 0123456789. Text Any character EXCEPT '. Text constants are contained within quotes ' '. e.g. 'This is a text constant' This is not'. Line Numeric constants in the range 1-99998 numbers = o Variables String 26 off denoted by the set A-Z or the synonymous set a-z, ZAP is case blind. Initialised to null they may contain 0-4095 characters. o Statements Of the form line number, blank[s], character[s]. Note there must be AT LEAST one space between the line number and the characters, and the line numbers must be in ascending order. o Delimiter \ Between statements on the same line in a zap file or between parameters passed to ZAP at execution. o Zap file A line numbered ASCII file containing statements. It may be a saved file with read permission or the current file. o Parameters Characters delimited by '\' passed as variables to a Zap file when executed. Notation -------- o Square brackets [ ] Used to surround a portion of a statement(s) which is optional.The part enclosed must be included in its entirety. o Curly brackets { } Used to enclose a set from which you must select one element. The enclosed items are stacked vertically. o Ellipsis ... Indicates that the immediately preceding item(s) may be repeated any number of times. o Blank b Used to denote a blank space. o Integer n or m Denotes a numeric constant. o Text t Denotes a text constant o Variable v Denotes a string variable A-Z . o Text variable combination tv... Denotes a concatenation of text and/or variables. o Line number l In the range 1 - 99998 = o Statement s A statement or series of statements delimited by \ . o Character c Denotes a single character. Statement syntax ---------------- o STOPb[{n}] [{tv...}] Where n is { 0 1 2 } . With n=0 or t='' a normal stop with the message 'Stop @ l'. with n=1 normal stop without message with n=2 Zap aborts. with tv... yields a message of tv... . o * Comment - appears as the first none b character after an l or \ the REMAINDER of that line is then taken to be comment and ignored. o GOTOb{l} {v} Where l must exist in the Zap file; or v must contain a similar l. o ASSIGNMENT v={tv...} {v[([n]:[m])]} n.b. 1<=n<=m<= the length of v. Examples A='This is the letter A' A=B \ C=D(5:) \ E=F(:3) \ G=H(4:9) I=ACF \ J='J CONTAINS 'J \ C=' A & B are 'A' ' B'.' Use the appropriate F77 functions/routine to { $UNO } return the current user number into v { $DAT } " " " date into v { $CLK } " " " time " " { $PID } " " " pid " " o INTERPRETIVE v Single variable which will be converted to characters and then executed. o IF{(tv...)s} Where tv... evaluates to a filename - if the file exists then s is executed - if not control passes to the next line numbered s. {( tv... L tv... )s} Where L is one of { = , > , <, { <= } , { >= } , { <> } } { =< } , { => } , { >< } and tv... may NOT contain any of the characters '()=<>' . If the logical expression is true then s is evaluated else control passes to the next line numbered statement. Examples IF(A)C=' The file 'A' exists' \ goto 77 if('go02090:zap')DES GO02090:ZAP;P IF(A='a')A=' A contains 'A IF('BbbB'<>Z)goto 99 if(S<=F)stop s' is less than or equal to 'f o Macros ------ !ccccb[{tv...}] This is a library of Zap commands.It includes I/O - [{s}] for both terminal and file - , diagnostic trace facilities, parsing variables and enabling/disabling errors and breaks. ** Note the mandatory blank and ! as first character ** !DISP [tv... ] Display text and/or variable concatenation e.g. !DISP 'This is a display of the contents of A'A !PRCH Change the prompt character from its default of '>' to the composite symbol '[]' and facilitate underlining of input. N.B. can ONLY be used on terminals which have a none printing backspace character. !PRMT [tv...];v[;n] Prompt for input with the text and place the response in the variable v. The optional [;n] can ONLY be used AFTER using !PRCH and defines the number of underlines required . n.b. 0<=n<=41. e.q. !PRMT 'What did you say';R Produces What did you say> and !PRCH \ !PRMT 'Eh?';R;4 yields Eh?[]____ !INPF tv... Chain to a new Zap file denoted by tv... and abandon the current Zap file. N.B. on completion of the Chained to Zap file ZAP will NOT return to the calling file. !OUTF [{tv...}] Prepare to output to a line numbered ASCII file. If the file exists append to it incrementing line numbers by 10. If the file does not exist create a new one. If tv... is omitted a session file is created named SFL:.ZAP.ZAP . Following this command ALL subsequent lines in the Zap file will be regarded as tv... and output to the file UNLESS they commence with '!' as the first none b character following the line number. Only one file may be open at a time. !CLSF Close and save the output file. WARNING, if this is not done before the Zap file terminates then the !OUTF file may be lost. N.B. after an !OUTF a !CLSF must be issued before a second !OUTF. !SUSF Suspend output to the file.This allows the processing of none Macro statements. !RESF Resume output to the file. !FLOW Print out each statement as processed together with the results of assignments and ifs. !WOLF Turn off the trace (default). !EBRK Enable the break key - pressing will then result in ZAP terminating (default). !DBRK [s] Disable the break key - if s is not used then pressing the key will result in BRKDIS. If s is used then it will be executed ONLY when the break key is depressed. !EERR Enable the fatal run time error trap - results in ZAP termination (default). !DERR s Disable the fatal run time error trap - and if encountered ( or a system command failure ) execute s. N.B. s is mandatory with this statement. !PARS v1cv2 Equivalent to CALL GETSTR(v1,'c',v2). Where c is any character EXCEPT \ ' or b. With v1 and v2 different variables. !UPCb v Uppercase the contents of v. N.B. the b is mandatory. !LWCb v Lowercase " " o SYSTEM COMMANDS {ccc...} In the event of a statement not being one of the preceding statements {t{tv...}} ZAP will attempt to interpret it as a system command. {v} Examples:- DES MYFILE direct system command. !PRMT 'File';F \ 'DES 'F evaluated system command n.b. text constant first. !PRMT 'File';F \ C='DES 'F \ C single variable contains system command. but with D='DES ' \ S='MYFILE' \ M=';P' then DSM will NOT be interpreted as DES MYFILE;P but as the system command DSM - data storage mode.Thus variable concatenation is NOT allowed with this statement UNLESS the first item is a text constant. e.g. 'DES 'SM will be interpreted as DES MYFILE;P. Using !DERR s a system command failure can be trapped - see CMD. Error Processing ================ On processing the Zap file if ZAP detects an error then it will abort with the message s ^ >>> syntax error @ line no. l 'some messsage' >>> Zap aborted! Since ZAP is an interpreter it will be appreciated that statements may be dynamic thus syntax checking can only be sensibly carried out just prior to execution of each statement. Also there may be conditions which a statement will be valid but with other data produce a syntax error. Some General Comments. ====================== A STOP statement is not mandatory and if omitted ZAP will automatically append a line 99999 STOP 1 . Statements are not restricted to one per line but obviously they are ignored after a STOP, GOTO or * . For legibility it is suggested that ZAP syntax be in lower case with variables in upper case. It is STRONGLY recomended that you first /-n EURO:ZAP on any file you may write and incorporate a !FLOW option for debugging. A zap file may conatin lines of a maximum of 158 characters. By executing ZAP from within a zap file 'nesting' can be accomplished. Execution of ZAP ================ In the following examples is is assumed that 'EQU ZAP EURO:ZAP NO' is in effect. If 'RUN ZAP' is attempted then this file EURO:ZAPINFO is listed and the program terminated. The slash interface ------------------- /EURO:ZAP will yeild the prompt Filename[\parameter[s\]]> A Zap filename MUST be supplied , [CR] is permissable to indicate that the current file is to be used; obviously this cannot be done if ZAP is RUN. The parameters are characters delimited by \ to which the Zap variables are initialised. The first initialises the variable A ,the second B and so on through to the twenty-sixth Z. Examples:- /ZAP Filename[\parameter[s\]]>MYFILE Take the statements from MYFILE and intialise all the variables to null. With /ZAP \ or /ZAP Filename[\parameter[s\]]>[CR] The current file is used - with all the variables initialsed to null. also /ZAP ZFL\an apple\\THE SEA Use the zap file ZFL set A='an apple' and C='THE SEA' and remaining variables to null. and /ZAP \\\\A DEAL Use the current file set D='A DEAL' and the other variables to null. Direct execution of a Zap file ------------------------------ A more sophisticated execution of ZAP is possible by using an AFN. ZAP can recognise when it is being executed via a AFN and in such cases will default to a specific ZAP file based on the AFN. The rules are quite simple the AFN discrimination is limited to a maximum of SIX characters and the ZAP file is derived from the AFN plus the suffix '.Z' . If the AFN is of more than six characters then the zap file is composed of the first six and '.Z' . ! There is one AFN which is EXCLUDED from this rule 'ZAP' . Thus the equate ! ! EQU ZAP EURO:ZAP NO ! ! and the subsequent execution of ZAP will NOT ACTIVATE the zap file 'ZAP.Z' ! the program will function just as if EURO:ZAP was executed. To illustrate:- COPY GREET TO GREET.Z and then PURGE GREET EQU GREET EURO:ZAP NO /GREET this will execute the first example. This facility enables the "direct" execution of zap files Notice there is NO prompt for the zap file parameters - if not supplied they will default as usual to null. To summarise:- NEW ANAFN.Z 10 ....... build zapfile 20 .... etc SAV equ ANAFN EURO:ZAP no /ANAFN [parameter[s\]] .... Zap will then expand this to /EURO:ZAP ANAFN.Z[\parameter[s\]] Three further ZAP file examples ================================= The first CMD , is a macro allowing any system command commonly applied to a file name to be expanded to handle a list of filenames. LISTNH CMD.Z 05 !DERR goto 200 \* set command error trap 10 if ( D <> '*' ) D='!DISP E' \* set toup default display commands 20 if(A='')!prmt 'Cmd';A \* prompt for command if not supplied 25 \* on execution and store in A 30 G=A(:3) \* get 1st three characters of command into G 40 !UPC G \* upper case G 50 H='*' \ I=' not ' \* set defaults if not CRE command 60 if ( G = 'CRE' ) H='goto 150' \ I='' \* if CRE set alternative 70 if ( B = '' ) !prmt 'Options';B \* prompt for options if not supplied on execution 75 \* and store in variable B. 80 if ( C = '' ) !PRMT 'File(s)';C \* ditto file list into C 90 if ( C = '') stop 1 \* terminate when file list empty 100 !PARS C;F \* parse files off list in C by ';' into F 110 H \* either 'goto 150' if CRE or '*' if not 120 if ( F ) goto 160 \* if file F exists goto 160 130 !DISP FI'saved!' \* display appropriate message 140 goto 90 \* get next file 150 if ( F ) goto 130 \* CREating so file should NOT exist - display message 160 E=A' 'FB \* concatenate command line into E 170 D \* defaults to displaying command else '*' 180 E \* interpret command and execute 190 goto 90 \* get next file from list 200 stop D' INVALID!' \* command error abort then with EQU CMD EURO:ZAP NO execution of /CMD CRE\,,\JIM;FRED;BILL . . . ^ missing 4th parameter D initialised to null . . . file list parameter C note files delimited by ';' for parsing . . parameter B - options note parameters delimited by '\' . Command parameter A This will produce:- CRE JIM,, CRE FRED,, CRE BILL,, and /CMD CLA\ W\JIM;FRED;BILL\* will CLAssify the CREated files with Write and append access supressing the display of the executed commands. The second example is in REVAMP a utility for FORSE*** ing and listing or printing a number of Fortran source files. It is suggested that it is first used thus /REVAMP * or /REVAMP *\* (if you have the right terminal ) and execute this file , REVAMP.Z :- 05 IF(A='*')!FLOW 07 IF(B='*')!PRCH 10 G='GOTO 20' 12 c=' File list' 20 !PRMT C;h 21 C=' Another file' 22 I=IH 24 !pars i;F 30 IF(F='')GOTO 90 40 IF(F)GOTO 62 50 !DISP '>>> 'F' does not exist!' 55 G 60 STOP 1 61 *forse current file 62 'OLD 'F 64 '/FORSE*** 'F';XFORSE;NORM' 68 OLD XFORSE 70 'REP 'F 79 L=L';'F 80 GOTO 24 90 L=L(2:) 95 PURGE XFORSE 100 !PRMT 'Output file';F 105 IF(F<>'')E='('F');' 110 '/EURO:LIST 'L';'E'/H,L(120)' 125 IF(F='')STOP 1 130 IF(F)GOTO 150 135 G='*'G 140 GOTO 50 150 'PRINT 'F';ANLTID;NONE' Note that the new file from FORSE*** replaces the existing file - lines 68-72. The messages from FORSE*** could have been switched off with OPTION TTY OFF/ON at lines 63 & 65. If the response to the request for an output file is (return) then the input files are listed at the terminal and REVAMP terminated. If a file is supplied however this is PRINTed for a later HSS session. WARNING: REVAMP uses a scratch file for the FORSEd output named XFORSE . This file is used to replace the orignal file(s) and the finally PURGEd. The final example allows you to extract any of the previous examples painlessly from this file. It is executed with /EURO:ZAP \example1,example2... and is as follows:- 10 if(a='')!prmt 'Zap example(s comma delimted) ';A 30 if(A='')stop B' zap example(s) extracted' 40 !pars A,E 50 !upc E 60 i(e='greet')goto 110 70 if(E='catnts')goto 110 80 if(e='cmd')goto 110 90 if(e='REVAMP')GOTO 110 100 !disp ' >>> Cannot recognise 'E' zap example ' \ goto 30 110 '/EURO:LIBRY OLD (EURO:EURODOC) 'E'.Z' 150 SAV 160 'EQU 'E' EURO:ZAP NO' 170 B=B' 'E 180 goto 30 To be able to execute this file as a current zap file first execute /EURO:LIBRY OLD (EURO:EURODOC) ZAPEXT USED 13.04 UNITS CAT SAVED FILES, USER NUMBER EZ99550 04/23/90 TIME02:36EDT B 900420 COMPARE 900420 MCHO19 900423 TALKER.Z 900423 TALKER 900423 A 900420 L 900423 LOG 900422 READY RUN COMAPARE FILENAME ILLEGAL-COMMAND NOT COMPLETED USED .17 UNITS RUN COMPARE COMPARE 02:36EDT 04/23/90 FILE CONTENT COMPARE PROGRAM INPUT FILES TO BE COMPARED F1?N F2?B I/O ERROR FROM PAGERD -- CODE 12 PROGRAM STOP AT 720 USED .90 UNITS CAT SAVED FILES, USER NUMBER EZ99550 04/23/90 TIME02:37EDT B 900420 COMPARE 900423 MCHO19 900423 TALKER.Z 900423 TALKER 900423 A 900420 L 900423 LOG 900422 READY RUN LOG LOG 02:37EDT 04/23/90 L 10 ch 12: Syntax error, character is : (octal 072). L 20 ch 12: Syntax error, character is : (octal 072). Missing END compiled. No execution USED 1.15 UNITS RUN B NECESSARY ACCESS NOT PERMITTED USED .19 UNITS RUN A NECESSARY ACCESS NOT PERMITTEDR USED .16 UNITSU N L L 02:37EDT 04/23/90 Missing END compiled. PROGRAM STOP AT (031130) USED 2.26 UNITS CD WHAT? NEW ENTER FILE NAME-- ABJ READY BYE 00033.90 CRU 0000.16 TCH 0030.74 KC OFF AT 02:38EDT 04/23/90  CLR PAD 180