background image

Summary of Contents for 5110

Page 1: ..._ o IBM 5110 Basic Reference Manual It...

Page 2: ...1978 Changes are continually made to the specifications herein any such changes will be reported in subsequent revisions or Technical Newsletters Requests for copies of IBM publications should be made...

Page 3: ...mmand 38 CLOSE 92 RUN Command 39 DATA 93 SAVE Command 41 DEF RETURN FNEND 95 SKI P Command 43 Single Line Function 95 UTI L Command 44 Multiline Function 96 Listing a File Directory 45 DELETE FILE 99...

Page 4: ...th IBM 5100 BASIC Tape Cartridge Handling and Care Storage Considerations Diskette Handling and Care Operation Handling Defective Cylinders Handling Precautions Storage Shipping and Receiving APPENDIX...

Page 5: ...Model 1 except that it has no built in tape unit The display screen and indicator lights communicate information to the user and the keyboard and switches allow the user to control the operations the...

Page 6: ...rsor flashing horizontal line indicates where the next input from the keyboard will be displayed If the cursor is moved to a position that already contains a character that character flashes As BASIC...

Page 7: ...nt of the alphameric keys and BASIC commands above the top row of numeric keys using the CMD key In lowercase character mode you can enter lowercase without using the shift key and uppercase using the...

Page 8: ...mode press to enter the character K to enter the charaacter single quotation mark to enter the keyword PAUSE In lowercase character mode press to enter the character k to enter the character K to ente...

Page 9: ...at on a BASIC only keyboard Figure 4 upper shift APL symbols above the alphameric characters can be entered as data even though they do not appear on the BASIC keyboard When any of the keys are presse...

Page 10: ...CD CD CJ J I CD OJ CD J GJ GJ _ GJCDCIJwCDCDITJ CJCDCIJ _ OCJD 0 0 0 Figure 3 Combined BASI C APL Keyboard J CD CD OJ CD CD OJ GJ J CJ 0 CD GJGJGJ GJCOGJCJGJCDOO CJGJ8 CJ Q GJ J GJ GJ GJ J J J CD OJ...

Page 11: ...tiate keys functions Avoid holding down the CMD key and pressing the HOLD key this activates a function restricted to use by service personnel Holding down the CM 0 key in standard BASIC character mod...

Page 12: ...spaced beyond the end of the input area the cursor returns to the first position of the input area When you hold down the CMD key and press this key you immediately insert a blank character at the cu...

Page 13: ...nd DISPLAY REGISTERS NORMAL This switch is for use by service personnel This switch should remain in the NORMAL position during system operation L32 64 R32 The three positions of this switch are L32 T...

Page 14: ...symbol 2 Press the spacebar to erase the symbol 3 Backspace the cursor to the blank position 4 Enter the correct character If you detect an error in a line after you press the EXECUTE key to enter th...

Page 15: ...ollowing models of the system the first digit represents model number 1 or 2 and the second digit represents storage size Model 812 and 822 32K Model 813 and 823 48K Model 814 and 824 64K In these mod...

Page 16: ...12...

Page 17: ...and File Operation Load or save programs or data on tape or diskette or mark tapes diskettes Program Operation List and number program statements or merge several programs into one program Parameters...

Page 18: ...TI L Command If you do not enter a device address with commands the default address will be used You can also enter SYS for the device address parameter in the OPEN FILE and CHAI N statements to speci...

Page 19: ...eters are enclosed in brackets Parameters enclosed in braces indicate that you must enter only one of the enclosed parameters Ellipses indicate that the preceding parameters can be repeated Single quo...

Page 20: ...e flashing screen The optional comment can be an instruction to change tapes or diskettes or perform other necessary operations Comment length is limited only by line length To resume normal operation...

Page 21: ...yed The syntax of the AUTO command is as shown above where line num is a positive integer specifying the first statement number to be generated The range of this number is 1 to 9999 If a beginning num...

Page 22: ...when the input line contains only the line number Example The following examples show AUTO commands AUTO then press the EXECUTE key In this example the display screen will show statement number 0010 A...

Page 23: ...of records specified exceeds the number of records remaining in the file the procedure file is closed The specified number must be a whole number For example an entry of 3 5 causes three records to be...

Page 24: ...rocessing in any of three modes of operation normal step or trace Thus you can change the operating mode with the GO command Program execution can be continued with the next sequential statement or at...

Page 25: ...will initiate rounding n can be 1 to 15 and is initialized to 6 If not specified n retains its last value Notes About GO The statement number entry is valid only during execution of a BASIC program Wh...

Page 26: ...kette see Device Address Parameter Upon successful execution of the LINK command the system transfers control to the support function you specified If an error occurs during the LINK operation the sys...

Page 27: ...of the display screen Up to 13 preceding lines fewer if less than 14 are defined are displayed on the lines above line 2 You can use the scroll up and scroll down keys t and to arrive at a particular...

Page 28: ...EXECUTE key To display line number 250 and the preceding 13 lines LIST 250 then press the EXECUTE key To print line number 250 and all lines following in the work area LIST PRINT 250 then press the EX...

Page 29: ...dev address is the address code of the device containing a saved file to be loaded see Device Address Parameter Entering a LOAD command of LOADO clears the entire workarea including all key groups A...

Page 30: ...unassigned work area remaining in bytes not for KEYx file types Notes About LOAD File type KEYS load all keys functions within the specified file is invalid when the file number is zero LOADO File ty...

Page 31: ...fore loading can continue The LOAD SOURCE command is terminated by an error other than a syntax error or by any use of a command key whether or not the key has a defined function see Function Keys Exa...

Page 32: ...file can be accessed by input output statements during program execution or by a procedure file to control program execution With line numbers and the colon removed the data file is a continuous strin...

Page 33: ...he REM key group is not found the program seeks statement 999x in the program and branches to it The DATA END and STOP statements are not permitted in a function key Thus READ MAT READ should not be e...

Page 34: ...g will be inserted into the current input line beginning at the current cursor position each time the 6 key is pressed while the CM D key is pressed 9996 KEY4 indicates that the function assigned to t...

Page 35: ...ank the input line before entering GO only in the first two positions of the line If you end the operation by entering anything other than GO in positions 1 and 2 the file already marked is unchanged...

Page 36: ...zed starting with a file preceding the eRe error A REWIND command is generally required before this MARK You can determine the size required for a file by comparing the amount of work area available b...

Page 37: ...y that lines merged from the file be renumbered starting with a statement number of your choice and increasing by the original file increment After the merge is completed the display shows the READY m...

Page 38: ...in the auxiliary tape unit will be merged with data in the work area Lines 4 200 from the file will be merged As the MERGE command is executed lines from the saved file are renumbered starting with l...

Page 39: ...t device address see Device Address Parameter Upon execution of a PROC command the file with the specified number or 10 for diskette on the specified device is accessed for procedure file data You can...

Page 40: ...f more digits are to be printed or displayed they will be rounded to the number specified At power on rounding is initially set to six digits Rounding can then be modified with the RD command or in th...

Page 41: ...where KEYx specifies a key group x 0 to 9 to be renumbered first line num is an integer 1 9989 identifying the number at which renumbering will begin If this number is not specified a beginning number...

Page 42: ...tax of the REWIND command is as shown above where Example dev address is the address of the tape unit to be rewound E8D for the built in tape unit or E4D for the auxiliary tape unit The default is the...

Page 43: ...n steps for debug purposes Trace Mode The statement number of each statement executed is displayed and or printed while the statement is executed Both step and trace modes are useful in locating progr...

Page 44: ...About RUN The RUN command will be rejected by the system if the work area file type is DATA The RUN command initializes all arithmetic variables and arrays to zeros and character variables and arrays...

Page 45: ...le name enclosed in single quotation marks the file number or both the file number and file name see File Reference Parameter File name is required for saving diskette files KEYS specifies that the co...

Page 46: ...ng on the definition of the work area If you interrupt execution of a SAVE command by pressing the ATTN key the operation is terminated If the interruption occurs before the file has been changed the...

Page 47: ...number must be a whole number For example an entry of 3 5 causes three records to be skipped with the 5 assumed to be the beginning of the optional comment comment is an optional comment Example The...

Page 48: ...r print a directory of file information currently on tape or diskette Rename a file on diskette Change or display a diskette volume ID and or owner ID Eliminate a file from diskette and make that file...

Page 49: ...contiguous 1 024 byte areas of storage unused in the file A number 0 9 indicating the number of defective physical record areas in the file or an asterisk indicating that the number is greater than 9...

Page 50: ...Storage in K d th In Icates more an nine defective areas For a diskette file directory a UTIL statement is UTIL DIR1 D80 The resulting output for diskette is shown in the following example user Identi...

Page 51: ...diskette only 11 BASIC work area file 12 BASIC KEYS file 15 APL mixed record file diskette only 16 Patch tape recovery and tape copy file 17 Diagnostic file 18 Communication file 19 IMF file 21 Utili...

Page 52: ...mber may be specified If both are specified they must be separated by a comma with file number first File name must always be enclosed in single quotation marks up to 17 characters new file name speci...

Page 53: ...rned off making the volume accessible If this parameter is entered both the current volume ID and owner ID must also be specified and must match those on the diskette dev address specifies the address...

Page 54: ...ifies the number of the file to be deleted This parameter is required for tape files it is optional for diskette files file name specifies the name of the file to be deleted This parameter can be up t...

Page 55: ...N is assumed file ref can be the file name enclosed in single quotation marks the file number or both file number and name see File Reference Parameter dev address specifies the address of the diskett...

Page 56: ...the IBM 5110 Customer Support Functions Reference Manual SA21 9311 Changing the System Default Device Address Normal system default device address for the 5110 Model 1 is the built in tape unit addre...

Page 57: ...in the BASIC language fall into three categories alphabetic numeric and special characters Alphabetic Characters The alphabetic characters in BASIC are the upper lowercase letters of the English alph...

Page 58: ...riod or decimal point Single quotation mark Semicolon Colon Ampersand Question mark Greater than symbol Less than symbol Not equal symbol Less than or equal symbol Greater than or equal symbol OR sign...

Page 59: ...this is printed THE j j Ij 1 1 11 I THE f C i I 1 t J r JI r r J L t1 ARITHMETIC DATA Arithmetic data is data with a numeric value All numbers in BASIC are expressed to the base 10 that is they are tr...

Page 60: ...ated as a positive number so plus signs are optional Integer Format Numbers expressed in integer format I format are written as a number of digits optionally preceded by a sign Examples of numbers in...

Page 61: ...as a power of 10 Note however that while the number 107 is permissible in scientific notation the number E7 is not a valid floating point number The value 107 must be expressed as 1E7 in BASIC floati...

Page 62: ...nts An arithmetic constant is either an integer a fixed point or a floating point number whose value is never altered during execution of the program Thus the integer 1 is a constant in the following...

Page 63: ...able is a named data item whose value is subject to change during execution of the program Arithmetic variables are named by a single letter of the extended alphabet A Z and or by a single letter of t...

Page 64: ...e which is 64 Character Variables A character variable is a named item of character data whose value is subject to change during execution of the program Character variables are named by a single lett...

Page 65: ...A 3 A 4 Two Dimensional Array Named B B l 1 B 1 2 B 1 3 B 2 1 B 2 2 B 2 3 B 3 1 B 3 2 B 3 3 B 4 1 B 4 2 B 4 3 Figure 6 Schematic Representation of One and Two Dimensional Arrays Each element in an ar...

Page 66: ...clared either explicitly by use of the USE or DIM statement or implicitly by a reference to an element of an array that has not been explicitly declared When an array is declared explicitly the dimens...

Page 67: ...AT input statement The new dimensions for the array can be specified with either a constant or by an expression Arithmetic Arrays An arithmetic array contains only numeric data and can have one or two...

Page 68: ...0 JONES 0 2 4 SMITH Character arrays can be used in input output and simple matrix assignment statements when no arithmetic operation is performed and can be redimensioned as described previously Sum...

Page 69: ...10 digits The system functions are listed in Figure 8 Function Name ABS x ACS x ASN x ATN x CEN x CHR x COS x COT x CSC x DEG x DET x EXP x HCS x HSN x HTN x IDX X Y INT x KLN X KPS X Description Abso...

Page 70: ...aracter string X Product of the elements of array x Number of radians in x degrees Length of the last record referenced for file X Random number between 0 and 12 Secant of x radians Sign of x 1 0 or 1...

Page 71: ...ent to test the truth of specified relationships between two values Expressions referring to entire arrays rather than individual array elements are called array expressions An expression that does no...

Page 72: ...d A 8 multiplication and addition respectively are both commutative in other words A 8 8 A and A 8 8 A However multiplication and addition are not always associative because of low order rounding erro...

Page 73: ...g it to its component subexpressions A subexpression is defined as a group that can be read operand operator operand where an operand is one of the following A simple reference to data constant or var...

Page 74: ...5 4t2 6 2 2 5 16 6 2 2 5 16 3 2 5 16 7 5 8 5 4t 2 6 2 2 5 4t 2 3 2 5 4t5 2 5 1024 2 5 1024 2 5 2560 4t 2 6 2 2 5 4t 8 2 2 5 4t4 2 5 256 2 5 256 2 5 640 A character expression is a character constant...

Page 75: ...ents 10 A PRODUCTION 20 B CONTROL 30 LET STR A 12 7 B statement 30 places the content of B CONTROL with the content of A PRODUCTION after the 11 th character which is a blank In statement 30 A is the...

Page 76: ...operator specified According to the result the relational expression is either satisfied true or not satisfied false Relational expressions can appear in a BASIC program only as part of an IF stateme...

Page 77: ...only if the relation between e1 and e2 and the relation between e3 and e4 is satisfied The vertical bar I is used to specify that either of two sets of expressions can compare in order for the relati...

Page 78: ...character ignoring the comma separators If the retrieved character is a single quotation mark the data item following must be a valid character constant The end of the character constant is indicated...

Page 79: ...An indexed file allows you to select a particular field up to 28 bytes of character data within each record to be used to identify that record The field you select is called the key for the record Ea...

Page 80: ...ccess by key index You can also combine the direct access by key and sequential access by key by specifying a KEY parameter on the first access only This gives you the records in ascending sequence be...

Page 81: ...ntains the hex FF character in all positions except the last four The last four positions are not used The first marker record must be the first record in the index file The second marker record is us...

Page 82: ...l number of buffers are allocated If logical record length is greater than physical record length but is not an even multiple buffers are allocated on the basis ofthe first multiple of physical record...

Page 83: ...the WRITE FILE statement referencing file FLS to indicate the following information Column 1 of file FLS indicates Character N F S A Q l 2 3 4 5 6 7 8 9 0 I Meaning Turn on the display screen Turn off...

Page 84: ...t already be on Turn off trace to the printer Columns 5 and 6 allow you to specify a 2 character numeric value a leading blank is valid for rounding of numeric data see RD Command If columns 7 through...

Page 85: ...rinter prints over the last line printed For example if you enter 08 the printed output is as shown in the following example 0010 PRINT FLP VAVAVAVAVAVAVAVAV4V4VAV4V6VAVAVAVAVAVAV4VAV4V 0020 WRITEFILE...

Page 86: ...6 18 19 21 Meaning Indicates the total area available in the system Indicates the available user work area for variables and buffer usage Indicates the line number of the last line printed on file ref...

Page 87: ...he character set selected _J Press the HOLD key To select then hold down the this national SH IFT key and press character set These characters change Hex Position C I L A 5A B F 6A 79 7B 7C Ai CO DO E...

Page 88: ...SKIP commands allow selective use of records in a procedure file The unconditional SKIP instructs the system to pass over a specified number of records The conditional CSKIP instructs the system to te...

Page 89: ...nzero return code skip five records in the procedure file otherwise get the next record If the CSKIP did not bypass records load program READY SORT Execute READY SORT Transfer control to the sort feat...

Page 90: ...c 86...

Page 91: ...ess of the order in which they were entered unless the sequence of execution is altered by branches loops or subroutines The allowable range of statement numbers for a BASIC program is from 1 through...

Page 92: ...isted below A brief description of each statement is included CHAIN Ends a program then loads and begins executing another program CLOSE FILE Deactivates open files DATA Creates an internal data table...

Page 93: ...ray elements expressions or constants in a format defined in an image or FORM statement MAT PUT Writes the values of specified variables expressions or array elements into a stream I O file MAT READ A...

Page 94: ...urrent program are closed The program in the file determined by the expression or constant on the device specified is then loaded and executed starting with the lowest statement number For example 011...

Page 95: ...B In this example the system will chain to the fourth file the procedure file on diskette drive 1 Note that the period preceding PROC4 in statement 70 is necessary to distinguish PROC4 from another va...

Page 96: ...overy exits which direct the program to branch to the specified line number upon the occurrence of the indicated error see EXIT statement Notes About CLOSE If a stream I O file is used for both input...

Page 97: ...int to the first constant again by the RESTORE statement The length of character constants to be assigned to character variables is limited only by line length 64 characters Notes About OATA Each cons...

Page 98: ...A sample DATA statement is as shown 110 DATA BILL 21 60 CHARGE 15 40 In this example the character constants BILL and CHARGE and the arithmetic constants 21 60 and 15 40 are inserted into the internal...

Page 99: ...eXp char var J char exp where function name is any character of the extended BASIC alphabet This character with FN is the name of the defined function For character valued functions this character mu...

Page 100: ...ression that specifies the value of the user defined function to the referencing function This expression must be of the same type arithmetic or character as the function defined FNEND comment The FN...

Page 101: ...s in a program is 29 and the maximum number of nested function references varies according to the complexity of the referencing statement User defined functions that are referred to during an input or...

Page 102: ...arithmetic expression of statement 90 The resulting value 47 is then substituted for the function reference FNB X in statement 100 The current value of Y which is 2 is then added to 47 and the result...

Page 103: ...n Chapter 3 EXIT NOKEY and IOERR are error conditions and associated line numbers to which program control will transfer if the error occurs EXIT is the line number of an EXIT statement NOKEY indicate...

Page 104: ...e dimensional array whose name is specified in a DIM statement is defined as having the number of elements represented by the rows entry A two dimensional array whose name is specified in a DIM statem...

Page 105: ...20 DIM Z 18 5 A 4 2 P 50 The result of the preceding statement is Z five strings array elements of 18 blank characters each Array A has four rows of two columns each o o o o o 0 o 0 Character variable...

Page 106: ...an END statement is encountered during execution of a program it causes all open files to be closed and it terminates processing The actions of the END statement are identical to those of the STOP st...

Page 107: ...error conditions that will transfer program control to their associated line number if the EXIT parameter in the input output statement specifies a branch to this EXIT state ment For the various input...

Page 108: ...ced by a PR INT statement contains a format other than PIC or C This error indicates that the specified relative record number in statements referencing record I O files is zero negative or greater th...

Page 109: ...FNEND comment o FNEND For a complete description of the FNEND statement see DEF RETURN FNEND G o BASIC Statements 105 _ _ __ _ _ _ _...

Page 110: ...value the loop is not executed Instead the value of the control variable is left unchanged and control goes to the statement following the NEXT statement If the loop is executed the control variable...

Page 111: ...a FOR loop is permitted however a NEXT statement cannot be executed unless its corresponding FOR statement has been executed previously FOR loops can be nested within one another as long as the intern...

Page 112: ...rithmetic variable for line position If the truncated value of your entry is less than 1 this control specification is not used If your entry exceeds total line length the current line is displayed or...

Page 113: ...same format repeatedly This parameter must be greater than O C indicates the length of a displayed or printed field into which a corresponding character expression in the PRINT statement is to be outp...

Page 114: ...nificant digit Floating minus sign A plus sign for a positive number or a minus sign for a negative number is to be printed immediately before the first significant digit These positions can be used a...

Page 115: ...s into a field generally to improve readability The following insertion characters can be specified Character B Meaning Print a blank unconditionally Print a comma conditionally only if a digit preced...

Page 116: ...ing Displaying with FORM The line number of a FORM statement can be specified in a PRINT USING statement A FORM statement can appear anywhere in a program Array items are formatted in row order If val...

Page 117: ...ple FORM statement is shown below 30 FORM C18 PIC When used with this PRINT statement where B 999 09 190 PRINT USING 30 FLP BALANCE DUE B the resulting output is BALANCE DU E 7 blanks 0999 09 _ _ BASI...

Page 118: ...the record length it will cause an error If the value is an arithmetic variable the truncated integer portion of the value is used to determine the record position X indicates the number of positions...

Page 119: ...the number of characters to be assigned exceeds the number you specify only the specified number of leftmost characters are written into the record The C parameter is valid only for character data and...

Page 120: ...le input the next 2 4 or 8 bytes in the record contain a signed binary value to be converted by the system into internal data format and assigned to the variable s specified in the READ FILE or REREAD...

Page 121: ...placed in each position that can potentially contain a floating dollar sign that is a dollar sign to the immediate left of the first significant digit Nonsignificant zeros are suppressed This characte...

Page 122: ...n of the record unless zero suppression is in effect and no significant digits appear to the left of the slash in the record In this case the slash will be replaced by a floating or zero suppression c...

Page 123: ...ition of the record unless zero suppression is in effect and no significant digits appear to the left of the dollar sign in the record In this case the dollar sign will be replaced by an asterisk or a...

Page 124: ...aracters The same character cannot appear as both a static character and part of a floating character string in a single PIC string A string of floating characters must contain at least one more float...

Page 125: ...pped and the number of characters equal in length to the variable A 18 by default in this example to be read into A Ten more positions are skipped and the next seven positions in the record are conver...

Page 126: ...CONV and IOERR are error recovery exits see EXIT statement When the GET statement is executed the values from the specified file FLO FL9 are assigned to the referenced variables Subsequent GET statem...

Page 127: ...amples A sample GET statement is as shown 0090 GET FL4 X Y Z MAT A 4 D EOF 620 In this example the values in file FL4 are assigned respectively to variables X Y Z the four elements of array A and the...

Page 128: ...assed The format of the RETURN statement is simply RETURN Execution of a simple GOSUB statement causes an unconditional transfer of control to the statement whose number is specified Execution of a co...

Page 129: ...broutines is 20 minus 1 for each keys function called see Function Keys Example The following examples show the execution of GOSUB and RETURN statements 50 GOSUB 100 60 100 140 RETURN 80 GOSUB 150 90...

Page 130: ...pression to be evaluated and control transferred to the statement whose numeric position in the list of statement numbers reading left to right is equal to the truncated integer value of the expressio...

Page 131: ...ion s is true When an IF statement is executed the expressions are compared as specified by the relational operator If the relationship is true control is transferred to the specified statement number...

Page 132: ...F R CAT GOTO 70 50 IF 52 37 222 GOTO 120 60 IF X Y GOTO 90 70 IF A B I C O GOTO 110 80 IF A JOB B OATE GOTO 100 In statement 40 for example if character variable R contains the word CAT program contro...

Page 133: ...tion of the image statement see MAT PRINT USING and Image FORM The image statement formatting specifications can also be assigned to a character variable as shown below 90 A TOTAL COST IS 100 PRINT US...

Page 134: ...displays a question mark on the display screen and program execution halts You must then enter a list of values that will be assigned in the order they are entered to the variables listed in the MAT...

Page 135: ...T INPUT statement If you do not enter enough values the program will request more input If you enter too many values the extra entries will be ignored by the program Referenced arrays can be redimensi...

Page 136: ...to a specific length by using the DIM statement The initial value of undimensioned character variables is set to 18 blank characters When assigned to a character variable a character constant is adju...

Page 137: ...of statement 30 the ninth member of the one dimensional arithmetic array V will have the integer value 2 After execution of statement 40 the arithmetic variable X will have the decimal value 4 5 The n...

Page 138: ...NEXT control var NEXT For a complete description of the NEXT statement see FOR and NEXT 134 1 _...

Page 139: ...ameters override the ONERROR statement If an error occurs after execution of an ON ERROR statement LlNE and ERR are set but all other error indicators internal pointers are reset Therefore the data in...

Page 140: ...at LINE LlNE RUN ERROR 681 HAS OCCURRED AT LINE 20 In this example the ONERROR statement at statement number 010 causes the program to go to statement number 050 if any errors occur The ONERROR state...

Page 141: ...h a file reference code Allocate work space for the file Specify the file number Specify the identification to be used with the file Specify the file usage input output or both The syntax of the OPEN...

Page 142: ...ile on the device specified Decimal values for variables are truncated to an integer char var is a character variable or character constant enclosed in single quotation marks The first 17 characters p...

Page 143: ...parameter to indicate that output is to start at the beginning of extent BOE of the file on diskette If this parameter is not entered output will be added to the end of the file NOBLOCK indicates that...

Page 144: ...IN KEY or ALL KEY is specified ALL KEY indicates that the file is a key index file to be used for both input and output IOERR line num and EXIT line num have the same meaning as described for the OPEN...

Page 145: ...d the index file is sorted The size of this space is normally a multiple of the sum of the key length plus two 3 When accessing records in the file with subsequent READ FILE WRITE FILE and other recor...

Page 146: ...cution is interrupted and the message PAUSE s is shown on line 0 of the display screen where s is the line number of the PAUSE statement To resume program operation you must issue a GO command Note th...

Page 147: ...can control spacing of the displayed or printed expressions by inserting commas or semicolons between the expressions see TAB Function Expressions can be arithmetic or character character constants m...

Page 148: ...of B beginning in position 19 and the value of C beginning in position 37 Packed Print Zones are variable in length and usually produce a more dense line of output than full print zones The semicolon...

Page 149: ...iling blanks Packed print zones usually produce a denser line of output than full print zones Length of Converted Length of Packed Example 0 Data Item Print Zone represents a characters characters bla...

Page 150: ...print or display values not included in the preceding 1 or E format descriptions Display Line Operation As the values of expressions or array elements are transferred to the display screen an internal...

Page 151: ...the contents of displayed and the pointer the first record are wr it is set to the start of the ten and the expression next record will start at the beginning of the next record Semicolon The pointer...

Page 152: ...at the beginning of the next record If the end of the record is encoun tered before the char acters are written the record is printed or dis played and the remaining characters will be written starti...

Page 153: ...isplayed The pointer is moved past Constant any remaining spaces in the Semicolon full print zone If the end of the record isreached the record is printed or displayed and the pointer is set to the st...

Page 154: ...er Operation The print line buffer is a temporary storage location where the characters for each print line are placed After all data for a print line has been placed in the buffer the data line is pr...

Page 155: ...NT statement except as the final delimiter Examples The following examples show the output resulting from several PRINT statements Statement 10 PRINT FLP A B 20 PRINT A B 30 LET A B 40 PRINT FLP A A 5...

Page 156: ...T statement 10 DIM A 3 4 A 12 C 2 2 20 MAT READ A A 30 DATA 1 2 3 4 5 6 7 8 9 10 11 12 40 DATA A 8 C D E F G H I J K L 50 MAT C 1 60 MAT PRINT A 70 MAT PRINT A 80 MAT PRINT C Displayed output will be...

Page 157: ...ed FLO to FL9 must have been previously referenced in an OPEN statement line num is the stat ment number of the image statement or FORM statement that defines how data is to be formatted when printed...

Page 158: ...expression value is positive a plus sign is edited into the line If the format specification contains a plus sign and the expression value is negative a minus sign is edited into the line If the forma...

Page 159: ...arithmetic data decimal points and the plus and minus signs like the characters in the general format description are printed as entered provided the values are appropriate to the specified signs See...

Page 160: ...ng character string isan F format specification The following rules define the end of a format specification that has been started 1 A character is encountered and 2 a The following character is not a...

Page 161: ...INT USING statement ended in a line If this is the first PRINT or PRINT USING statement output begins on a new line If the PRINT USING statement contains expressions or array elements that exceed form...

Page 162: ...ts permitted in a BASIC program is only limited by available storage If the MAT PRINT USING statement output list contains at least one item there must be at least one format specification in the corr...

Page 163: ...RATE OF LOSS EQUALS POUNDS 110 PRINT USING A A B Note that A must have been previously dimensioned to the appropriate length 90 DIM A 39 The following example shows execution of a MAT PRINT USING sta...

Page 164: ...a MAT PUT statement is executed the specified scalar reference or array element value is entered from left to right into a buffer for the specified file beginning at the current file position The fil...

Page 165: ...error A stream I O file accessed with a MAT PUT statement must have been opened with an OPEN statement Numeric values are written as numeric constants with only insignificant zeros dropped All other...

Page 166: ...cution a pointer is set to the first value in the data table When a READ or MAT READ statement is encountered successive values from the data table are assigned to the variables or array elements in a...

Page 167: ...which it is assigned Examples The following shows the execution of READ statements 10 DATA JONES 15 00 SMITH 20 50 20 READ A A1 8 81 30 DATA 1 2 3 4 5 6 40 READ A 8 C X A X 8 X C After execution of t...

Page 168: ...ber specified or assigned to the character variable specified If this parameter is not entered the system assumes that numeric data is in internal format and that precision is identical to that curren...

Page 169: ...e followed The keyword MAT must precede referenced arrays unless all references in the data list are arrays In this case use the keywords MAT READ FILE EOF IOERR NOKEY CONV and NOREC error recovery ex...

Page 170: ...last access to the file being referenced must have been with a MAT READ FILE or another MAT REREAD FILE statement The CONV and EXIT error recovery exits are the same as those described for the MAT REA...

Page 171: ...characters This is an optional entry The REM statement is nonexecutable It appears in program listing but has no effect on program execution Notes About REM A REM statement can be used anywhere in a...

Page 172: ...record will then be the next record in the file to be accessed This parameter is valid only for record I O files KEY or allows you to specify the key field in the record to which you want the file res...

Page 173: ...If you specify a particular key and the system is unable to locate that key the record with the next higher sequential key is accessed if KEY is specified Otherwise an error will occur Notes About RES...

Page 174: ...he internal data table pointer from its current position to the beginning of the table The optional comment is a character string that does not affect the execution of the statement Notes About RESTOR...

Page 175: ...he use of the RETURN statement in the creation of subroutines see the GOSUB and RETURN statements Also see Function Keys For the use of the RETURN statement with a multiline function definition see th...

Page 176: ...MAT REWRITE FILE statement the last access to the file must have been a READ FILE or REREAD FI LE statement for the record to be changed Upon execution the variables or arrays in the MAT REWRITE FILE...

Page 177: ...OREC 999 In this example record number 8 on the file referenced by FL9 will be rewritten with variables 0 F and R using the format specifications in the FORM statement at line number 100 If record num...

Page 178: ...a STOP statement IS encountered during execution of a program it causes all open files to be closed and it terminates processing The actions of the STOP statement are identical to those of the END st...

Page 179: ...signed to the common area of storage len1 allows you to specify the number of characters to be assigned to the char var or each element of a character array Notes About USE If a variable is defined as...

Page 180: ...instance in this example 0290 USE A 9 4 T C an array A with nine rows of four columns each is assigned to the common storage area In addition the scalar variables T and C are also assigned to the comm...

Page 181: ...te null fields into the record If the number of variables in the MAT WRITE FilE statement exceeds the control specifications in the FORM statement the control specifications will be reused from the be...

Page 182: ...and matrices must have been defined either implicitly or explicitly in a DIM or USE statement MAT ASSIGNMENT STATEMENTS MAT assignment statements allow you to assign values to elements of an array The...

Page 183: ...xpression in rows columns is used to redimension the array before the scalar value is evaluated and assigned to each of the array elements For character arrays if the expression value is shorter than...

Page 184: ...180 Example The following example shows the execution of a MAT assignment scalar statement 40 DIM Y 3 3 50 MAT Y 2 2 1 The resulting values are Y is Columns Rows...

Page 185: ...the corresponding element of the array specified to the left of the equal sign If redimension specifications follow the name to the left of the equal sign the truncated integer portion of each expres...

Page 186: ...llowing example shows the execution of a MAT assignment simple statement 20 DIM A 2 2 B 2 2 100 MAT A 8 The resulting values are represented below a b e f If B and A c d 9 h then after statement 100 a...

Page 187: ...d and the result of the operation is assigned to the corresponding elements in the matrix specified to the left of the equal sign If redimension specifications follow the matrix name to the left of th...

Page 188: ...Examp The following example shows execution of this statement 10 DIM X 3 3 Y 2 2 Z 2 2 100 MAT X 2 2 Y Z The resulting values are a b e a e b f If Y and Z then X c d 9 h c g d h c 1 4...

Page 189: ...mns is used to redimension the matrix before values are assigned to it Notes About MAT Matrix Multiplication All three matrices specified must be numeric If the matrix specified to the left of the equ...

Page 190: ...186 Example The following example shows the execution of this MAT assignment stat mtmt 10 DIM X 2 2 Y 2 2 Z 2 2 100 MAT Z X Y The resulting values are a b e f If X and Y then Z c d 9 h I...

Page 191: ...pression is evaluated and each element in the matrix to the right of the equal sign is multiplied by the value of the expression The result is assigned to the corresponding elements of the matrix to t...

Page 192: ...Example The following example shows execution of a MAT assignment statement 20 DIM X 2 2 Y 2 2 100 MAT Y 4 X The resulting values are a b 4 a 4 b If X then Y c d 4 c 4 d _ 188...

Page 193: ...value 1 All other elements for example A 2 3 or A 3 1 are assigned the value O If redimension specifications follow the matrix name the truncated integer portion of each expression value in rows colu...

Page 194: ...190 Example The following example shows the execution of a MAT identity function statement 50 DIM X 16 60 MAT X 4 4 ION The resulting values are 0 0 0 0 0 0 X is 0 0 0 0 0 0...

Page 195: ...atrix Not every matrix has an inverse The system function DET see System Functions can be used to determine whether a given matrix has an inverse The inverse of matrix A exists if DET A c O If redimen...

Page 196: ...llowing example shows execution of a MAT inverse statement 20 DIM X 2 2 Y 2 2 80 IF DET Y 0 GOTO 300 90 MAT X INV Y 295 GOTO 310 300 PRINT SINGULAR MATRIX 310 STOP The resulting values are If Y is the...

Page 197: ...come the values in row y of the other array If redimension specifications follow the rray name to the left of the equal sign the truncated integer portion of each expression value in rows columns is u...

Page 198: ...194 Example The following example shows the execution of a MAT transpose function statement 40 DIM A 3 2 8 2 3 80 MAT 8 TRN A The resulting values are a d D If A is b e then B is d e f c f...

Page 199: ...al sign according to the order of the values entered into the array on the right of the equal sign In other words the system determines the sequence of the values then indicates the positions in the a...

Page 200: ...ment is the same as execution of the ascending index statement AIDX except that arr y elements are indexed in descending order Notes About Descending Index 80th arrays specified must be one dimensiona...

Page 201: ...ility is provided through an additional parameter FLP in PRINT MAT PRINT PRINT USING and MAT PRINT USING statements An entry of FLO FL9 in this position directs output to the file referred to in a cor...

Page 202: ...with negative file numbers Negative file numbers will cause an error The internal data format of the 5100 is packed decimal the internal format of the 5110 is binary Therefore the results of calculat...

Page 203: ...unlight Do not touch or clean the tape surface If a data cartridge has been exposed to a temperature drop exceeding 30 0 F or _1 0 C since the last usage move the tape to its limits before using the t...

Page 204: ...ormat Numeric variable long precision Numeric variable short precision Numeric array long precision Numeric array short precision Number of Bytes Required 22 Length of the variable plus 5 18 times the...

Page 205: ...Diskette Removal 1 2 3 Open the diskette drive cover Remove the diskette by grasping its upper edge and pulling it straight out Slide the diskette into its envelope and return it to a clean storage a...

Page 206: ...wo sided diskettes both tracks of a cylinder must be relocated if either is defective Two defective cylinders per diskette can be replaced in this manner Periodically examine the log of diskette seria...

Page 207: ...tective envelope whenever it is removed from the diskette drive and whenever you are writing on a label on the diskette Do not bend or fold the diskette Do not use rubber bands or paper clips on the d...

Page 208: ...or drink while handling the diskette Do not expose the diskette to excessive heat or sunlight Do not use magnets or magnetized objects near the diskette Data can be lost from a diskette that is expose...

Page 209: ...esidue could get in the diskette and this should be avoided To discourage erasures IBM recommends that you use a fiber tip or ball point pen when marking on the diskette labels Mark temporary labels b...

Page 210: ...opes in stacks of ten or less If storing vertically support the diskettes so they do not lean or sag Long Term Storage Store diskettes not needed for immediate use in their original shipping cartons w...

Page 211: ...s protective envelope Put 10 diskettes in a 10 diskette box Put each 10 diskette box between spacers to prevent damage during shipping Insert top and bottom pads in the carton Place the 10 diskette bo...

Page 212: ...208...

Page 213: ...o c 0 A tI S t u V hI X Y z n u I r B X J 7 t T I C A B C II E F r H I N N J A v D J K I tvl N P R It I t E T U V W X Y Z f c 1 1 8 F 0 1 r 3 4 5 6 1 B 9 I f A t For example the character 0 has value...

Page 214: ...n the keys correspond to the following diagram KEYBOARD CHARACTERS FOR XXXX T f Nfi Rfi jE i I ER Ef R R5fi I I I I NO SHIFT I I I I UPPER SHIFT I 1 I I COMMAND SHIFT I I I 1 1 I LOWERCASE I I CHA Ef...

Page 215: ...1 FILE 1 FNEND I FOR I FORM I I II I 1 1 1 1 1 1 1 1 1 1 1 1 1 1 q 1 w 1 e 1 1 t 1 y 1 u 1 i 1 0 1 p 1 1 1 1 Q 1 W 1 E I R I T I Y 1 lJ I I 1 D I P 1 t 1 1 I 1 J I 1 p l i t I I 1 a 1 1 1 tJ 1 I I I f...

Page 216: ...0 1 I I II 1 0 C 1 0 C 1 1 E E l I U I U 1 1 I 1 1 1 1 I Ii 1 I I I I i C I C 1 l E E I U I U 1 1 1 1 I 1 I I 1 1 T 1 T 1 1 I I I i C T C I 1 E E l I U l U I 1 I 1 MoM 1 Figure 12 5110 Keyboard Charac...

Page 217: ...us forms Maximum number of copies is six but for optimum feeding and stacking IBM recommends a maximum of four parts per form Adjustable forms tractor that allows the use of various width forms The fo...

Page 218: ...rizontal position The diagrams below show the proper forms path for singlepart and multipart forms Push the paper release lever to the rear to activate the friction feed rolls Place the forms on the t...

Page 219: ...rm guide rack to a horizontal position 16 Turn the paper advance knob to position the form for the first line to be printed The paper should exit over the forms guide rack 17 18 Note To move the form...

Page 220: ...lace the form in position behind the platen and against the cut forms guide 7 Turn the paper advance knob to position the form for the first line to be printed Improve the paper alignment if necessary...

Page 221: ...ty you desire If you are using multipart forms and the ribbon is smudging the first sheet rotate the copy control dial toward 8 one click at a time until smudging stops HOW TO REPLACE A RIBBON PART NU...

Page 222: ...reful to disengage it from the clip on the print head 9 Lay the ribbon loop on the top of the ribbon in the ribbon box Pick up the entire ribbon and discard it Disk Ribbon Holder 1O Eject the new ribb...

Page 223: ...e other part of the loop through the slot in the bottom of the ribbon box 18 Thread the ribbon through the guide shoe and around the left guide post 19 Insert the horizontal part of the ribbon twist b...

Page 224: ...ker should contact the metal clips on the cover The stacker can be bent if too much weight is applied Under normal conditions printed forms should not be allowed to accumulate higher than 1 inch in th...

Page 225: ...I X bO X 61 X 62 X X 63 _ 0 X 6L IB X 65 I X 66 fl X b7 A X t B X 6 X 6A X 6B t X 6C X bD X 6E _ 6F x 0 X 1 U X 72 X 73 _ X 7LI A X 7 lU X 76 X 77 0 X 70 A X 79 ff X 7A t1 X lEt F i X 7C i X 7D X 71 5...

Page 226: ...222...

Page 227: ...G OEnter GO or GO END to end the program or enter GO x to continue where x is the statement number of any statement in your program Use this recovery for errors that occur during program execution GE...

Page 228: ...sition 007 Tape read error Use the LI NK command to load the Tape Recovery program and recover as much data as possible 008 The next expected Try the operation again If the physical record cannot be e...

Page 229: ...nel 024 No VOL1 label on the Reinitialize the diskette diskette 025 Invalid diskette Reinitialize the diskette 026 028 Hardware error Retry the operation If the error recurs call your service personne...

Page 230: ...to format the file s occurs again use another diskette 043 Attempting to access a Use the UTIL VOLID command to volume protected turn off the volume protection diskette indicator 045 The diskette is...

Page 231: ...three digit messages as shown in the following list Error Meaning Recovery 500 Syntax error in OorG statement in key group header or in FORM specification from a character variable during program exe...

Page 232: ......

Page 233: ...s invalid use of sign character 524 FORM statement PIC OorG string not in range of 1 to 32 characters between parentheses 525 FORM statement PIC o orG string contains no digit specifiers or floating s...

Page 234: ...nction key not loaded e or not defined for request 554 Next line generated by Auto numbering is terminated AUTO command would enter line numbers via the exceed 9999 or attempt keyboard to load a data...

Page 235: ...VE command SAVE command SAVE is terminated 559 Input line on LOAD e or scroll up the line and ignore SOURCE command it exceeds 64 bytes 560 One of the following has CD occurred The file type is incorr...

Page 236: ...o recovery For tape reached the end of the reel before MARK completed For diskette reached end of the diskette before MARK completed For tape the last marked file and K bytes C allocated to the file a...

Page 237: ...ed tape file for output 608 File type on the file IS OorG not valid for input 609 One of the following has 0 occurred OPEN FILE specified to device 000 or 001 I j OPEN specified to device 002 OPEN FIL...

Page 238: ...n record OorG I O file is O 619 OPEN specified output to o orG a file that is not empty and the file 10 does not match the lOin the header specified 621 Insufficient storage to G verify that correct m...

Page 239: ...OREC condition found CD 638 KEY specified on CD unindexed file or REC specified on indexed file 639 DELETE FILE specifies CD file that is not indexed record or ALL 640 RESET specifies KEY to G noninde...

Page 240: ...RI NT referred to an input record or stream input file 647 An I O operation was e attempted during evaluation of a function referenced in an input or output statement 648 REWRITE does not CD follow a...

Page 241: ...e an array not previously defined 665 INV argument is singular e 666 ION function specified e for a nonsquare matrix 667 Operand dimensions are e invalid for the function used and the specified result...

Page 242: ...y subscripts e used for an array reference 701 Subscript not in range of e specified dimensions too large or negative 702 Reference found to a e user defined function that is undefined for this progra...

Page 243: ...n or error in LEN function 714 File reference in KLN e KPa orRLN notFL FLS or FLO FL9 715 Parameters for STR are e zero or exceed the first argument length 716 Storage exceeded trying e _ 1 to allocat...

Page 244: ...24b...

Page 245: ...et line voltage and the input voltage to the TV set This transformer should be permanently wired into the circuit The new input power plug must be a three prong grounded plug with the ground connected...

Page 246: ...242 r...

Page 247: ...buffer space 78 buffers diskette 160 print 150 tape 160 CHAIN statement 90 changing a diskette volume 10 changing default address 52 character arrays 64 character constants 60 character data 59 chara...

Page 248: ...eference parameter 14 file size 32 file type 2 165 file types 47 fixed length data 74 fixed point format 56 floating point format 57 244 FLS 79 FNEND statement 95 105 FOR statement 106 FORM statement...

Page 249: ...tement 153 MAT PUT statement 160 MAT READ FILE statement 164 MAT READ statement 162 MAT REREAD FILE statement 166 MAT REWRITE FILE statement 172 MAT WRITE FILE statement 177 matrix 73 178 matrix inver...

Page 250: ...mmand 39 SAV E command 41 scalar expressions 67 scroll down key 8 scroll up key 8 search argument 76 selecting diskette sort 52 semicolon 157 semicolon delimiter 145 sequential access 74 246 shift key...

Page 251: ...ntrol 80 transfer program control 126 transfer program control on results 127 transpose 193 TRN 193 TV monitor 241 type 2 file 165 _ _ _ underscore character 55 update a record I O file USE statement...

Page 252: ...248...

Page 253: ...ation typographical illustration and so on No reply Page Number Error Note All comments and suggestions become the property of IBM o No postaga necessary if mailed in the U S A Inaccurate or misleadin...

Page 254: ...ications Dept 245 Rochester Minnesota 55901 Fold FIRST CLASS PERMIT NO 40 ARMONK N Y Fold Fold _ International Business Machines Corporation General Systems Division 4111 Northside Parkway N W P O Box...

Page 255: ......

Reviews: