ArticleslgStudy

science

System/34 BASIC

System/34 BASIC is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand System/34 BASIC rather than just read about it. In short: IBM System/3 BASIC was an interpreter for the BASIC programming language for the IBM System/34 midrange computer. System/34 BASIC was first offered in 1978, and as such, contained many of the trappings that a BASIC program would have encountered in the time period of the TRS-80, or many other offerings of the 1970s and early 1980s.

Key takeaways

  • System/34 BASIC belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect System/34 BASIC to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of System/34 BASIC from memory before moving on to harder problems.

Reference excerpt

IBM System/3 BASIC was an interpreter for the BASIC programming language for the IBM System/34 midrange computer. System/34 BASIC was first offered in 1978, and as such, contained many of the trappings that a BASIC program would have encountered in the time period of the TRS-80, or many other offerings of the 1970s and early 1980s. As such, S/34 BASIC uses conventions that are no longer standard in modern BASICs, such as line numbers, and does not support newer features such as WHILE/WEND, DO/ENDDO, WITH/END WITH, procedures, properties, and so forth.

BASIC conventions BASIC statements are expected to be entered in capital letters, and while the operator can press Cmd2 to use lowercase, the BASIC interpreter will convert non-comment keywords into uppercase. So that BASIC could be useful in a midrange computing environment, IBM added extensions to the language that were specific to the hardware and software conventions of the IBM System/34 Family, such as the WORKSTN file, support for indexed, direct, and sequential disk files, the ability to open and close multiple printer files, and LOAD/SAVE from libraries on the fixed disk.

BASIC statements These core BASIC statements, functions, and commands were used:

More advanced IBM-supplied statements included:

ON ERROR is an error-trapping statement that allows BASIC to suspend an error that might otherwise stop a BASIC program from running and perform an error-handling routine instead. Variants include suffixing OFLOW, ZDIV, and other error types to a statement and immediately trap these errors. OPTION allows the BASIC program to meet special criteria. Sometimes BASIC did not have very much user space (since all S/34 programs are limited to 64K) and the area called "code space" which contains the current user program must reside within the user space. Therefore, users could choose OPTION LPREC which causes BASIC to compute with double-precision (long) numerics, or OPTION SPREC which provides more space and single-precision (short) numerics. Some programmers prefer matrix mathematics where the lowest-numbered index is 0, others prefer 1. OPTION BASE 0 and OPTION BASE 1 accomplish this. There are other uses for OPTION. RPG II programs on the S/34 could not call each other, but BASIC programs could, using the CHAIN statement. CHAIN passes control from the current BASIC module to the named module, bearing a list of arguments which can become variables in the new module when it is loaded. DEF FN allows the definition of a user function in BASIC which can be named and referred in the program. FNEND is placed after the last statement in a function. There are four ways to format BASIC input and output. First, unformatted; just PRINT and INPUT to your heart's content. Second, with PRINT USING, which in S/34 BASIC can incorporate a constant, a string variable, a line number, or a label. Third, with PRINT FIELDS and INPUT FIELDS, which place 5250-type display fields on the CRT in immediate mode. Fourth, by using a workstation file (opened with OPEN #x: "WS,NAME=" and so forth) and performing various combinations of WRITE and READ to that workstation file, using SDA-generated screen formats similar to those in other S/34 applications. WRITE and READ, as well as PRINT USING and INPUT USING, can direct BASIC to a line number or a label that contains the keyword "IMAGE:". An IMAGE statement contains decimals, commas, dollar signs, dashes, and pound signs ("#") in representation of the substituted numeric or alphameric values.

A FORM statement denotes the size of the variables to be read or written. To save a numeric value of .00 to 99,999.99, use this notation:

A label is a tag on a line as follows:

If desired, the statement GOSUB BEGIN_CALCULATIONS can be used instead of GOSUB 260. OPEN, CLOSE, WRITE, REWRITE, DELETE, and APPEND are already familiar to COBOL programmers and describe the actions taken to access S/34 disk files using BASIC. It isn't possible to access every single type of S/34 file because these include system files, libraries, and folders, but every user-created S/34 file with a fixed record length (only FORTRAN programs can use variable record lengths) will suffice. Disk files can be opened sequentially, by index, or relatively (by record number). If a file is delete-capable, records can be deleted using the DELETE statement. To add a record, use WRITE (with APPEND specified in the OPEN statement) and to update use REWRITE.

Printing In S/34 BASIC, to print to the printer, a device file must be used. A default printer file called #255 always exists when BASIC is started. It has a printer name of BASIC255 and opens the device that is the default printer for the terminal that begins a BASIC session. If desired, it is possible to create a different printer file numbered between 1 and 254. Use OPEN #x: PRINTER,NAME= and so forth to do this, specifying columns or device ID or other parameters as needed. The PAGEOFLOW keyword can be used to trap the page overflow condition for the printer.

Array Some versions of BASIC allow the programmer to sort an array. S/34 BASIC doesn't provide a function for this, but it does provide an interesting remedy. The programmer can define an array with the same number of elements as the target array and use AIDX or DIDX to create an ascending or descending index. Each element of the new array will contain a number representing the ordinal sorted position of the target array, so if AMERICA is the sixth element of array A$ but first in alphabetical order, then setting A() = AIDX(A$) would cause A(1) to contain the value 6. To save a BASIC program to a library member, SAVE is used, and REPLACE when an update is made. SAVE PROG1,PGMRLIB causes the current module to be saved as a subroutine member (type R) named PROG1 in a user library named PGMRLIB. Note that System/34 files are not part of libraries. If a disk file is named FNF001, then an OPEN statement like this one can work:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with System/34 BASIC

Start with the simplest possible case. Write down what System/34 BASIC claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to System/34 BASIC before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about System/34 BASIC ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of System/34 BASIC

In research
System/34 BASIC appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses System/34 BASIC in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
System/34 BASIC is common in secondary-school and first-year university syllabi. It links to neighbouring topics BASIC interpreters, BASIC programming language family, so understanding it makes those chapters shorter.
In everyday life
Look for System/34 BASIC outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “System/34 BASIC” →

How to study System/34 BASIC in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what System/34 BASIC means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain System/34 BASIC out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is System/34 BASIC in simple terms?

IBM System/3 BASIC was an interpreter for the BASIC programming language for the IBM System/34 midrange computer. System/34 BASIC was first offered in 1978, and as such, contained many of the trappings that a BASIC program would have encountered in the time period of the TRS-80, or many other offer…

Why does System/34 BASIC matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study System/34 BASIC?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on System/34 BASIC.

Tags

  • BASIC interpreters
  • BASIC programming language family

Keep exploring